From: Peter Johnson Date: Wed, 31 Oct 2001 22:06:48 +0000 (-0000) Subject: Previous commit broke ANSI C header checking (BAD). Fixed, by changing how X-Git-Tag: v0.1.0~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df933810eaeceb75b3a4944411c68274479a3d46;p=yasm Previous commit broke ANSI C header checking (BAD). Fixed, by changing how optional things are checked. svn path=/trunk/yasm/; revision=305 --- diff --git a/configure.ac b/configure.ac index b6d59fbd..a49afcfc 100644 --- a/configure.ac +++ b/configure.ac @@ -60,44 +60,35 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue) AM_PROG_CC_STDC -if ${dev}; then - DEVFLAGS=" -g" -fi +ALL_LINGUAS="" +AM_GNU_GETTEXT -if ${morewarn}; then - MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings" -fi +AC_PROG_INSTALL +AC_PROG_RANLIB -if ${warnerror}; then - WARNERRORFLAGS=" -Werror" -fi +AC_HEADER_STDC -if ${profiling}; then - PROFILINGFLAGS=" -pg" -fi +AC_C_CONST +AC_TYPE_SIZE_T -if ${dmalloc}; then - AC_CHECK_HEADERS(dmalloc.h) - AC_CHECK_LIB(dmalloc, main) - if test "$ac_cv_header_dmalloc_h" != yes || - test "$ac_cv_lib_dmalloc_main" != yes; then - AC_MSG_ERROR([dmalloc required for --enable-dmalloc.]) - else - DMALLOCFLAGS=" -DDMALLOC" - fi -else - DMALLOCFLAGS=" -Wredundant-decls" -fi +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(memcpy toascii abort) +AC_CHECK_FUNCS(strcasecmp stricmp strcmpi, break) +AC_REPLACE_FUNCS(strsep mergesort) -if test "$GCC" = yes; then - ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS" -else - ANSI_CFLAGS="$DEVFLAGS" +# Check for GNU C Library +AC_CACHE_CHECK([for GNU C Library], yasm_cv_header_gnulib, + AC_EGREP_CPP(gnulib, + [#include + #ifdef __GNU_LIBRARY__ + gnulib + #endif + ], yasm_cv_header_gnulib=yes, yasm_cv_header_gnulib=no)) +if test "$yasm_cv_header_gnulib" = yes; then + AC_DEFINE(HAVE_GNU_C_LIBRARY) fi -AC_SUBST(ANSI_CFLAGS) -ALL_LINGUAS="" -AM_GNU_GETTEXT +AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h) # Needed tools for building lexers and parsers from original source. # Only needed for development: generated .c's are included with distributions. @@ -127,37 +118,14 @@ if ${dev}; then fi fi -AC_PROG_INSTALL -AC_PROG_RANLIB - -AC_HEADER_STDC - -AC_C_CONST -AC_TYPE_SIZE_T - -AC_FUNC_VPRINTF -AC_CHECK_FUNCS(memcpy toascii abort) -AC_CHECK_FUNCS(strcasecmp stricmp strcmpi, break) -AC_REPLACE_FUNCS(strsep mergesort) - -AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h) - -# Check for GNU C Library -AC_CACHE_CHECK([for GNU C Library], yasm_cv_header_gnulib, - AC_EGREP_CPP(gnulib, - [#include - #ifdef __GNU_LIBRARY__ - gnulib - #endif - ], yasm_cv_header_gnulib=yes, yasm_cv_header_gnulib=no)) -if test "$yasm_cv_header_gnulib" = yes; then - AC_DEFINE(HAVE_GNU_C_LIBRARY) -fi - # Check for stuff wanted by the test suite. None of this is required. +AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror snprintf) +AC_TYPE_PID_T +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h) + CHECK_CFLAGS= if ${check}; then - AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror snprintf) if test "$ac_cv_func_fork" = yes && test "$ac_cv_func_wait" = yes && test "$ac_cv_func_msgctl" = yes && @@ -167,12 +135,47 @@ if ${check}; then AC_DEFINE(USE_FORKWAITMSG) CHECK_CFLAGS="-D_SVID_SOURCE -D_GNU_SOURCE" fi - AC_TYPE_PID_T - AC_HEADER_SYS_WAIT - AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h) fi AC_SUBST(CHECK_CFLAGS) +if ${dev}; then + DEVFLAGS=" -g" +fi + +if ${morewarn}; then + MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings" +fi + +if ${warnerror}; then + WARNERRORFLAGS="-Werror" +fi + +if ${profiling}; then + PROFILINGFLAGS="-pg" +fi + +AC_CHECK_HEADERS(dmalloc.h) +AC_CHECK_LIB(dmalloc, main) +if ${dmalloc}; then + if test "$ac_cv_header_dmalloc_h" != yes || + test "$ac_cv_lib_dmalloc_main" != yes; then + AC_MSG_ERROR([dmalloc required for --enable-dmalloc.]) + else + DMALLOCFLAGS="-DDMALLOC" + fi +else + if ${morewarn}; then + DMALLOCFLAGS="-Wredundant-decls" + fi +fi + +if test "$GCC" = yes; then + ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS $DMALLOCFLAGS" +else + ANSI_CFLAGS="$DEVFLAGS" +fi +AC_SUBST(ANSI_CFLAGS) + # Check for some target-specific stuff case "$host" in *-*-sunos4*) diff --git a/configure.in b/configure.in index b6d59fbd..a49afcfc 100644 --- a/configure.in +++ b/configure.in @@ -60,44 +60,35 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue) AM_PROG_CC_STDC -if ${dev}; then - DEVFLAGS=" -g" -fi +ALL_LINGUAS="" +AM_GNU_GETTEXT -if ${morewarn}; then - MOREWARNFLAGS=" -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings" -fi +AC_PROG_INSTALL +AC_PROG_RANLIB -if ${warnerror}; then - WARNERRORFLAGS=" -Werror" -fi +AC_HEADER_STDC -if ${profiling}; then - PROFILINGFLAGS=" -pg" -fi +AC_C_CONST +AC_TYPE_SIZE_T -if ${dmalloc}; then - AC_CHECK_HEADERS(dmalloc.h) - AC_CHECK_LIB(dmalloc, main) - if test "$ac_cv_header_dmalloc_h" != yes || - test "$ac_cv_lib_dmalloc_main" != yes; then - AC_MSG_ERROR([dmalloc required for --enable-dmalloc.]) - else - DMALLOCFLAGS=" -DDMALLOC" - fi -else - DMALLOCFLAGS=" -Wredundant-decls" -fi +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(memcpy toascii abort) +AC_CHECK_FUNCS(strcasecmp stricmp strcmpi, break) +AC_REPLACE_FUNCS(strsep mergesort) -if test "$GCC" = yes; then - ANSI_CFLAGS="-ansi -pedantic -Wall$MOREWARNFLAGS$WARNERRORFLAGS$DEVFLAGS$PROFILINGFLAGS$DMALLOCFLAGS" -else - ANSI_CFLAGS="$DEVFLAGS" +# Check for GNU C Library +AC_CACHE_CHECK([for GNU C Library], yasm_cv_header_gnulib, + AC_EGREP_CPP(gnulib, + [#include + #ifdef __GNU_LIBRARY__ + gnulib + #endif + ], yasm_cv_header_gnulib=yes, yasm_cv_header_gnulib=no)) +if test "$yasm_cv_header_gnulib" = yes; then + AC_DEFINE(HAVE_GNU_C_LIBRARY) fi -AC_SUBST(ANSI_CFLAGS) -ALL_LINGUAS="" -AM_GNU_GETTEXT +AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h) # Needed tools for building lexers and parsers from original source. # Only needed for development: generated .c's are included with distributions. @@ -127,37 +118,14 @@ if ${dev}; then fi fi -AC_PROG_INSTALL -AC_PROG_RANLIB - -AC_HEADER_STDC - -AC_C_CONST -AC_TYPE_SIZE_T - -AC_FUNC_VPRINTF -AC_CHECK_FUNCS(memcpy toascii abort) -AC_CHECK_FUNCS(strcasecmp stricmp strcmpi, break) -AC_REPLACE_FUNCS(strsep mergesort) - -AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h) - -# Check for GNU C Library -AC_CACHE_CHECK([for GNU C Library], yasm_cv_header_gnulib, - AC_EGREP_CPP(gnulib, - [#include - #ifdef __GNU_LIBRARY__ - gnulib - #endif - ], yasm_cv_header_gnulib=yes, yasm_cv_header_gnulib=no)) -if test "$yasm_cv_header_gnulib" = yes; then - AC_DEFINE(HAVE_GNU_C_LIBRARY) -fi - # Check for stuff wanted by the test suite. None of this is required. +AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror snprintf) +AC_TYPE_PID_T +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h) + CHECK_CFLAGS= if ${check}; then - AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror snprintf) if test "$ac_cv_func_fork" = yes && test "$ac_cv_func_wait" = yes && test "$ac_cv_func_msgctl" = yes && @@ -167,12 +135,47 @@ if ${check}; then AC_DEFINE(USE_FORKWAITMSG) CHECK_CFLAGS="-D_SVID_SOURCE -D_GNU_SOURCE" fi - AC_TYPE_PID_T - AC_HEADER_SYS_WAIT - AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h) fi AC_SUBST(CHECK_CFLAGS) +if ${dev}; then + DEVFLAGS=" -g" +fi + +if ${morewarn}; then + MOREWARNFLAGS="-Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings" +fi + +if ${warnerror}; then + WARNERRORFLAGS="-Werror" +fi + +if ${profiling}; then + PROFILINGFLAGS="-pg" +fi + +AC_CHECK_HEADERS(dmalloc.h) +AC_CHECK_LIB(dmalloc, main) +if ${dmalloc}; then + if test "$ac_cv_header_dmalloc_h" != yes || + test "$ac_cv_lib_dmalloc_main" != yes; then + AC_MSG_ERROR([dmalloc required for --enable-dmalloc.]) + else + DMALLOCFLAGS="-DDMALLOC" + fi +else + if ${morewarn}; then + DMALLOCFLAGS="-Wredundant-decls" + fi +fi + +if test "$GCC" = yes; then + ANSI_CFLAGS="-ansi -pedantic -Wall $MOREWARNFLAGS $WARNERRORFLAGS $DEVFLAGS $PROFILINGFLAGS $DMALLOCFLAGS" +else + ANSI_CFLAGS="$DEVFLAGS" +fi +AC_SUBST(ANSI_CFLAGS) + # Check for some target-specific stuff case "$host" in *-*-sunos4*)