GNU make release 3.77.
[make.git] / configure.in
blob8c25b53aca98b332884a38e34e9a46aa75a5bb7d
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION([$Id: configure.in,v 1.60 1998/07/30 20:55:27 psmith Exp $])
3 AC_PREREQ(2.12)dnl              dnl Minimum Autoconf version required.
4 AC_INIT(vpath.c)dnl             dnl A distinctive file to look for in srcdir.
6 AM_INIT_AUTOMAKE(make, 3.77)
7 AM_CONFIG_HEADER(config.h)
8 AC_CONFIG_SUBDIRS(glob)
10 AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
12 dnl Regular configure stuff
14 AC_PROG_MAKE_SET
15 AC_PROG_CC
16 AC_PROG_INSTALL
17 AC_PROG_CPP                     dnl Later checks need this.
18 dnl AC_ARG_PROGRAM -- implied by AM_INIT_AUTOMAKE; gives errors if run twice.
19 AC_AIX
20 AC_ISC_POSIX
21 AC_MINIX
23 dnl This test must come as early as possible after the compiler configuration
24 dnl tests, because the choice of the file model can (in principle) affect
25 dnl whether functions and headers are available, whether they work, etc.
26 AC_LFS
28 AC_HEADER_STDC
29 AC_HEADER_DIRENT
30 AC_TYPE_UID_T                   dnl Also does gid_t.
31 AC_TYPE_PID_T
32 AC_TYPE_SIGNAL
33 AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
34                  sys/timeb.h)
35 AC_PROG_CC_C_O
36 AC_C_CONST                      dnl getopt needs this.
37 AC_HEADER_STAT
39 AC_SUBST(LIBOBJS)
41 AC_DEFUN(AC_CHECK_SYMBOL, [dnl
42 AC_MSG_CHECKING(for $1)
43 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
44 AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);],
45             ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
46 if test "$ac_cv_check_symbol_$1" = yes; then
47 changequote(,)dnl
48   ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
49 changequote([,])dnl
50   AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
52 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
54 AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
55                dup2 getcwd sigsetmask getgroups setlinebuf \
56                seteuid setegid setreuid setregid strerror strsignal)
57 AC_CHECK_SYMBOL(sys_siglist)
58 AC_FUNC_ALLOCA
59 AC_FUNC_VFORK
60 AC_FUNC_SETVBUF_REVERSED
61 AC_FUNC_GETLOADAVG
62 AC_CHECK_LIB(kstat, kstat_open)
63 AC_FUNC_STRCOLL
65 # Check out the wait reality.
66 AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
67 AC_MSG_CHECKING(for union wait)
68 AC_CACHE_VAL(make_cv_union_wait, [dnl
69 AC_TRY_LINK([#include <sys/types.h>
70 #include <sys/wait.h>],
71             [union wait status; int pid; pid = wait (&status);
72 #ifdef WEXITSTATUS
73 /* Some POSIXoid systems have both the new-style macros and the old
74    union wait type, and they do not work together.  If union wait
75    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
76 if (WEXITSTATUS (status) != 0) pid = -1;
77 #ifdef WTERMSIG
78 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints.  */
79 -- blow chunks here --
80 #endif
81 #endif
82 #ifdef HAVE_WAITPID
83 /* Make sure union wait works with waitpid.  */
84 pid = waitpid (-1, &status, 0);
85 #endif
87             [make_cv_union_wait=yes], [make_cv_union_wait=no])])
88 if test "$make_cv_union_wait" = yes; then
89   AC_DEFINE(HAVE_UNION_WAIT)
91 AC_MSG_RESULT($make_cv_union_wait)
93 AC_DECL_SYS_SIGLIST
95 # The presence of the following is not meant to imply
96 # that make necessarily works on those systems.
97 AC_CHECK_LIB(sun, getpwnam)
99 AC_SUBST(REMOTE) REMOTE=stub
100 make_try_customs=no
101 AC_ARG_WITH(customs,
102 [  --with-customs=DIR      Enable remote jobs via Customs--see README.customs],
103 [case "$withval" in
104   n|no) ;;
105   *) make_cppflags="$CPPFLAGS"
106      case "$withval" in
107        y|ye|yes) ;;
108        *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
109           make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
110      esac
111      CF_NETLIBS
112      AC_CHECK_HEADER(customs.h,
113                      REMOTE=cstms
114                        LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
115                      with_customs=no
116                        CPPFLAGS="$make_cppflags" make_badcust=yes)
117      ;;
118 esac])
120 echo checking for location of SCCS get command
121 if test -f /usr/sccs/get; then
122   SCCS_GET=/usr/sccs/get
123   AC_DEFINE(SCCS_GET, "/usr/sccs/get")
124 else
125   SCCS_GET=get
126   AC_DEFINE(SCCS_GET, "get")
128 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
129 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
130    test -f s.conftest; then
131   # We successfully created an SCCS file.
132   echo checking if SCCS get command understands -G
133   if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 &&
134      test -f conftoast; then
135     AC_DEFINE(SCCS_GET_MINUS_G)
136   fi
138 rm -f s.conftest conftoast
140 AC_OUTPUT(Makefile build.sh)
142 case "$make_badcust" in
143   yes) echo
144        echo "WARNING: --with-customs specified but no customs.h could be found;"
145        echo "         disabling Customs support."
146        echo ;;
147 esac
149 case "$with_customs" in
150   ""|n|no|y|ye|yes) ;;
151   *) if test -f "$with_customs/lib/libcustoms.a"; then
152        :
153      else
154        echo
155        echo "WARNING: \`$with_customs/lib' does not appear to contain the"
156        echo "         Customs library.  You must build and install Customs"
157        echo "         before compiling GNU make."
158        echo
159      fi ;;
160 esac
162 dnl Local Variables:
163 dnl comment-start: "dnl "
164 dnl comment-end: ""
165 dnl comment-start-skip: "\\bdnl\\b\\s *"
166 dnl compile-command: "make configure config.h.in"
167 dnl End: