summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
040b349)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40889
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-echo "$as_me:$LINENO: checking whether strtok_r is declared" >&5
-echo $ECHO_N "checking whether strtok_r is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_strtok_r+set}" = set; then
+
+ for wx_func in strtok_r
+ do
+ echo "$as_me:$LINENO: checking for $wx_func" >&5
+echo $ECHO_N "checking for $wx_func... $ECHO_C" >&6
+if eval "test \"\${wx_cv_func_$wx_func+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+
+ cat >conftest.$ac_ext <<_ACEOF
+
+ /* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
+ #define _REENTRANT
+ $ac_includes_default
+
-#ifndef strtok_r
- char *p = (char *) strtok_r;
-#endif
+
+ #ifndef $wx_func
+ &$wx_func;
+ #endif
+
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_have_decl_strtok_r=yes
+ eval wx_cv_func_$wx_func=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_have_decl_strtok_r=no
+eval wx_cv_func_$wx_func=no
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtok_r" >&5
-echo "${ECHO_T}$ac_cv_have_decl_strtok_r" >&6
-if test $ac_cv_have_decl_strtok_r = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOK_R 1
-_ACEOF
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRTOK_R 1
-_ACEOF
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'wx_cv_func_$wx_func'}'`" >&5
+echo "${ECHO_T}`eval echo '${'wx_cv_func_$wx_func'}'`" >&6
-else
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRTOK_R 0
+ if eval test \$wx_cv_func_$wx_func = yes
+ then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_`echo $wx_func | tr 'a-z' 'A-Z'` 1
-CPPFLAGS="$SAVE_CPPFLAGS"
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
else
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
else
- if test "$ac_cv_have_decl_strtok_r" = "yes"; then
+ if test "$wx_cv_func_strtok_r" = "yes"; then
echo "$as_me:$LINENO: checking if -D_REENTRANT is needed" >&5
echo $ECHO_N "checking if -D_REENTRANT is needed... $ECHO_C" >&6
if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
echo "$as_me:$LINENO: checking if -D_REENTRANT is needed" >&5
echo $ECHO_N "checking if -D_REENTRANT is needed... $ECHO_C" >&6
if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
dnl check for uname (POSIX) and gethostname (BSD)
AC_CHECK_FUNCS(uname gethostname, break)
dnl check for uname (POSIX) and gethostname (BSD)
AC_CHECK_FUNCS(uname gethostname, break)
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-AC_CHECK_DECLS(strtok_r, AC_DEFINE(HAVE_STRTOK_R))
-CPPFLAGS="$SAVE_CPPFLAGS"
+WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT])
dnl check for inet_addr and inet_aton (these may live either in libc, or in
dnl libnsl or libresolv or libsocket)
dnl check for inet_addr and inet_aton (these may live either in libc, or in
dnl libnsl or libresolv or libsocket)
else
dnl on some systems, _REENTRANT should be defined if we want to use any _r()
dnl functions - add tests for other functions here as well
else
dnl on some systems, _REENTRANT should be defined if we want to use any _r()
dnl functions - add tests for other functions here as well
- if test "$ac_cv_have_decl_strtok_r" = "yes"; then
+ if test "$wx_cv_func_strtok_r" = "yes"; then
AC_MSG_CHECKING(if -D_REENTRANT is needed)
if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"
AC_MSG_CHECKING(if -D_REENTRANT is needed)
if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"