From: David Elliott Date: Fri, 20 Jul 2007 17:59:45 +0000 (+0000) Subject: Restore AC_CHECK_HEADERS in preference to AC_CHECK_HEADER so that the HAVE_* X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1f7e12cc26dd8aa2042101ee1d6f715140041ec0 Restore AC_CHECK_HEADERS in preference to AC_CHECK_HEADER so that the HAVE_* defines will be generated when needed. This fixes breakage caused by 44703. Only usage where HAVE_* macro is in setup.h.in or was used by configure itself (e.g. HAVE_X11_XLIB_H) is changed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/acinclude.m4 b/acinclude.m4 index 8ba0973699..d07c008c65 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -132,7 +132,7 @@ AC_DEFUN([WX_CPP_NEW_HEADERS], AC_LANG_SAVE AC_LANG_CPLUSPLUS - AC_CHECK_HEADER(iostream,,, [ ]) + AC_CHECK_HEADERS([iostream],,, [ ]) if test "$ac_cv_header_iostream" = "yes" ; then ifelse([$1], , :, [$1]) diff --git a/configure b/configure index ed720f4691..37378bd404 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 47557 2007-07-19 01:02:28Z VZ . +# From configure.in Id: configure.in 47575 2007-07-19 23:00:09Z VZ . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0. # @@ -21203,9 +21203,13 @@ done if test "$ac_cv_header_wchar_h" != "yes"; then - { echo "$as_me:$LINENO: checking for wcstr.h" >&5 -echo $ECHO_N "checking for wcstr.h... $ECHO_C" >&6; } -if test "${ac_cv_header_wcstr_h+set}" = set; then + +for ac_header in wcstr.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21216,7 +21220,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -21235,19 +21239,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_wcstr_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_wcstr_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wcstr_h" >&5 -echo "${ECHO_T}$ac_cv_header_wcstr_h" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi +done fi @@ -21263,9 +21275,13 @@ case "${host}" in esac if test "$USE_UNIX" = 1 ; then - { echo "$as_me:$LINENO: checking for sys/select.h" >&5 -echo $ECHO_N "checking for sys/select.h... $ECHO_C" >&6; } -if test "${ac_cv_header_sys_select_h+set}" = set; then + +for ac_header in sys/select.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21276,7 +21292,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -21295,19 +21311,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_sys_select_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_sys_select_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_select_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_select_h" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi +done fi @@ -26045,9 +26069,13 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { echo "$as_me:$LINENO: checking for iostream" >&5 -echo $ECHO_N "checking for iostream... $ECHO_C" >&6; } -if test "${ac_cv_header_iostream+set}" = set; then + +for ac_header in iostream +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -26058,7 +26086,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -26077,19 +26105,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_iostream=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_iostream=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_iostream" >&5 -echo "${ECHO_T}$ac_cv_header_iostream" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi + +done if test "$ac_cv_header_iostream" = "yes" ; then @@ -34790,9 +34826,13 @@ fi if test "$wxUSE_GUI" = "yes"; then if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then - { echo "$as_me:$LINENO: checking for X11/Xlib.h" >&5 -echo $ECHO_N "checking for X11/Xlib.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xlib_h+set}" = set; then + +for ac_header in X11/Xlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -34803,7 +34843,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -34822,23 +34862,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_X11_Xlib_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_X11_Xlib_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xlib_h" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi +done - { echo "$as_me:$LINENO: checking for X11/XKBlib.h" >&5 -echo $ECHO_N "checking for X11/XKBlib.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_XKBlib_h+set}" = set; then + +for ac_header in X11/XKBlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -34853,7 +34905,7 @@ cat >>conftest.$ac_ext <<_ACEOF #endif -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -34872,19 +34924,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_X11_XKBlib_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_X11_XKBlib_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_XKBlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_XKBlib_h" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi +done fi fi @@ -35238,9 +35298,13 @@ echo $ECHO_N "checking for Xxf86vm extension... $ECHO_C" >&6; } if test "$ac_find_libraries" != "" ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } - { echo "$as_me:$LINENO: checking for X11/extensions/xf86vmode.h" >&5 -echo $ECHO_N "checking for X11/extensions/xf86vmode.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_extensions_xf86vmode_h+set}" = set; then + +for ac_header in X11/extensions/xf86vmode.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -35255,7 +35319,7 @@ cat >>conftest.$ac_ext <<_ACEOF #endif -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -35274,24 +35338,29 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_xf86vmode_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_X11_extensions_xf86vmode_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_xf86vmode_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_xf86vmode_h" >&6; } -if test $ac_cv_header_X11_extensions_xf86vmode_h = yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm" fi +done else { echo "$as_me:$LINENO: result: no" >&5 @@ -41572,9 +41641,13 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for sched.h" >&5 -echo $ECHO_N "checking for sched.h... $ECHO_C" >&6; } -if test "${ac_cv_header_sched_h+set}" = set; then + +for ac_header in sched.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -41585,7 +41658,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -41604,19 +41677,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_sched_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_sched_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sched_h" >&5 -echo "${ECHO_T}$ac_cv_header_sched_h" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF +fi + +done if test "$ac_cv_header_sched_h" = "yes"; then { echo "$as_me:$LINENO: checking for sched_yield" >&5 @@ -47249,9 +47330,13 @@ echo "${ECHO_T}$wxUSE_JOYSTICK" >&6; } else if test "$wxUSE_MGL" != "1"; then - { echo "$as_me:$LINENO: checking for linux/joystick.h" >&5 -echo $ECHO_N "checking for linux/joystick.h... $ECHO_C" >&6; } -if test "${ac_cv_header_linux_joystick_h+set}" = set; then + +for ac_header in linux/joystick.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -47262,7 +47347,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -47281,22 +47366,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_linux_joystick_h=yes + eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_linux_joystick_h=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_linux_joystick_h" >&5 -echo "${ECHO_T}$ac_cv_header_linux_joystick_h" >&6; } -if test $ac_cv_header_linux_joystick_h = yes; then - wxUSE_JOYSTICK=yes +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + wxUSE_JOYSTICK=yes fi +done fi fi diff --git a/configure.in b/configure.in index 041624853f..67eb351250 100644 --- a/configure.in +++ b/configure.in @@ -1424,7 +1424,7 @@ AC_CHECK_HEADERS(stdlib.h fnmatch.h langinfo.h malloc.h unistd.h wchar.h,,, [AC_ dnl maybe wchar_t is in wcstr.h if we don't have wchar.h? if test "$ac_cv_header_wchar_h" != "yes"; then - AC_CHECK_HEADER(wcstr.h,,, [AC_INCLUDES_DEFAULT()]) + AC_CHECK_HEADERS([wcstr.h],,, [AC_INCLUDES_DEFAULT()]) fi case "${host}" in @@ -1442,7 +1442,7 @@ esac dnl POSIX needs this for select(), but old systems don't have it if test "$USE_UNIX" = 1 ; then - AC_CHECK_HEADER([sys/select.h],,, [AC_INCLUDES_DEFAULT()]) + AC_CHECK_HEADERS([sys/select.h],,, [AC_INCLUDES_DEFAULT()]) fi dnl --------------------------------------------------------------------------- @@ -2604,7 +2604,7 @@ if test "$USE_WIN32" = 1 ; then WIN32INSTALL=win32install dnl pbt.h is missing on Wine at least - AC_CHECK_HEADER(pbt.h,, [AC_DEFINE(NEED_PBT_H)], [ ]) + AC_CHECK_HEADER([pbt.h],, [AC_DEFINE(NEED_PBT_H)], [ ]) fi if test "$wxUSE_GUI" = "yes"; then @@ -3439,8 +3439,8 @@ dnl do this after test for X11 above so that we have a chance of finding Xlib.h if test "$wxUSE_GUI" = "yes"; then if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then dnl defines HAVE_X11_XKBLIB_H - AC_CHECK_HEADER(X11/Xlib.h,,, [ ]) - AC_CHECK_HEADER([X11/XKBlib.h],,, + AC_CHECK_HEADERS([X11/Xlib.h],,, [ ]) + AC_CHECK_HEADERS([X11/XKBlib.h],,, [ #if HAVE_X11_XLIB_H #include @@ -3523,7 +3523,7 @@ dnl --------------------------------------------------------------------------- WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm) if test "$ac_find_libraries" != "" ; then AC_MSG_RESULT([yes]) - AC_CHECK_HEADER([X11/extensions/xf86vmode.h], + AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [ GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm" ], @@ -4885,7 +4885,7 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then AC_DEFINE(wxHAVE_PTHREAD_CLEANUP) fi - AC_CHECK_HEADER(sched.h,,, [AC_INCLUDES_DEFAULT()]) + AC_CHECK_HEADERS(sched.h,,, [AC_INCLUDES_DEFAULT()]) if test "$ac_cv_header_sched_h" = "yes"; then AC_CHECK_FUNC(sched_yield, AC_DEFINE(HAVE_SCHED_YIELD), @@ -6161,7 +6161,7 @@ if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then dnl can't be compiled because of an error and with the default dnl AC_CHECK_HEADER semantics we'd still detect it in this case and dnl build would fail later - AC_CHECK_HEADER(linux/joystick.h, [wxUSE_JOYSTICK=yes],, [AC_INCLUDES_DEFAULT()]) + AC_CHECK_HEADERS([linux/joystick.h], [wxUSE_JOYSTICK=yes],, [AC_INCLUDES_DEFAULT()]) fi fi