hopefully fixed strings.h mess completely now by not including it unless really needed (should fix bug 689456)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-02-12 18:10:33 +00:00
parent 6341d8249f
commit 1c2d1459e9
5 changed files with 199 additions and 196 deletions

291
configure vendored
View File

@@ -12009,24 +12009,145 @@ echo "${ECHO_T}$wx_cv_gcc3" >&6
esac esac
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
echo "$as_me:$LINENO: checking for strings.h" >&5
echo $ECHO_N "checking for strings.h... $ECHO_C" >&6 ac_ext=cc
if test "${ac_cv_header_strings_h+set}" = set; then ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
echo "$as_me:$LINENO: checking for strcasecmp() in string.h" >&5
echo $ECHO_N "checking for strcasecmp() in string.h... $ECHO_C" >&6
if test "${ac_cv_string_strcasecmp+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
ac_cv_header_strings_h=no
fi cat >conftest.$ac_ext <<_ACEOF
echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5 #line $LINENO "configure"
echo "${ECHO_T}$ac_cv_header_strings_h" >&6 /* confdefs.h. */
if test "$ac_cv_header_strings_h" = "no"; then _ACEOF
echo "$as_me:$LINENO: result: forced no into cache" >&5 cat confdefs.h >>conftest.$ac_ext
echo "${ECHO_T}forced no into cache" >&6 cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <string.h>
int
main ()
{
strcasecmp("foo", "bar");
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ 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
ac_cv_string_strcasecmp=yes
else else
{ echo "$as_me:$LINENO: WARNING: strings.h is not compatible with Mac OS X" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: WARNING: strings.h is not compatible with Mac OS X" >&2;} sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_string_strcasecmp=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_string_strcasecmp" >&5
echo "${ECHO_T}$ac_cv_string_strcasecmp" >&6
if test x"$ac_cv_string_strcasecmp" = "xyes"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRCASECMP_IN_STRING_H 1
_ACEOF
else
echo "$as_me:$LINENO: checking for strcasecmp() in strings.h" >&5
echo $ECHO_N "checking for strcasecmp() in strings.h... $ECHO_C" >&6
if test "${ac_cv_strings_strcasecmp+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <strings.h>
int
main ()
{
strcasecmp("foo", "bar");
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ 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
ac_cv_strings_strcasecmp=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_strings_strcasecmp=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_strings_strcasecmp" >&5
echo "${ECHO_T}$ac_cv_strings_strcasecmp" >&6
if test x"$ac_cv_string_strcasecmp" = "xyes"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_STRCASECMP_IN_STRINGS_H 1
_ACEOF
else
{ { echo "$as_me:$LINENO: error: No case-insensitive string comparison function found." >&5
echo "$as_me: error: No case-insensitive string comparison function found." >&2;}
{ (exit 1); exit 1; }; }
fi fi
fi fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then if test "${ac_cv_header_stdc+set}" = set; then
@@ -12251,149 +12372,6 @@ done
for ac_header in strings.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (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_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc in
yes:no )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
(
cat <<\_ASBOX
## ------------------------------------ ##
## Report this to bug-autoconf@gnu.org. ##
## ------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
no:yes )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
(
cat <<\_ASBOX
## ------------------------------------ ##
## Report this to bug-autoconf@gnu.org. ##
## ------------------------------------ ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
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
for ac_header in stdlib.h for ac_header in stdlib.h
do do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -17492,7 +17470,6 @@ _ACEOF
fi fi
ac_ext=cc ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS' ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'

View File

@@ -1509,27 +1509,45 @@ dnl ------------------------------------------------------------------------
dnl Check for headers dnl Check for headers
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl test for strings.h needed under AIX, but do not check for it wxMac as dnl look for strcasecmp() in string.h and then strings.h if it's not there
dnl it exists but is only a simple redirection to string.h and it is in AC_LANG_SAVE
dnl conflict with Strings.h in FlatCarbon headers AC_LANG_CPLUSPLUS
dnl
dnl Autoconf 2.5 tends to check for strings.h on its own, so avoiding the AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
dnl test (as the current configure script does) is not possible. Instead, AC_TRY_LINK([
dnl you must remind autoconf that strings.h is NOT valid. The autoconf #include <string.h>
dnl test succeeds because there is a strings.h file that simply includes ],
dnl string.h. Unfortunately, there is also a strings.h as part of the [
dnl FlatCarbon headers. -- David Elliott strcasecmp("foo", "bar");
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then ],
AC_CACHE_CHECK([for strings.h], ac_cv_header_strings_h, ac_cv_string_strcasecmp=yes,
[ac_cv_header_strings_h=no]) ac_cv_string_strcasecmp=no
if test "$ac_cv_header_strings_h" = "no"; then )
AC_MSG_RESULT([forced no into cache]) ])
if test x"$ac_cv_string_strcasecmp" = "xyes"; then
AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H)
else else
AC_MSG_WARN([strings.h is not compatible with Mac OS X]) AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
AC_TRY_LINK([
#include <strings.h>
],
[
strcasecmp("foo", "bar");
],
ac_cv_strings_strcasecmp=yes,
ac_cv_strings_strcasecmp=no
)
])
if test x"$ac_cv_string_strcasecmp" = "xyes"; then
AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H)
else
AC_MSG_ERROR([No case-insensitive string comparison function found.])
fi fi
fi fi
dnl defines HAVE_STRINGS_H
AC_CHECK_HEADERS(strings.h) AC_LANG_RESTORE
dnl defines HAVE_STDLIB_H dnl defines HAVE_STDLIB_H
AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(stdlib.h)

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: string.h // Name: wx/string.h
// Purpose: wxString and wxArrayString classes // Purpose: wxString and wxArrayString classes
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@@ -47,9 +47,9 @@
# include <stdlib.h> # include <stdlib.h>
#endif #endif
#ifdef HAVE_STRINGS_H #ifdef HAVE_STRCASECMP_IN_STRINGS_H
#include <strings.h> // for strcasecmp() #include <strings.h> // for strcasecmp()
#endif // HAVE_STRINGS_H #endif // HAVE_STRCASECMP_IN_STRINGS_H
#include "wx/wxchar.h" // for wxChar #include "wx/wxchar.h" // for wxChar
#include "wx/buffer.h" // for wxCharBuffer #include "wx/buffer.h" // for wxCharBuffer
@@ -134,7 +134,9 @@ inline int Stricmp(const char *psz1, const char *psz2)
return stricmp(psz1, psz2); return stricmp(psz1, psz2);
#elif defined(__WXPM__) #elif defined(__WXPM__)
return stricmp(psz1, psz2); return stricmp(psz1, psz2);
#elif defined(__UNIX__) || defined(__GNUWIN32__) #elif defined(HAVE_STRCASECMP_IN_STRING_H) || \
defined(HAVE_STRCASECMP_IN_STRINGS_H) || \
defined(__GNUWIN32__)
return strcasecmp(psz1, psz2); return strcasecmp(psz1, psz2);
#elif defined(__MWERKS__) && !defined(__INTEL__) #elif defined(__MWERKS__) && !defined(__INTEL__)
register char c1, c2; register char c1, c2;

