dnl Process this file with autoconf to produce a configure script. dnl ====NOTE: When the user has PREFIX defined, use that one. dnl ---------------------------------------------------------------- AC_INIT(nomad1.c) version=1.3 AC_SUBST(version) dnl The default PREFIX: AC_PREFIX_DEFAULT( .. ) dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CC dnl Checks for libraries. AC_PROG_RANLIB AC_MSG_CHECKING(options from computer) case `uname -m` in alpha) a="alpha"; LIBSYS="-ldnet_stub" ;; sun4*) a="solaris"; LIBSYS="-lnsl -lsocket" ; which cc | fgrep SUNWspro>/dev/null && CC=cc && cc_opt="-Xt -DSOLARIS";; x86_64) a="linux"; LIBSYS="-lcrypt"; cc_opt="-Wall" ;; i??6) a="linux"; LIBSYS="-lcrypt"; cc_opt="-Wall" ;; *) a="unknown"; LIBSYS="" ;; esac AC_MSG_RESULT($a) AC_SUBST(cc_opt) AC_SUBST(LIBSYS) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h termio.h dirent.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_MSG_CHECKING(64bit-integer) echo ' #include int main() { if (sizeof(int) == 4) printf("int"); else printf("long"); if (sizeof(long long) == 8) printf(" long long"); else printf(" long"); putchar(012); /* printf("%d\n", sizeof(long)); */ } ' > ttest.c $CC ttest.c a=`./a.out` rm -f ttest.* a.out int4="`echo $a|cut -d' ' -f1`" int8="`echo $a|cut -d' ' -f2-`" AC_MSG_RESULT($int8) AC_SUBST(int8) AC_SUBST(int4) dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(gethostname socket strerror) dnl ---- Verify the STRIP utility is not corrupted ! AC_MSG_CHECKING(strip utility) echo ' #include int main() { char buffer[[BUFSIZ]]; while(fgets(buffer, sizeof(buffer), stdin)) printf(">%s\\n", buffer); } ' > ttest.c $CC ttest.c a=`strip a.out 2>&1| wc -w` rm -f ttest.* a.out if test $a -lt 1; then a=" ok " STRIP=strip else a=" ***bad strip***" STRIP=echo fi AC_MSG_RESULT($a) AC_SUBST(STRIP) AC_SUBST(CC) AC_OUTPUT(Makefile) dnl ------------------------------------------------------------------------ test $prefix = .. && altprefix=/usr/local || altprefix=\$HOME dnl --- Indicate the Default Directory Installation --- echo "----the prefix for installation directories is: $prefix" echo " If this choice is not convenient, re-execute this configure" echo " with the --prefix option, e.g." echo " ./configure --prefix=$altprefix" echo "----Otherwise, proceed with make followed by make install" dnl ------------------------------------------------------------------------