1#	$NetBSD: configure.ac,v 1.11 2023/07/20 15:16:44 lukem Exp $
2#
3# Autoconf definition file for make.
4#
5# When you edit configure.ac:
6# 0. Create the tools version of autoconf:
7#        cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools
8#    (This might not work if you try it after editing configure.ac.)
9# 1. edit configure.ac
10# 2. Regenerate "configure" from "configure.ac":
11#        cd ${SRCDIR}/tools/make && \
12#        ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen
13#    (Please don't use a non-tools version of autoconf).
14# 3. Test that nbmake still builds
15#        mv ${TOOLDIR}/nbmake ${TOOLDIR}/bin/nbmake.bak
16#        cd ${SRCDIR} && build.sh makewrapper
17# 4. cvs commit files that you edited.
18# 5. Regen again, to pick up changed RCS IDs from the above commit:
19#        cd ${SRCDIR}/tools/make && \
20#        ${TOOLDIR}/bin/nbmake-${MACHINE} -f Makefile.regen
21# 6. cvs commit files that were generated.
22#
23#
24
25AC_INIT([make], [noversion], [bin-bug-people@NetBSD.org])
26AC_CONFIG_FILES([buildmake.sh])
27
28m4_pattern_forbid([^AX_])
29m4_pattern_forbid([^NB_])
30
31AC_PATH_PROG([BSHELL], [sh])
32if test x"$BSHELL" = x; then
33    AC_MSG_ERROR([sh must be somewhere on \$PATH, or BSHELL must be defined])
34fi
35AC_DEFINE_UNQUOTED([DEFSHELL_CUSTOM], "${BSHELL}")
36
37# Make sure we have POSIX regex ability.
38AC_CHECK_HEADER([regex.h],, AC_MSG_ERROR([POSIX regex.h is required]))
39
40# If we don't have <poll.h>, we need to use select(2).
41AC_CHECK_HEADER([poll.h],, AC_DEFINE(USE_SELECT))
42
43# regcomp() and regexec() are also names of functions in the old V8
44# regexp package.  To avoid them, we need to find out who has regfree().
45
46dnl # Cygwin: We *MUST* look at -lregex *before* the "no libs" condition.
47dnl # Thus AC_CHECK_LIB(regex...) comes first, and AC_SEARCHLIBS next.
48AC_CHECK_LIB([regex], [regfree])
49AC_SEARCH_LIBS([regfree], [rx posix])
50
51AC_CHECK_FUNCS([setenv strdup strerror strftime vsnprintf])
52
53dnl NOWARNFLAGS: compiler flags to suppress unnecessary warnings:
54dnl   -Wno-deprecated-declarations
55dnl
56NB_CHECK_CC_FLAG([-Wno-deprecated-declarations], [NOWARNFLAGS])
57
58AC_OUTPUT()
59
60dnl Display results
61dnl
62AC_MSG_NOTICE([========== configure results for make ===========])
63m4_foreach_w([NB_VAR], [CC CFLAGS CPPFLAGS DEFS LDFLAGS LIBS NOWARNFLAGS], [dnl
64AC_MSG_NOTICE(m4_format([%-32s],NB_VAR)[$NB_VAR])
65])
66AC_MSG_NOTICE([================================================])
67