1 dnl Process this file with autoconf 2.53 or later to produce
2 dnl a configure script.
6 AC_CONFIG_HEADERS(config.h)
8 dnl Check for broken VPATH handling on older NetBSD makes.
9 AC_DEFUN(AC_PROG_MAKE_VPATHOK,
10 [AC_MSG_CHECKING(whether ${MAKE-make} has sane VPATH handling)
11 set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'`
12 AC_CACHE_VAL(ac_cv_prog_make_vpathok,
14 cat > conftestdir/conftestmake <<\EOF
16 conftestfoo: conftestbar
18 conftestbar: conftestbaz
19 @echo ac_maketemp=broken
22 echo > conftestbaz # these two lines need to be...
23 echo > conftestbar # ... in this order not the other
27 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
28 eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
30 if test -n "$ac_maketemp"; then
31 ac_cv_prog_make_vpathok=no
33 if test -n "$ac_make2temp"; then
34 ac_cv_prog_make_vpathok=yes
36 ac_cv_prog_make_vpathok=no
40 rm -f conftestbar conftestbaz])dnl
41 if test $ac_cv_prog_make_vpathok = yes; then
48 AC_PREFIX_PROGRAM(nasm)
50 dnl Checks for programs.
54 if test -f nasm.c; then
55 # we're building in the source dir, so we don't need this check at all
56 ac_cv_prog_make_vpathok=yes
62 if test "$GCC" = "yes"; then
63 GCCFLAGS="-W -Wall -std=c99 -pedantic"
69 dnl Look for "nroff" or "groff"
70 AC_CHECK_PROGS(NROFF, nroff, echo)
73 dnl Checks for header files.
75 if test $ac_cv_header_stdc = no; then
76 AC_MSG_ERROR([NASM requires ANSI C header files to compile])
79 AC_CHECK_HEADERS(limits.h)
80 if test $ac_cv_header_limits_h = no; then
81 AC_MSG_ERROR([NASM requires '<limits.h>' to compile])
84 dnl Checks for typedefs, structures, and compiler characteristics.
86 if test $ac_cv_c_const = no; then
87 AC_MSG_ERROR([NASM requires ANSI C (specifically, working "const")])
91 if test $ac_cv_type_size_t = no; then
92 AC_MSG_ERROR([NASM requires ANSI C (specifically, "size_t")])
95 dnl Checks for library functions.
97 if test $ac_cv_func_vprintf = no; then
98 AC_MSG_ERROR([NASM requires ANSI C (specifically, "vprintf" and friends)])
101 AC_CHECK_FUNCS(strcspn)
102 if test $ac_cv_func_strcspn = no; then
103 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strcspn")])
106 AC_CHECK_FUNCS(strspn)
107 if test $ac_cv_func_strspn = no; then
108 AC_MSG_ERROR([NASM requires ANSI C (specifically, "strspn")])
111 AC_CHECK_FUNCS(snprintf)
112 if test $ac_cv_func_snprintf = no; then
113 AC_MSG_ERROR([NASM requires ISO C99 (specifically, "snprintf")])
116 AC_CHECK_FUNCS(vsnprintf)
117 if test $ac_cv_func_snprintf = no; then
118 AC_MSG_ERROR([NASM requires ISO C99 (specifically, "vsnprintf")])
121 AC_CHECK_FUNCS(getuid)
122 AC_CHECK_FUNCS(getgid)
124 if test $ac_cv_prog_make_vpathok = no; then
125 echo Copying generated srcs into build directory to compensate for VPATH breakage
126 for file in macros.c insnsa.c insnsd.c insnsn.c insnsi.h version.h version.mac; do
127 if test ! -f $file; then cp -p ${srcdir}/${file} .; fi
131 AC_OUTPUT_COMMANDS([mkdir -p output])
132 AC_OUTPUT(Makefile rdoff/Makefile doc/Makefile)