3 dnl $Id: configure.in,v 1.1.1.1 2004/03/11 13:04:07 grant Exp $
5 dnl Process this file with autoconf to produce a configure script
7 AC_INIT(makefile.boot.in)
8 AC_CONFIG_HEADER(config.h)
10 dnl Checks for programs.
12 AC_PROG_GCC_TRADITIONAL
14 dnl Check for OS problems
18 dnl Executable suffix - normally empty; .exe on os2.
19 AC_SUBST(ac_exe_suffix)dnl
25 dnl Checks for header files.
29 AC_CHECK_HEADERS(ar.h ranlib.h fcntl.h paths.h sys/select.h sys/time.h unistd.h string.h utime.h poll.h sys/uio.h)
31 dnl Both *BSD and Linux have sys/cdefs.h, most do not.
32 dnl If it is missing, we add -I${srcdir}/missing to CFLAGS
33 dnl also if sys/cdefs.h does not have __RCSID we need to use ours
34 dnl but we need to include the host's one too *sigh*
35 AC_CHECK_HEADER(sys/cdefs.h,
36 echo $ac_n "checking whether sys/cdefs.h is compatible... $ac_c" 2>&6
38 [#include <sys/cdefs.h>
44 echo no 2>&6; CPPFLAGS="${CPPFLAGS} -I\${srcdir}/missing -DNEED_HOST_CDEFS_H"),
45 CPPFLAGS="${CPPFLAGS} -I\${srcdir}/missing")
47 dnl Checks for typedefs, structures, and compiler characteristics.
58 dnl Checks for library functions.
63 AC_CHECK_FUNCS(getcwd getwd getopt putenv select strdup strerror strtod strtol setenv getenv vsnprintf snprintf strftime sigaction sigvec waitpid wait4 wait3)
64 dnl AC_REPLACE_FUNCS(setenv getenv)
65 AC_REPLACE_FUNCS(getenv)
74 dnl Solaris's signal.h only privides sigset_t etc if one of
75 dnl _EXTENSIONS_ _POSIX_C_SOURCE or _XOPEN_SOURCE are defined.
76 dnl The later two seem to cause more problems than they solve so if we
77 dnl see _EXTENSIONS_ we use it.
78 dnl Note we _don't_ want AC_EGREP_HEADER as we don't want CPP involved.
80 AC_EGREP(__EXTENSIONS__, /usr/include/signal.h,
81 CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__",)
83 dnl AC_* don't quite cut it.
85 echo $ac_n "Checking for MACHINE & MACHINE_ARCH... $ac_c" 2>&6
86 cat > conftest.$ac_ext <<EOF
88 #include <sys/param.h>
93 machine_arch=MACHINE_ARCH
97 default_machine=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
98 egrep machine= | tr -d ' "'`
100 if test "$default_machine"; then
101 eval "$default_machine"
103 machine=${machine:-`$srcdir/machine.sh`}
104 machine_arch=${machine_arch:-`$srcdir/machine.sh arch`}
105 echo "defaults: MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
107 dnl now allow overrides
110 [ --with-machine=MACHINE explicitly set MACHINE],
111 [case "${withval}" in
112 yes) AC_MSG_ERROR(bad value ${withval} given for bmake MACHINE) ;;
114 generic) machine=`$srcdir/machine.sh`;;
115 *) machine=$with_machine;;
118 AC_ARG_WITH(force_machine,
119 [ --with-force-machine=MACHINE set FORCE_MACHINE],
120 [case "${withval}" in
121 yes) force_machine=FORCE_;;
123 *) force_machine=FORCE_; machine=$with_force_machine;;
126 AC_ARG_WITH(machine_arch,
127 [ --with-machine_arch=MACHINE_ARCH explicitly set MACHINE_ARCH],
128 [case "${withval}" in
129 yes) AC_MSG_ERROR(bad value ${withval} given for bmake MACHINE_ARCH) ;;
131 *) machine_arch=$with_machine_arch;;
134 dnl Tell them what we ended up with
136 echo "Using: ${force_machine}MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
138 dnl Allow folk to control _PATH_DEFSYSPATH
140 AC_ARG_WITH(default-sys-path,
141 [ --with-default-sys-path=PATH:DIR:LIST use an explicit _PATH_DEFSYSPATH],
142 [case "${withval}" in
143 yes) AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_DEFSYSPATH) ;;
145 *) CPPFLAGS="$CPPFLAGS \"-D_PATH_DEFSYSPATH=\\\"$with_default_sys_path\\\"\"" ;;
148 dnl Or just to prefix it
150 AC_ARG_WITH(prefix-sys-path,
151 [ --with-prefix-sys-path=PATH:DIR:LIST prefix _PATH_PREFIX_SYSPATH],
152 [case "${withval}" in
153 yes) AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_PREFIX_SYSPATH) ;;
155 *) CPPFLAGS="$CPPFLAGS \"-D_PATH_PREFIX_SYSPATH=\\\"$with_prefix_sys_path\\\"\"" ;;
158 dnl Some folk don't like this one
160 AC_ARG_WITH(path-objdirprefix,
161 [ --with-path-objdirprefix=PATH override _PATH_OBJDIRPREFIX],
162 [case "${withval}" in
163 yes) AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_OBJDIRPREFIX) ;;
164 no) CPPFLAGS="$CPPFLAGS -DNO_PATH_OBJDIRPREFIX" ;;
165 *) CPPFLAGS="$CPPFLAGS \"-D_PATH_OBJDIRPREFIX=\\\"$with_path-objdir\\\"\"" ;;
168 dnl And this can be handy to do with out.
170 AC_ARG_ENABLE(pwd-override,
171 [ --disable-pwd-override disable \$PWD overriding getcwd()],
172 [case "${enableval}" in
174 no) CPPFLAGS="$CPPFLAGS -DNO_PWD_OVERRIDE" ;;
175 *) AC_MSG_ERROR(bad value ${enableval} given for pwd-override option) ;;
180 AC_ARG_ENABLE(check-make-chdir,
181 [ --disable-check-make-chdir disable make trying to guess
182 when it should automatically cd \${.CURDIR}],
183 [case "${enableval}" in
185 no) CPPFLAGS="$CPPFLAGS -DNO_CHECK_MAKE_CHDIR" ;;
186 *) AC_MSG_ERROR(bad value ${enableval} given for check-make-chdir option) ;;
189 AC_SUBST(force_machine)
190 AC_SUBST(machine_arch)
191 AC_OUTPUT(Makefile makefile.boot lst.lib/makefile.boot)
197 make -f makefile.boot bootstrap
199 to produce a fully functional bmake. You can then use
201 make -f makefile.boot install
203 for an initial installation. If you already have macros installed