View File

@@ -1151,9 +1151,6 @@
/* Define if you have the <sched.h> header file. */ /* Define if you have the <sched.h> header file. */
#undef HAVE_SCHED_H #undef HAVE_SCHED_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
@@ -1196,6 +1193,12 @@
/* Define this if you have fputws() and putwc() */ /* Define this if you have fputws() and putwc() */
#undef HAVE_FPUTWC #undef HAVE_FPUTWC
/* Define this if you have strcasecmp() function in <string.h> */
#undef HAVE_STRCASECMP_IN_STRING_H
/* Define this if you have strcasecmp() function in <strings.h> */
#undef HAVE_STRCASECMP_IN_STRINGS_H
/* Define this if you have wprintf() and related functions */ /* Define this if you have wprintf() and related functions */
#undef HAVE_WPRINTF #undef HAVE_WPRINTF

View File

@@ -1174,9 +1174,6 @@
/* Define if you have the <sched.h> header file. */ /* Define if you have the <sched.h> header file. */
#undef HAVE_SCHED_H #undef HAVE_SCHED_H
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
@@ -1216,6 +1213,12 @@
/* Define this if you have fputws() and putwc() */ /* Define this if you have fputws() and putwc() */
#define HAVE_FPUTWC 1 #define HAVE_FPUTWC 1
/* Define this if you have strcasecmp() function in <string.h> */
#define HAVE_STRCASECMP_IN_STRING_H 1
/* Define this if you have strcasecmp() function in <strings.h> */
#undef HAVE_STRCASECMP_IN_STRINGS_H
/* Define this if you have wprintf() and related functions */ /* Define this if you have wprintf() and related functions */
#define HAVE_WPRINTF 1 #define HAVE_WPRINTF 1