dnl dnl Process this file with autoconf 1.6 or later to produce a configure script dnl Requires ./aclocal.m4 dnl AC_INIT(config/ldmconfig.h.in) AC_ARG_ENABLE(faux-pq, AC_HELP_STRING([--enable-faux-pq], [use the faux product-queue [[default=disable]]]), [ PQ_DIR=fauxPq PQ_PATH="\$etc_path/pq.xml" ], [ PQ_DIR=pq PQ_PATH="\$data_path/ldm.pq" ]) AC_SUBST(PQ_DIR) AC_SUBST(PQ_PATH) AC_ARG_ENABLE(logging, AC_HELP_STRING([--enable-logging=facility], [use "facility" when logging [[default=local0]]]), [ facility=`echo $enableval | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` AC_DEFINE_UNQUOTED([LOG_LDM], [LOG_$facility]) AC_SUBST(LOG_LDM, $enableval) ], [ AC_DEFINE_UNQUOTED(LOG_LDM, LOG_LOCAL0) AC_SUBST(LOG_LDM, local0) ]) AC_ARG_ENABLE(port, AC_HELP_STRING([--enable-port=port], [use "port" for LDM server [[default=388]]]), [ LDM_PORT=$enableval ldm_prog=300029 ], [ LDM_PORT=388 ldm_prog=300029 ]) AC_DEFINE_UNQUOTED(LDM_PORT, $LDM_PORT) AC_DEFINE_UNQUOTED(LDM_PROG, $ldm_prog) AC_SUBST(LDM_PORT) AC_ARG_ENABLE(max-size, AC_HELP_STRING([--disable-max-size], [minimize the (long, void*, off_t) programming environment [[default=enable]]]), max_size=$enableval, max_size=yes) AC_CONFIG_HEADER(config/ldmconfig.h) AC_SUBST(PATH) VERSION=`cat VERSION` AC_SUBST(VERSION) CFLAGS=${CFLAGS-"-O"} AC_PROG_CC(c89 cc gcc) if test -z "$CC"; then AC_MSG_ERROR(no C compiler found) else AC_MSG_CHECKING(the C compiler) AC_COMPILE_IFELSE([int foo;], AC_MSG_RESULT(works), AC_MSG_FAILURE($CC failed to compile test code)) fi ARFLAGS=-cru if test "$max_size" = yes then AC_MSG_NOTICE(Checking how to maximize the (long, void*, off_t) programming environment) success=no AC_MSG_CHECKING([if the system supports _XBS5_LPBIG_OFFBIG]) avail=`getconf _XBS5_LPBIG_OFFBIG 2>/dev/null` if test $? = 0 -a "$avail" \!= -1 -a "$avail" \!= "undefined" then if cflags=`getconf XBS5_LPBIG_OFFBIG_CFLAGS 2>/dev/null` then if ldflags=`getconf XBS5_LPBIG_OFFBIG_LDFLAGS 2>/dev/null` then if libs=`getconf XBS5_LPBIG_OFFBIG_LIBS 2>/dev/null` then maprgns=-U_MAPRGNS success=yes fi fi fi fi AC_MSG_RESULT($success) if test "$success" = no then AC_MSG_CHECKING([if the system supports _XBS5_LP64_OFF64]) avail=`getconf _XBS5_LP64_OFF64 2>/dev/null` if test $? = 0 -a "$avail" \!= -1 -a "$avail" \!= "undefined" then if cflags=`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null` then if ldflags=`getconf XBS5_LP64_OFF64_LDFLAGS 2>/dev/null` then if libs=`getconf XBS5_LP64_OFF64_LIBS 2>/dev/null` then maprgns=-U_MAPRGNS success=yes fi fi fi fi AC_MSG_RESULT($success) fi if test "$success" = no then AC_MSG_CHECKING([if the system supports _XBS5_ILP32_OFFBIG]) avail=`getconf _XBS5_ILP32_OFFBIG 2>/dev/null` if test $? = 0 -a "$avail" \!= -1 -a "$avail" \!= "undefined" then if cflags=`getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null` then if ldflags=`getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null` then if libs=`getconf XBS5_ILP32_OFFBIG_LIBS 2>/dev/null` then AC_DEFINE(_MAPRGNS, 1) maprgns=-D_MAPRGNS success=yes fi fi fi fi AC_MSG_RESULT($success) fi if test "$success" = yes then test -n "$cflags" && CFLAGS="$CFLAGS${CFLAGS+ }$cflags" test -n "$ldflags" && LDFLAGS="$LDFLAGS${LDFLAGS+ }$ldflags" test -n "$libs" && LIBS="$LIBS${LIBS+ }$libs" test `uname` = AIX && ARFLAGS='-cru -X 32_64' AC_MSG_NOTICE([$maprgns]) AC_MSG_NOTICE([cflags=\"$cflags\"]) AC_MSG_NOTICE([ldflags=\"$ldflags\"]) AC_MSG_NOTICE([libs=\"$libs\"]) AC_MSG_NOTICE([ARFLAGS=\"$ARFLAGS\"]) AC_MSG_CHECKING([the C compiler (again)]) AC_COMPILE_IFELSE([int foo;], AC_MSG_RESULT(works), AC_MSG_FAILURE($CC failed to compile test code)) fi fi AC_SUBST(ARFLAGS) UD_CPPFLAGS UD_PREFIX(..) AC_REVISION ($Revision: 1.47.18.19 $) UD_DOMAINNAME UD_HPUX UD_PROG_CPP UD_PROG_AR UD_PROG_PERL UD_PROG_SH UD_PROG_YACC AC_PROG_RANLIB UD_LIB_YACC UD_MMAP UD_LDMHOME() AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(ptrdiff_t, int) AC_CHECK_FUNCS(timegm) TYPE_SOCKLEN_T UD_NO_HEADERS(stdlib.h unistd.h) UD_NO_FUNCS(fsync ftruncate memmove memcmp rename strerror waitpid strdup seteuid setenv mmap) UD_SIG_ATOMIC_T AC_C_CONST AC_STRUCT_ST_BLKSIZE UD_NO_POSIXSIGNALS UD_SYSLOG_PIDFILE AC_SUBST(CFLAGS) UD_NETWORKING UD_ULOG UD_PROCTITLE UD_NEILLEY_COMPAT UD_DB UD_MAKEWHATIS libs=$LIBS LIBS= AC_SEARCH_LIBS( [dirname], [gen], [LD_GEN=$LIBS AC_SUBST([LD_GEN]) LIBS=$libs], [AC_MSG_ERROR([Could not find required function dirname],[1])]) AC_CONFIG_SUBDIRS(rpc) #AC_MSG_NOTICE() #AC_MSG_NOTICE([Configuring in "rpc" subdirectory]) #cmd="(cd rpc && CC=\"$CC\" CFLAGS=\"$CFLAGS\" ./configure --prefix=$prefix)" #AC_MSG_NOTICE([$cmd]) #eval $cmd || exit #AC_MSG_NOTICE() AC_OUTPUT( \ macros.make \ scour/scour \ scripts/ldmadmin \ scripts/writeConfiguration.pl \ scripts/ldmfail \ scripts/netcheck \ scripts/syscheck \ scripts/ldmcheck \ )