Ignore:
Timestamp:
1999-10-15T15:18:00+13:00 (25 years ago)
Author:
cs025
Message:

Changes to build MG into autoconfiguration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/configure.in

    r674 r684  
    11dnl Process this file with autoconf to produce a configure script.
    22AC_INIT(lib/text_t.h)
     3AC_CONFIG_HEADER(config.h)
     4AC_ARG_PROGRAM
    35
    46PACKAGE=gsdl
     
    2123AC_PROG_CC
    2224AC_PROG_CXX
     25AC_PROG_AWK
     26AC_PROG_YACC
    2327dnl AC_PROG_INSTALL
    2428AC_PROG_LN_S
    2529AC_PROG_MAKE_SET
    2630AC_PROG_RANLIB
     31
     32
     33dnl Checks for typedefs, structures, and compiler characteristics.
     34AC_AIX
     35AC_ISC_POSIX
     36AC_MINIX
     37fp_C_PROTOTYPES
     38AC_C_CONST
     39AC_TYPE_OFF_T
     40AC_TYPE_SIZE_T
     41AC_HEADER_TIME
     42AC_STRUCT_TM
     43
     44dnl --- This should be in the stdc checking -----------------
     45if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
     46dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
     47dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
     48dnl XOPEN extensions (like popen).
     49dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
     50dnl needs. So drop back to -Xa
     51AC_TRY_COMPILE(
     52[#include <stdio.h>
     53], [ FILE *rubbish = popen("yes", "r"); ],,
     54[CC="`echo $CC | sed 's/-Xc/-Xa/'`"    ac_cv_prog_cc_stdc='-Xa'])
     55fi
     56dnl ----------------------
     57
    2758
    2859dnl Checks for libraries.
     
    3768
    3869dnl Checks for header files.
     70AC_HEADER_DIRENT
    3971AC_HEADER_STDC
    40 AC_CHECK_HEADERS(fcntl.h)
    41 
    42 dnl Checks for typedefs, structures, and compiler characteristics.
    43 AC_C_CONST
    44 AC_HEADER_TIME
    45 
     72AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
     73AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
     74AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
     75AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
     76
     77dnl Checks for library functions.
     78AC_FUNC_ALLOCA
     79AC_PROG_GCC_TRADITIONAL
     80AC_TYPE_SIGNAL
     81AC_FUNC_VPRINTF
     82AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
     83AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
     84
     85
     86# *** Custom checking (based on GNU tar configure.in) ***
     87# ---------------------------------------------------------------------------
     88AC_MSG_CHECKING(for HP-UX needing gmalloc)
     89if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
     90  AC_MSG_RESULT(yes)
     91  LIBOBJS="$LIBOBJS gmalloc.o"
     92  AC_DEFINE(HAVE_VALLOC)
     93else
     94  AC_MSG_RESULT(no)
     95  AC_CHECK_FUNCS(valloc)
     96fi
     97
     98fp_WITH_DMALLOC
     99fp_WITH_REGEX
     100
     101# ---------------------------------------------------------------------------
     102if test "$ac_cv_func_alloca" = 'no'; then
     103dnl    support functions for alloca.c
     104  LIBOBJS="$LIBOBJS xmalloc.o error.o"
     105fi
     106
     107
     108# ---------------------------------------------------------------------------
     109
     110dnl
     111dnl Switch into C++
     112dnl
     113AC_LANG_CPLUSPLUS
     114
     115dnl
     116dnl Check that the GDBM library is available
     117dnl
     118AC_MSG_CHECKING("that the GDBM library is available")
     119AC_TRY_COMPILE(
     120[#include <gdbm.h>
     121],
     122[],
     123success=yes,
     124success=no
     125)
     126AC_MSG_RESULT($success)
     127if test $success = "no"; then
     128AC_MSG_ERROR("GDBM Library not available - cannot install")
     129fi
     130
     131dnl
     132dnl Now check that Perl is actually around, and can be found
     133dnl
     134AC_MSG_CHECKING("that Perl 5 is available")
     135success="no"
     136pl_path="$PATH"
     137IFS="${IFS=   }"; pl_save_ifs="$IFS"; IFS=":"
     138for pl_dir in $pl_path; do
     139  test -z "$pl_dir" && pl_dir=.
     140  if test -x $pl_dir/perl; then
     141    success="yes"
     142    break
     143  fi
     144done
     145IFS="$pl_save_ifs"
     146
     147dnl
     148dnl Perl actually can be run; now we see if it is version 5 by
     149dnl running a sample script (which returns a "clean" version number
     150dnl and then tests the result using expr.  If perl errors in some
     151dnl way (eg. broken Perl executable, missing script), we set a failure
     152dnl value ("0") and then proceed as best we can
     153dnl
     154if test $success = "yes"; then
     155try=`perl configtest.pl` || try="0"
     156try=`expr $try \> 5.000`
     157if test $try = "1"; then
     158AC_MSG_RESULT("yes")
     159else
     160success="no"
     161fi
     162fi
     163
     164if test $success = "no"; then
     165AC_MSG_RESULT("no")
     166AC_MSG_ERROR("Perl 5 not available - cannot install")
     167fi
    46168
    47169dnl
     
    53175dnl know now, before things really go wrong!
    54176dnl
    55 AC_LANG_CPLUSPLUS
    56177success=no
    57178AC_MSG_CHECKING("whether STL library has known faults")
     
    89210else
    90211AC_MSG_RESULT("yes")
    91 AC_MSG_ERROR("STL Broken - new not found in vector header file")
     212AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
    92213fi
    93214
     
    95216AC_SUBST(gsdlos)
    96217
    97 dnl Checks for library functions.
    98 AC_FUNC_VPRINTF
    99 
    100 AC_OUTPUT(src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile src/db2txt/Makefile lib/Makefile collect/cstr/src/recpt/Makefile collect/niupepa/src/recpt/Makefile Makefile)
    101 
    102 
    103 
    104 
     218AC_MSG_CHECKING(for HP-UX needing gmalloc)
     219if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
     220  AC_MSG_RESULT(yes)
     221  LIBOBJS="$LIBOBJS gmalloc.o"
     222  AC_DEFINE(HAVE_VALLOC)
     223else
     224  AC_MSG_RESULT(no)
     225  AC_CHECK_FUNCS(valloc)
     226fi
     227
     228fp_WITH_DMALLOC
     229fp_WITH_REGEX
     230
     231# ---------------------------------------------------------------------------
     232if test "$ac_cv_func_alloca" = 'no'; then
     233dnl    support functions for alloca.c
     234  LIBOBJS="$LIBOBJS xmalloc.o error.o"
     235fi
     236
     237
     238# ---------------------------------------------------------------------------
     239
     240AC_OUTPUT(packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
     241          packages/mg/src/scripts/Makefile packages/mg/lib/Makefile
     242          src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile
     243          src/db2txt/Makefile lib/Makefile collect/cstr/src/recpt/Makefile
     244          collect/niupepa/src/recpt/Makefile Makefile)
     245
     246
     247
     248
Note: See TracChangeset for help on using the changeset viewer.