1 dnl Process this file with autoconf to produce a configure script.
4 dnl Check for broken VPATH handling on older NetBSD makes.
5 AC_DEFUN(AC_PROG_MAKE_VPATHOK,
6 [AC_MSG_CHECKING(whether ${MAKE-make} has sane VPATH handling)
7 set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'`
8 AC_CACHE_VAL(ac_cv_prog_make_vpathok,
10 cat > conftestdir/conftestmake <<\EOF
12 conftestfoo: conftestbar
14 conftestbar: conftestbaz
15 @echo ac_maketemp=broken
18 echo > conftestbaz # these two lines need to be...
19 echo > conftestbar # ... in this order not the other
23 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
24 eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
26 if test -n "$ac_maketemp"; then
27 ac_cv_prog_make_vpathok=no
29 if test -n "$ac_make2temp"; then
30 ac_cv_prog_make_vpathok=yes
32 ac_cv_prog_make_vpathok=no
36 rm -f conftestbar conftestbaz])dnl
37 if test $ac_cv_prog_make_vpathok = yes; then
44 AC_PREFIX_PROGRAM(nasm)
46 dnl Checks for programs.
50 if test -f nasm.c; then
51 # we're building in the source dir, so we don't need this check at all
52 ac_cv_prog_make_vpathok=yes
58 if test "$GCC" = "yes"; then
59 GCCFLAGS="-Wall -ansi -pedantic"
65 dnl Checks for header files.
67 if test $ac_cv_header_stdc = no; then
68 AC_MSG_ERROR([NASM requires ANSI C header files to compile])
71 AC_CHECK_HEADERS(limits.h)
72 if test $ac_cv_header_limits_h = no; then
73 AC_MSG_ERROR([NASM requires '<limits.h>' to compile])
76 dnl Checks for typedefs, structures, and compiler characteristics.
78 if test $ac_cv_c_const = no; then
79 AC_MSG_ERROR([NASM requires ANSI C (specifically, working "const")])
83 if test $ac_cv_type_size_t = no; then
84 AC_MSG_ERROR([NASM requires ANSI C (specifically, "size_t")])
87 dnl Checks for library functions.
89 if test $ac_cv_func_vprintf = no; then
90 AC_MSG_ERROR([NASM requires ANSI C (specifically, "vprintf" and friends)])
93 AC_CHECK_FUNCS(strcspn)
94 if test $ac_cv_func_strcspn = no; then
95 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strcspn")])
98 AC_CHECK_FUNCS(strspn)
99 if test $ac_cv_func_strspn = no; then
100 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strspn")])
103 if test $ac_cv_prog_make_vpathok = no; then
104 echo Copying generated srcs into build directory to compensate for VPATH breakage
105 if test ! -f insnsa.c; then cp -p ${srcdir}/insnsa.c .; fi
106 if test ! -f insnsd.c; then cp -p ${srcdir}/insnsd.c .; fi
107 if test ! -f macros.c; then cp -p ${srcdir}/macros.c .; fi
110 AC_OUTPUT(Makefile rdoff/Makefile)