xref: /dragonfly/contrib/bmake/configure.in (revision a34d5fb1)
101e196c8SJohn Marinodnl
201e196c8SJohn Marinodnl RCSid:
3a34d5fb1SAntonio Huete Jimenezdnl	$Id: configure.in,v 1.70 2021/02/01 18:29:26 sjg Exp $
401e196c8SJohn Marinodnl
501e196c8SJohn Marinodnl Process this file with autoconf to produce a configure script
601e196c8SJohn Marinodnl
76a91b982SJohn MarinoAC_PREREQ(2.50)
8a34d5fb1SAntonio Huete JimenezAC_INIT([bmake], [20210201], [sjg@NetBSD.org])
96a91b982SJohn MarinoAC_CONFIG_HEADERS(config.h)
1001e196c8SJohn Marino
115f1e34d9SAlexandre Perrindnl make srcdir absolute
125f1e34d9SAlexandre Perrincase "$srcdir" in
135f1e34d9SAlexandre Perrin/*) ;;
145f1e34d9SAlexandre Perrin*) srcdir=`cd $srcdir && pwd`;;
155f1e34d9SAlexandre Perrinesac
165f1e34d9SAlexandre Perrin
17ca58f742SDaniel Fojtdnl get _MAKE_VERSION
18ca58f742SDaniel Fojt. $srcdir/VERSION
19ca58f742SDaniel FojtOS=`uname -s`
20ca58f742SDaniel Fojt
2101e196c8SJohn Marinodnl
2201e196c8SJohn MarinoAC_ARG_WITH(defshell,
2301e196c8SJohn Marino[  --with-defshell=SHELL  use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions],
2401e196c8SJohn Marino[case "${withval}" in
2501e196c8SJohn Marinoyes)   AC_MSG_ERROR(bad value ${withval} given for bmake DEFSHELL) ;;
2601e196c8SJohn Marinono)    ;;
2701e196c8SJohn Marino*)     case "$with_defshell" in
2801e196c8SJohn Marino       sh)  DEFSHELL_INDEX=DEFSHELL_INDEX_SH;;	# it's the default anyway
2901e196c8SJohn Marino       ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;;
3001e196c8SJohn Marino       csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;;	# kidding right?
3101e196c8SJohn Marino       *)   defshell_path=$with_defshell;;	# better be sh compatible!
3201e196c8SJohn Marino       esac
3301e196c8SJohn Marino       ;;
3401e196c8SJohn Marino       esac])
3501e196c8SJohn Marinodnl
36ca58f742SDaniel Fojtcase "$OS" in
37ca58f742SDaniel FojtCYGWIN*|MINGW*) use_makefile=no;;
38ca58f742SDaniel Fojt*) use_makefile=yes;;
39ca58f742SDaniel Fojtesac
40ca58f742SDaniel FojtAC_ARG_WITH(makefile,
41a34d5fb1SAntonio Huete Jimenez[  --without-makefile disable use of generated makefile],
42ca58f742SDaniel Fojt[case "${withval}" in
43ca58f742SDaniel Fojtyes|no) use_makefile=${withval};;
44ca58f742SDaniel Fojt*) AC_MSG_ERROR(bad value ${withval} given for makefile) ;;
45ca58f742SDaniel Fojtesac])
46ca58f742SDaniel Fojtdnl
4701e196c8SJohn Marinouse_meta=yes
4801e196c8SJohn MarinoAC_ARG_WITH(meta,
49a34d5fb1SAntonio Huete Jimenez[  --without-meta disable use of meta-mode],
5001e196c8SJohn Marino[case "${withval}" in
5101e196c8SJohn Marinoyes|no) use_meta=${withval};;
5201e196c8SJohn Marino*) AC_MSG_ERROR(bad value ${withval} given for meta) ;;
5301e196c8SJohn Marinoesac])
5401e196c8SJohn Marinodnl
5501e196c8SJohn MarinoAC_ARG_WITH(filemon,
56ca58f742SDaniel Fojt[  --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev],
5701e196c8SJohn Marino[ case "/${withval}" in
58ca58f742SDaniel Fojt/no) use_filemon=no;;
59ca58f742SDaniel Fojt/*trace) filemon_h=no use_filemon="${withval}";;
60ca58f742SDaniel Fojt*/filemon.h) filemon_h="${withval}";;
6101e196c8SJohn Marino*/filemon*) filemon_h="${withval}/filemon.h";;
6201e196c8SJohn Marino*) AC_MSG_ERROR(bad value ${withval} given for filemon) ;;
63ca58f742SDaniel Fojtesac
64ca58f742SDaniel Fojtcase "$use_filemon,$filemon_h" in
65ca58f742SDaniel Fojt,*.h) use_filemon=dev;;
66ca58f742SDaniel Fojtesac
67ca58f742SDaniel Fojt],
6801e196c8SJohn Marino[
69ca58f742SDaniel Fojtcase "$OS" in
70ca58f742SDaniel FojtNetBSD) filemon_h=no use_filemon=ktrace;;
71ca58f742SDaniel Fojt*)
72ca58f742SDaniel Fojt    for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon"
7301e196c8SJohn Marino    do
7401e196c8SJohn Marino        for x in "/$OS" ""
7501e196c8SJohn Marino        do
7601e196c8SJohn Marino            filemon_h="$d$x/filemon.h"
7701e196c8SJohn Marino            test -s "$filemon_h" && break
7801e196c8SJohn Marino        done
79ca58f742SDaniel Fojt        test -s "$filemon_h" && { use_filemon=dev; break; }
8001e196c8SJohn Marino    done
81ca58f742SDaniel Fojt    ;;
82ca58f742SDaniel Fojtesac
83ca58f742SDaniel Fojtuse_filemon=${use_filemon:-no}
84ca58f742SDaniel Fojtcase "$use_filemon" in
85ca58f742SDaniel Fojtdev) ;;
86ca58f742SDaniel Fojt*) filemon_h=no;;
87ca58f742SDaniel Fojtesac
8801e196c8SJohn Marino])
89ca58f742SDaniel Fojtdnl echo "Note: use_meta=$use_meta use_filemon=$use_filemon filemon_h=$filemon_h" >&6
9001e196c8SJohn Marinocase "$use_meta" in
9101e196c8SJohn Marinoyes)
92ca58f742SDaniel Fojt	case "$use_filemon" in
93ca58f742SDaniel Fojt	no) ;;
94ca58f742SDaniel Fojt	*) echo "Using: filemon_${use_filemon}.c" >&6;;
9501e196c8SJohn Marino	esac
9601e196c8SJohn Marino	;;
9701e196c8SJohn Marinoesac
9801e196c8SJohn Marinodnl
9901e196c8SJohn Marinodnl Check for OS problems
10001e196c8SJohn Marinodnl Solaris's signal.h only privides sigset_t etc if one of
10101e196c8SJohn Marinodnl _EXTENSIONS_ _POSIX_C_SOURCE or _XOPEN_SOURCE are defined.
10201e196c8SJohn Marinodnl The later two seem to cause more problems than they solve so if we
10301e196c8SJohn Marinodnl see _EXTENSIONS_ we use it.
10401e196c8SJohn MarinoAC_USE_SYSTEM_EXTENSIONS
10501e196c8SJohn Marinodnl Checks for programs.
10601e196c8SJohn MarinoAC_PROG_CC
107ca58f742SDaniel FojtAC_PROG_CC_C99
108ca58f742SDaniel Fojtdnl AC_PROG_GCC_TRADITIONAL
10901e196c8SJohn MarinoAC_PROG_INSTALL
11001e196c8SJohn Marinodnl Executable suffix - normally empty; .exe on os2.
11101e196c8SJohn MarinoAC_SUBST(ac_exe_suffix)dnl
1126a91b982SJohn Marinodnl
1136a91b982SJohn Marinodnl Hurd refuses to define PATH_MAX or MAXPATHLEN
1146a91b982SJohn Marinoif test -x /usr/bin/getconf; then
1156a91b982SJohn Marino   bmake_path_max=`getconf PATH_MAX / 2> /dev/null`
1166a91b982SJohn Marino   # only a numeric response is useful
1176a91b982SJohn Marino   test ${bmake_path_max:-0} -gt 0 2> /dev/null || bmake_path_max=
1186a91b982SJohn Marinofi
1196a91b982SJohn Marinobmake_path_max=${bmake_path_max:-1024}
1206a91b982SJohn Marinoif test $bmake_path_max -gt 1024; then
1216a91b982SJohn Marino   # this is all we expect
1226a91b982SJohn Marino   bmake_path_max=1024
1236a91b982SJohn Marinofi
1246a91b982SJohn Marinoecho "Using: BMAKE_PATH_MAX=$bmake_path_max" >&6
1256a91b982SJohn MarinoAC_SUBST(bmake_path_max)dnl
12601e196c8SJohn Marinodnl
12701e196c8SJohn Marinodnl AC_C_CROSS
12801e196c8SJohn Marinodnl
12901e196c8SJohn Marino
13001e196c8SJohn Marinodnl Checks for header files.
13101e196c8SJohn MarinoAC_HEADER_SYS_WAIT
13201e196c8SJohn MarinoAC_HEADER_DIRENT
13301e196c8SJohn Marinodnl Keep this list sorted
134f445c897SJohn MarinoAC_CHECK_HEADERS(sys/param.h)
135f445c897SJohn Marinodnl On BSDi at least we really need sys/param.h for sys/sysctl.h
136f445c897SJohn MarinoAC_CHECK_HEADERS([sys/sysctl.h], [], [],
137f445c897SJohn Marino[#ifdef HAVE_SYS_PARAM_H
138f445c897SJohn Marino# include <sys/param.h>
139f445c897SJohn Marino# endif
140f445c897SJohn Marino])
141f445c897SJohn Marino
14201e196c8SJohn MarinoAC_CHECK_HEADERS( \
14301e196c8SJohn Marino	ar.h \
14401e196c8SJohn Marino	err.h \
14501e196c8SJohn Marino	fcntl.h \
146f445c897SJohn Marino	libgen.h \
147f445c897SJohn Marino	limits.h \
14801e196c8SJohn Marino	paths.h \
14901e196c8SJohn Marino	poll.h \
15001e196c8SJohn Marino	ranlib.h \
15101e196c8SJohn Marino	sys/mman.h \
15201e196c8SJohn Marino	sys/select.h \
15301e196c8SJohn Marino	sys/socket.h \
15401e196c8SJohn Marino	sys/time.h \
15501e196c8SJohn Marino	sys/uio.h \
15601e196c8SJohn Marino	utime.h \
15701e196c8SJohn Marino	)
15801e196c8SJohn Marino
15901e196c8SJohn Marinodnl Both *BSD and Linux have sys/cdefs.h, most do not.
16001e196c8SJohn Marinodnl If it is missing, we add -I${srcdir}/missing to CFLAGS
16101e196c8SJohn Marinodnl also if sys/cdefs.h does not have __RCSID we need to use ours
16201e196c8SJohn Marinodnl but we need to include the host's one too *sigh*
16301e196c8SJohn MarinoAC_CHECK_HEADER(sys/cdefs.h,
16401e196c8SJohn Marinoecho $ECHO_N "checking whether sys/cdefs.h is compatible... $ECHO_C" >&6
16501e196c8SJohn MarinoAC_EGREP_CPP(yes,
16601e196c8SJohn Marino[#include <sys/cdefs.h>
16701e196c8SJohn Marino#ifdef __RCSID
16801e196c8SJohn Marinoyes
16901e196c8SJohn Marino#endif
17001e196c8SJohn Marino],
17101e196c8SJohn Marinoecho yes  >&6,
17201e196c8SJohn Marinoecho no  >&6; CPPFLAGS="${CPPFLAGS} -I`cd ${srcdir}/missing && pwd` -DNEED_HOST_CDEFS_H"),
17301e196c8SJohn MarinoCPPFLAGS="${CPPFLAGS} -I`cd ${srcdir}/missing && pwd`")
17401e196c8SJohn Marino
17501e196c8SJohn Marinodnl Checks for typedefs, structures, and compiler characteristics.
17601e196c8SJohn MarinoAC_C___ATTRIBUTE__
17701e196c8SJohn MarinoAC_C_BIGENDIAN
17801e196c8SJohn MarinoAC_C_CONST
179f445c897SJohn MarinoAC_TYPE_MODE_T
18001e196c8SJohn MarinoAC_TYPE_OFF_T
18101e196c8SJohn MarinoAC_TYPE_PID_T
18201e196c8SJohn MarinoAC_TYPE_SIZE_T
183f445c897SJohn MarinoAC_TYPE_UINT32_T
18401e196c8SJohn MarinoAC_DECL_SYS_SIGLIST
18501e196c8SJohn MarinoAC_HEADER_TIME
18601e196c8SJohn MarinoAC_STRUCT_TM
18701e196c8SJohn Marino
188a34d5fb1SAntonio Huete Jimenezdnl we need sig_atomic_t
189a34d5fb1SAntonio Huete JimenezAH_TEMPLATE([sig_atomic_t],[type that signal handlers can safely frob])
190a34d5fb1SAntonio Huete JimenezAC_CHECK_TYPE(sig_atomic_t,,[
191a34d5fb1SAntonio Huete JimenezAC_DEFINE([sig_atomic_t],[int],)
192a34d5fb1SAntonio Huete Jimenez],[
193a34d5fb1SAntonio Huete Jimenez#ifdef HAVE_SYS_TYPES_H
194a34d5fb1SAntonio Huete Jimenez#include <sys/types.h>
195a34d5fb1SAntonio Huete Jimenez#endif
196a34d5fb1SAntonio Huete Jimenez#include <signal.h>
197a34d5fb1SAntonio Huete Jimenez])
198a34d5fb1SAntonio Huete Jimenez
19901e196c8SJohn Marinodnl Checks for library functions.
20001e196c8SJohn MarinoAC_TYPE_SIGNAL
20101e196c8SJohn MarinoAC_FUNC_VFORK
20201e196c8SJohn MarinoAC_FUNC_VPRINTF
20301e196c8SJohn MarinoAC_FUNC_WAIT3
20401e196c8SJohn Marinodnl Keep this list sorted
20501e196c8SJohn MarinoAC_CHECK_FUNCS( \
20601e196c8SJohn Marino	err \
20701e196c8SJohn Marino	errx \
20801e196c8SJohn Marino	getcwd \
20901e196c8SJohn Marino	getenv \
21001e196c8SJohn Marino	getopt \
21101e196c8SJohn Marino	getwd \
21201e196c8SJohn Marino	killpg \
21301e196c8SJohn Marino	mmap \
21401e196c8SJohn Marino	putenv \
21501e196c8SJohn Marino	select \
21601e196c8SJohn Marino	setenv \
21701e196c8SJohn Marino	setpgid \
21801e196c8SJohn Marino	setsid \
21901e196c8SJohn Marino	sigaction \
22001e196c8SJohn Marino	sigvec \
22101e196c8SJohn Marino	snprintf \
22201e196c8SJohn Marino	strerror \
22301e196c8SJohn Marino	strftime \
22401e196c8SJohn Marino	strsep \
22501e196c8SJohn Marino	strtod \
22601e196c8SJohn Marino	strtol \
2276a91b982SJohn Marino	sysctl \
22801e196c8SJohn Marino	unsetenv \
22901e196c8SJohn Marino	vsnprintf \
23001e196c8SJohn Marino	wait3 \
23101e196c8SJohn Marino	wait4 \
23201e196c8SJohn Marino	waitpid \
23301e196c8SJohn Marino	warn \
23401e196c8SJohn Marino	warnx \
23501e196c8SJohn Marino	)
23601e196c8SJohn Marino
23701e196c8SJohn Marinodnl functions which we may need to provide
23801e196c8SJohn MarinoAC_REPLACE_FUNCS( \
23901e196c8SJohn Marino	realpath \
24001e196c8SJohn Marino	dirname \
24101e196c8SJohn Marino	stresep \
24201e196c8SJohn Marino	strlcpy \
24301e196c8SJohn Marino	)
24401e196c8SJohn Marino
24501e196c8SJohn MarinoAC_CHECK_LIB([util], [emalloc],
24601e196c8SJohn Marino    [ AC_CHECK_LIB([util], [erealloc],
24701e196c8SJohn Marino      [ AC_CHECK_LIB([util], [estrdup],
24801e196c8SJohn Marino        [ AC_CHECK_LIB([util], [estrndup],
24901e196c8SJohn Marino	  [ LIBS="$LIBS -lutil"
25001e196c8SJohn Marino	    CPPFLAGS="$CPPFLAGS -DUSE_EMALLOC" ])])])])
25101e196c8SJohn Marino
25201e196c8SJohn Marinodnl
25301e196c8SJohn Marinodnl Structures
25401e196c8SJohn Marinodnl
25501e196c8SJohn MarinoAC_HEADER_STAT
25601e196c8SJohn MarinoAC_STRUCT_ST_RDEV
25701e196c8SJohn Marinodnl
2586a91b982SJohn Marinoecho "checking if compiler supports __func__" >&6
2596a91b982SJohn MarinoAC_LANG(C)
2606a91b982SJohn MarinoAC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[[const char *func = __func__;]])],,
2616a91b982SJohn Marino	AC_DEFINE(__func__, __FUNCTION__, C99 function name))
2626a91b982SJohn Marinodnl
26301e196c8SJohn Marinodnl we want this for unit-tests/Makefile
26401e196c8SJohn Marinoecho $ECHO_N "checking if diff -u works... $ECHO_C" >&6
26501e196c8SJohn Marinoif diff -u /dev/null /dev/null > /dev/null 2>&1; then
26601e196c8SJohn Marino   diff_u=-u
26701e196c8SJohn Marino   echo yes >&6
26801e196c8SJohn Marinoelse
26901e196c8SJohn Marino   diff_u=
27001e196c8SJohn Marino   echo no >&6
27101e196c8SJohn Marinofi
27201e196c8SJohn Marinodnl
27301e196c8SJohn Marinodnl AC_* don't quite cut it.
27401e196c8SJohn Marinodnl
27501e196c8SJohn Marinoecho "checking for MACHINE & MACHINE_ARCH..." >&6
27601e196c8SJohn Marinocat > conftest.$ac_ext <<EOF
27701e196c8SJohn Marino#include "confdefs.h"
27801e196c8SJohn Marino#include <sys/param.h>
27901e196c8SJohn Marino#ifdef MACHINE
28001e196c8SJohn Marinomachine=MACHINE
28101e196c8SJohn Marino#endif
28201e196c8SJohn Marino#ifdef MACHINE_ARCH
28301e196c8SJohn Marinomachine_arch=MACHINE_ARCH
28401e196c8SJohn Marino#endif
28501e196c8SJohn MarinoEOF
28601e196c8SJohn Marino
28701e196c8SJohn Marinodefault_machine=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28801e196c8SJohn Marino	egrep machine= | tr -d ' "'`
28901e196c8SJohn Marinorm -rf conftest*
29001e196c8SJohn Marinoif test "$default_machine"; then
29101e196c8SJohn Marino	eval "$default_machine"
29201e196c8SJohn Marinofi
29301e196c8SJohn Marinomachine=${machine:-`$srcdir/machine.sh`}
29401e196c8SJohn Marinomachine_arch=${machine_arch:-`$srcdir/machine.sh arch`}
29501e196c8SJohn Marinoecho "defaults: MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
29601e196c8SJohn Marinodnl
29701e196c8SJohn Marinodnl now allow overrides
29801e196c8SJohn Marinodnl
29901e196c8SJohn MarinoAC_ARG_WITH(machine,
30001e196c8SJohn Marino[  --with-machine=MACHINE  explicitly set MACHINE],
30101e196c8SJohn Marino[case "${withval}" in
30201e196c8SJohn Marinoyes)   AC_MSG_ERROR(bad value ${withval} given for bmake MACHINE) ;;
30301e196c8SJohn Marinono)    ;;
30401e196c8SJohn Marinogeneric) machine=`$srcdir/machine.sh`;;
30501e196c8SJohn Marino*)     machine=$with_machine;;
30601e196c8SJohn Marinoesac])
30701e196c8SJohn Marinoforce_machine=
30801e196c8SJohn MarinoAC_ARG_WITH(force_machine,
30901e196c8SJohn Marino[  --with-force-machine=MACHINE  set FORCE_MACHINE],
31001e196c8SJohn Marino[case "${withval}" in
31101e196c8SJohn Marinoyes)   force_machine=FORCE_;;
31201e196c8SJohn Marinono)    ;;
31301e196c8SJohn Marino*)     force_machine=FORCE_; machine=$with_force_machine;;
31401e196c8SJohn Marinoesac])
31501e196c8SJohn Marinodnl
31601e196c8SJohn Marinoforce_machine_arch=
31701e196c8SJohn MarinoAC_ARG_WITH(force_machine_arch,
31801e196c8SJohn Marino[  --with-force-machine-arch=MACHINE  set FORCE_MACHINE_ARCH],
31901e196c8SJohn Marino[case "${withval}" in
32001e196c8SJohn Marinoyes)   force_machine_arch=FORCE_;;
32101e196c8SJohn Marinono)    ;;
322a34d5fb1SAntonio Huete Jimenez*)     force_machine_arch=FORCE_; machine_arch=$with_force_machine_arch;;
32301e196c8SJohn Marinoesac])
32401e196c8SJohn Marinodnl
32501e196c8SJohn MarinoAC_ARG_WITH(machine_arch,
32601e196c8SJohn Marino[  --with-machine_arch=MACHINE_ARCH  explicitly set MACHINE_ARCH],
32701e196c8SJohn Marino[case "${withval}" in
32801e196c8SJohn Marinoyes)   AC_MSG_ERROR(bad value ${withval} given for bmake MACHINE_ARCH) ;;
32901e196c8SJohn Marinono)    ;;
33001e196c8SJohn Marino*)     machine_arch=$with_machine_arch;;
33101e196c8SJohn Marinoesac])
33201e196c8SJohn Marinodnl
33301e196c8SJohn Marinodnl Tell them what we ended up with
33401e196c8SJohn Marinodnl
335a34d5fb1SAntonio Huete Jimenezecho "Using: ${force_machine}MACHINE=$machine, ${force_machine_arch}MACHINE_ARCH=$machine_arch" 1>&6
33601e196c8SJohn Marinodnl
33701e196c8SJohn Marinodnl Allow folk to control _PATH_DEFSYSPATH
33801e196c8SJohn Marinodnl
33901e196c8SJohn Marinodefault_sys_path=\${prefix}/share/mk
34001e196c8SJohn MarinoAC_ARG_WITH(default-sys-path,
34101e196c8SJohn Marino[  --with-default-sys-path=PATH:DIR:LIST  use an explicit _PATH_DEFSYSPATH
34201e196c8SJohn Marino	MAKESYSPATH is a ':' separated list of directories
34301e196c8SJohn Marino	that bmake will search for system .mk files.
34401e196c8SJohn Marino	_PATH_DEFSYSPATH is its default value.],
34501e196c8SJohn Marino[case "${withval}" in
34601e196c8SJohn Marinoyes)	AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_DEFSYSPATH) ;;
34701e196c8SJohn Marinono)	;;
34801e196c8SJohn Marino*)	default_sys_path="$with_default_sys_path"
34901e196c8SJohn Marino	;;
35001e196c8SJohn Marinoesac])
35101e196c8SJohn Marinodnl
35201e196c8SJohn Marinodnl Some folk don't like this one
35301e196c8SJohn Marinodnl
35401e196c8SJohn MarinoAC_ARG_WITH(path-objdirprefix,
35501e196c8SJohn Marino[  --with-path-objdirprefix=PATH  override _PATH_OBJDIRPREFIX],
35601e196c8SJohn Marino[case "${withval}" in
35701e196c8SJohn Marinoyes)   AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_OBJDIRPREFIX) ;;
35801e196c8SJohn Marinono)    CPPFLAGS="$CPPFLAGS -DNO_PATH_OBJDIRPREFIX" ;;
35901e196c8SJohn Marino*)     CPPFLAGS="$CPPFLAGS \"-D_PATH_OBJDIRPREFIX=\\\"$with_path-objdir\\\"\"" ;;
36001e196c8SJohn Marinoesac])
36101e196c8SJohn Marinodnl
36201e196c8SJohn Marinodnl And this can be handy to do with out.
36301e196c8SJohn Marinodnl
36401e196c8SJohn MarinoAC_ARG_ENABLE(pwd-override,
365a34d5fb1SAntonio Huete Jimenez[  --disable-pwd-override  disable $PWD overriding getcwd()],
36601e196c8SJohn Marino[case "${enableval}" in
36701e196c8SJohn Marinoyes)   ;;
36801e196c8SJohn Marinono)    CPPFLAGS="$CPPFLAGS -DNO_PWD_OVERRIDE" ;;
36901e196c8SJohn Marino*)     AC_MSG_ERROR(bad value ${enableval} given for pwd-override option) ;;
37001e196c8SJohn Marinoesac])
37101e196c8SJohn Marinodnl
37201e196c8SJohn Marinodnl Just for grins
37301e196c8SJohn Marinodnl
37401e196c8SJohn MarinoAC_ARG_ENABLE(check-make-chdir,
37501e196c8SJohn Marino[  --disable-check-make-chdir disable make trying to guess
376a34d5fb1SAntonio Huete Jimenez	when it should automatically cd ${.CURDIR}],
37701e196c8SJohn Marino[case "${enableval}" in
37801e196c8SJohn Marinoyes)   ;;
37901e196c8SJohn Marinono)    CPPFLAGS="$CPPFLAGS -DNO_CHECK_MAKE_CHDIR" ;;
38001e196c8SJohn Marino*)     AC_MSG_ERROR(bad value ${enableval} given for check-make-chdir option) ;;
38101e196c8SJohn Marinoesac])
38201e196c8SJohn Marinodnl
38301e196c8SJohn Marinodnl On non-BSD systems, bootstrap won't work without mk
38401e196c8SJohn Marinodnl
38501e196c8SJohn MarinoAC_ARG_WITH(mksrc,
38601e196c8SJohn Marino[  --with-mksrc=PATH tell makefile.boot where to find mk src],
38701e196c8SJohn Marino[case "${withval}" in
38801e196c8SJohn Marino""|yes|no) ;;
38901e196c8SJohn Marino*) test -s $withval/install-mk && mksrc=$withval ||
39001e196c8SJohn MarinoAC_MSG_ERROR(bad value ${withval} given for mksrc cannot find install-mk)
39101e196c8SJohn Marino;;
39201e196c8SJohn Marinoesac
39301e196c8SJohn Marino])
39401e196c8SJohn Marinodnl
39501e196c8SJohn Marinodnl Now make sure we have a value
39601e196c8SJohn Marinodnl
39701e196c8SJohn Marinosrcdir=`cd $srcdir && pwd`
39801e196c8SJohn Marinofor mksrc in $mksrc $srcdir/mk $srcdir/../mk mk
39901e196c8SJohn Marinodo
40001e196c8SJohn Marino	test -s $mksrc/install-mk || continue
40101e196c8SJohn Marino	mksrc=`cd $mksrc && pwd`
40201e196c8SJohn Marino	break
40301e196c8SJohn Marinodone
40401e196c8SJohn Marinomksrc=`echo $mksrc | sed "s,$srcdir,\\\${srcdir},"`
40501e196c8SJohn Marinoecho "Using: MKSRC=$mksrc" 1>&6
40601e196c8SJohn Marinodnl On some systems we want a different default shell by default
40701e196c8SJohn Marinoif test -x /usr/xpg4/bin/sh; then
40801e196c8SJohn Marino        defshell_path=${defshell_path:-/usr/xpg4/bin/sh}
40901e196c8SJohn Marinofi
41001e196c8SJohn Marinoif test -n "$defshell_path"; then
41101e196c8SJohn Marino	echo "Using: SHELL=$defshell_path"  >&6
41201e196c8SJohn Marino	AC_DEFINE_UNQUOTED(DEFSHELL_CUSTOM, "$defshell_path", Path of default shell)
41301e196c8SJohn Marinofi
41401e196c8SJohn Marinoif test -n "$DEFSHELL_INDEX"; then
41501e196c8SJohn Marino       AC_DEFINE_UNQUOTED(DEFSHELL_INDEX, $DEFSHELL_INDEX, Shell spec to use by default)
41601e196c8SJohn Marinofi
41701e196c8SJohn Marinodnl
41801e196c8SJohn MarinoAC_SUBST(machine)
41901e196c8SJohn MarinoAC_SUBST(force_machine)
42001e196c8SJohn MarinoAC_SUBST(machine_arch)
421a34d5fb1SAntonio Huete JimenezAC_SUBST(force_machine_arch)
42201e196c8SJohn MarinoAC_SUBST(mksrc)
42301e196c8SJohn MarinoAC_SUBST(default_sys_path)
42401e196c8SJohn MarinoAC_SUBST(INSTALL)
42501e196c8SJohn MarinoAC_SUBST(GCC)
42601e196c8SJohn MarinoAC_SUBST(diff_u)
42701e196c8SJohn MarinoAC_SUBST(use_meta)
428ca58f742SDaniel FojtAC_SUBST(use_filemon)
42901e196c8SJohn MarinoAC_SUBST(filemon_h)
430ca58f742SDaniel FojtAC_SUBST(_MAKE_VERSION)
431ca58f742SDaniel Fojtbm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh"
432ca58f742SDaniel Fojtif test $use_makefile = yes; then
433ca58f742SDaniel Fojt   bm_outfiles="makefile $bm_outfiles"
434ca58f742SDaniel Fojtfi
435ca58f742SDaniel FojtAC_OUTPUT($bm_outfiles)
43601e196c8SJohn Marinocat <<EOF
43701e196c8SJohn Marino
43801e196c8SJohn MarinoYou can now run
43901e196c8SJohn Marino
44001e196c8SJohn Marino	sh ./make-bootstrap.sh
44101e196c8SJohn Marino
44201e196c8SJohn Marinoto produce a fully functional bmake.
44301e196c8SJohn Marino
44401e196c8SJohn MarinoEOF
445