From 01aa5863971918bbbb459ebc159641fe51ca02aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 24 Jun 2003 22:23:43 +0000 Subject: [PATCH] Mac OS X fixes for ac-2.5 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 54 +++++++++++++++++++++++++++++++++++++++++++++++++--- configure.in | 33 +++++++++++++++++++++++++++++--- 2 files changed, 81 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 02f9641dcd..1ec9d80e8e 100755 --- a/configure +++ b/configure @@ -11855,8 +11855,25 @@ fi esac -if test "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +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 +if test "${ac_cv_header_strings_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_strings_h=no +fi +echo "$as_me:$LINENO: result: $ac_cv_header_strings_h" >&5 +echo "${ECHO_T}$ac_cv_header_strings_h" >&6 + if test "$ac_cv_header_strings_h" = "no"; then + echo "$as_me:$LINENO: result: forced no into cache" >&5 +echo "${ECHO_T}forced no into cache" >&6 + else + { echo "$as_me:$LINENO: WARNING: strings.h is not compatible with Mac OS X" >&5 +echo "$as_me: WARNING: strings.h is not compatible with Mac OS X" >&2;} + fi +fi +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12221,7 +12238,6 @@ fi done -fi for ac_header in stdlib.h @@ -24319,6 +24335,38 @@ if test "$wxUSE_OPENGL" = "yes"; then elif test "$wxUSE_MSW" = 1; then OPENGL_LIBS="-lopengl32 -lglu32" else + + +ac_find_includes= +for ac_dir in $SEARCH_INCLUDE /usr/include; + do + if test -f "$ac_dir/GL/gl.h"; then + ac_find_includes=$ac_dir + break + fi + done + + if test "$ac_find_includes" != "" ; then + echo "$as_me:$LINENO: result: found in $ac_find_includes" >&5 +echo "${ECHO_T}found in $ac_find_includes" >&6 + set -x + + if test "x$ac_find_includes" = "x/usr/include"; then + ac_path_to_include="" + else + echo "$CPPFLAGS" | grep "\-I$ac_find_includes" > /dev/null + result=$? + if test $result = 0; then + ac_path_to_include="" + else + ac_path_to_include=" -I$ac_find_includes" + fi + fi + + CPPFLAGS="$CPPFLAGS$ac_path_to_include" + set +x + fi + if test "${ac_cv_header_GL_gl_h+set}" = set; then echo "$as_me:$LINENO: checking for GL/gl.h" >&5 echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 47dd275ee6..61069b7e61 100644 --- a/configure.in +++ b/configure.in @@ -1448,10 +1448,24 @@ dnl ------------------------------------------------------------------------ dnl test for strings.h needed under AIX, but do not check for it wxMac as dnl it exists but is only a simple redirection to string.h and it is in dnl conflict with Strings.h in FlatCarbon headers -if test "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then - dnl defines HAVE_STRINGS_H - AC_CHECK_HEADERS(strings.h) +dnl +dnl Autoconf 2.5 tends to check for strings.h on its own, so avoiding the +dnl test (as the current configure script does) is not possible. Instead, +dnl you must remind autoconf that strings.h is NOT valid. The autoconf +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 +if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then + AC_CACHE_CHECK([for strings.h], ac_cv_header_strings_h, + [ac_cv_header_strings_h=no]) + if test "$ac_cv_header_strings_h" = "no"; then + AC_MSG_RESULT([forced no into cache]) + else + AC_MSG_WARN([strings.h is not compatible with Mac OS X]) + fi fi +dnl defines HAVE_STRINGS_H +AC_CHECK_HEADERS(strings.h) dnl defines HAVE_STDLIB_H AC_CHECK_HEADERS(stdlib.h) @@ -2826,6 +2840,19 @@ if test "$wxUSE_OPENGL" = "yes"; then elif test "$wxUSE_MSW" = 1; then OPENGL_LIBS="-lopengl32 -lglu32" else + dnl David Elliott: Without this snippet AC_CHECK_HEADER fails to find + dnl GL/gl.h on Mac OS X where it is located in + dnl /usr/X11R6/include/GL/gl.h: + + WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, GL/gl.h) + if test "$ac_find_includes" != "" ; then + AC_MSG_RESULT(found in $ac_find_includes) + set -x + WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS) + CPPFLAGS="$CPPFLAGS$ac_path_to_include" + set +x + fi + AC_CHECK_HEADER(GL/gl.h, [ found_gl=0 -- 2.45.2