1 dnl Process this file with autoconf 2.53 or later to produce
2 dnl a configure script.
7 dnl Check for broken VPATH handling on older NetBSD makes.
8 AC_DEFUN(AC_PROG_MAKE_VPATHOK,
9 [AC_MSG_CHECKING(whether ${MAKE-make} has sane VPATH handling)
10 set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'`
11 AC_CACHE_VAL(ac_cv_prog_make_vpathok,
13 cat > conftestdir/conftestmake <<\EOF
15 conftestfoo: conftestbar
17 conftestbar: conftestbaz
18 @echo ac_maketemp=broken
21 echo > conftestbaz # these two lines need to be...
22 echo > conftestbar # ... in this order not the other
26 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
27 eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
29 if test -n "$ac_maketemp"; then
30 ac_cv_prog_make_vpathok=no
32 if test -n "$ac_make2temp"; then
33 ac_cv_prog_make_vpathok=yes
35 ac_cv_prog_make_vpathok=no
39 rm -f conftestbar conftestbaz])dnl
40 if test $ac_cv_prog_make_vpathok = yes; then
47 AC_PREFIX_PROGRAM(nasm)
49 dnl Checks for programs.
53 if test -f nasm.c; then
54 # we're building in the source dir, so we don't need this check at all
55 ac_cv_prog_make_vpathok=yes
61 if test "$GCC" = "yes"; then
62 GCCFLAGS="-Wall -ansi -pedantic"
68 dnl Look for "nroff" or "groff"
69 AC_CHECK_PROGS(NROFF, nroff, echo)
72 dnl Checks for header files.
74 if test $ac_cv_header_stdc = no; then
75 AC_MSG_ERROR([NASM requires ANSI C header files to compile])
78 AC_CHECK_HEADERS(limits.h)
79 if test $ac_cv_header_limits_h = no; then
80 AC_MSG_ERROR([NASM requires '<limits.h>' to compile])
83 dnl Checks for typedefs, structures, and compiler characteristics.
85 if test $ac_cv_c_const = no; then
86 AC_MSG_ERROR([NASM requires ANSI C (specifically, working "const")])
90 if test $ac_cv_type_size_t = no; then
91 AC_MSG_ERROR([NASM requires ANSI C (specifically, "size_t")])
94 dnl Checks for library functions.
96 if test $ac_cv_func_vprintf = no; then
97 AC_MSG_ERROR([NASM requires ANSI C (specifically, "vprintf" and friends)])
100 AC_CHECK_FUNCS(strcspn)
101 if test $ac_cv_func_strcspn = no; then
102 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strcspn")])
105 AC_CHECK_FUNCS(strspn)
106 if test $ac_cv_func_strspn = no; then
107 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strspn")])
110 if test $ac_cv_prog_make_vpathok = no; then
111 echo Copying generated srcs into build directory to compensate for VPATH breakage
112 for file in macros.c insnsa.c insnsd.c insnsn.c insnsi.h version.h version.mac; do
113 if test ! -f $file; then cp -p ${srcdir}/${file} .; fi
117 AC_OUTPUT_COMMANDS([mkdir -p output])
118 AC_OUTPUT(Makefile rdoff/Makefile doc/Makefile)