Use AC_LANG_SOURCE and add missing quoting to configure.

This fixes some of the warnings from autoconf 2.68 while still remaining
compatible with 2.61.

Closes #13591.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69554 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-10-26 23:20:10 +00:00
parent 5bb82ad49f
commit ea8dd85723
3 changed files with 163 additions and 119 deletions

View File

@@ -45,13 +45,15 @@ ac_cv_func_which_gethostbyname_r=unknown
# assuming an implicit prototype. In which case, we're out of luck.
#
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org";
(void)gethostbyname_r(name) /* ; */
]]),
ac_cv_func_which_gethostbyname_r=no)
]]
)],
ac_cv_func_which_gethostbyname_r=no
)
#
# SIX ARGUMENTS
@@ -61,7 +63,7 @@ AC_COMPILE_IFELSE(
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org";
@@ -70,8 +72,10 @@ AC_COMPILE_IFELSE(
int buflen = 1024;
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
]]),
ac_cv_func_which_gethostbyname_r=six)
]]
)],
ac_cv_func_which_gethostbyname_r=six
)
fi
@@ -83,7 +87,7 @@ fi
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org";
@@ -92,8 +96,10 @@ AC_COMPILE_IFELSE(
int buflen = 1024;
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
]]),
ac_cv_func_which_gethostbyname_r=five)
]]
)],
ac_cv_func_which_gethostbyname_r=five
)
fi
@@ -105,15 +111,17 @@ fi
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(
[AC_LANG_PROGRAM(
[[#include <netdb.h>]],
[[
char *name = "www.gnu.org";
struct hostent ret;
struct hostent_data data;
(void)gethostbyname_r(name, &ret, &data) /* ; */
]]),
ac_cv_func_which_gethostbyname_r=three)
]]
)],
ac_cv_func_which_gethostbyname_r=three
)
fi

32
configure vendored
View File

@@ -24550,6 +24550,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdarg.h>
void foo(char *f, ...)
{
@@ -24564,6 +24570,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
foo("hi", 17);
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -24624,6 +24631,12 @@ else
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdarg.h>
int foo(char *f, ...)
{
@@ -24640,6 +24653,7 @@ else
{
return foo("hi", 17);
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -24703,7 +24717,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
@@ -27107,7 +27122,14 @@ else
save_LIBS="$LIBS"
LIBS="$libc"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int main() { return 0; }
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
@@ -42535,6 +42557,7 @@ main ()
char *name = "www.gnu.org";
(void)gethostbyname_r(name) /* ; */
;
return 0;
}
@@ -42557,6 +42580,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_func_which_gethostbyname_r=no
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -42591,6 +42615,7 @@ main ()
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
;
return 0;
}
@@ -42613,6 +42638,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_func_which_gethostbyname_r=six
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -42649,6 +42675,7 @@ main ()
int my_h_errno;
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
;
return 0;
}
@@ -42671,6 +42698,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_func_which_gethostbyname_r=five
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -42705,6 +42733,7 @@ main ()
struct hostent_data data;
(void)gethostbyname_r(name, &ret, &data) /* ; */
;
return 0;
}
@@ -42727,6 +42756,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_func_which_gethostbyname_r=three
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

View File

@@ -1709,6 +1709,7 @@ AC_CACHE_CHECK([for va_copy],
[
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([
AC_LANG_SOURCE([
#include <stdarg.h>
void foo(char *f, ...)
{
@@ -1722,7 +1723,8 @@ AC_CACHE_CHECK([for va_copy],
{
foo("hi", 17);
return 0;
}],
}])
],
wx_cv_func_va_copy=yes,
wx_cv_func_va_copy=no
)
@@ -1738,6 +1740,7 @@ else
wx_cv_type_va_list_lvalue,
[
AC_RUN_IFELSE([
AC_LANG_SOURCE([
#include <stdarg.h>
int foo(char *f, ...)
{
@@ -1753,7 +1756,8 @@ else
int main()
{
return foo("hi", 17);
}],
}])
],
wx_cv_type_va_list_lvalue=yes,
wx_cv_type_va_list_lvalue=no,
dnl assume most common case for cross-compiling...
@@ -1782,7 +1786,7 @@ AC_CACHE_CHECK(
dnl C compiler might support variadic macros when C++ one doesn't
dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE(
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(
[
#include <stdio.h>
@@ -1791,7 +1795,7 @@ AC_CACHE_CHECK(
[
test("%s %d %p", "test", 1, 0);
]
),
)],
[wx_cv_have_variadic_macros=yes],
[wx_cv_have_variadic_macros=no]
)
@@ -2268,7 +2272,9 @@ case "${host}" in
if test -f $libc; then
save_LIBS="$LIBS"
LIBS="$libc"
AC_LINK_IFELSE([int main() { return 0; }],
AC_LINK_IFELSE([
AC_LANG_SOURCE([int main() { return 0; }])
],
wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
LIBS="$save_LIBS"
if test "x$wx_cv_std_libpath" != "x"; then