From 6d5977dfdf3fa1a058653908346685ded9ae60b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Ball=C3=BCder?= Date: Wed, 13 Jan 1999 11:50:30 +0000 Subject: [PATCH] Fixes for compilation problems on Solaris(!). Added detection of glibc2 to fix Linux compilation problems. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 96 ++++++++++++++++++++++++++++++++----------- configure.in | 7 ++++ setup/setup.hin | 4 ++ src/common/socket.cpp | 7 ++-- src/iodbc/config.h | 10 ++++- src/iodbc/henv.h | 2 +- 6 files changed, 94 insertions(+), 32 deletions(-) diff --git a/configure b/configure index b5e5013887..dc1f6630a9 100755 --- a/configure +++ b/configure @@ -5674,6 +5674,52 @@ EOF fi +if test "$USE_LINUX" = 1; then + echo $ac_n "checking for gettext in -lc""... $ac_c" 1>&6 +echo "configure:5680: checking for gettext in -lc" >&5 +ac_lib_var=`echo c'_'gettext | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define wxHAVE_GLIBC2 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + TOOLKIT= TOOLKIT_DEF= @@ -5720,7 +5766,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5724: checking for $ac_word" >&5 +echo "configure:5770: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5751,7 +5797,7 @@ fi min_gtk_version=1.0.4 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:5755: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:5801: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" != "no" ; then GTK_CFLAGS=`$GTK_CONFIG --cflags` @@ -5764,7 +5810,7 @@ echo "configure:5755: checking for GTK - version >= $min_gtk_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -5788,7 +5834,7 @@ main () } EOF -if { (eval echo configure:5792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -5828,7 +5874,7 @@ fi if test "$wxUSE_QT" = 1; then echo $ac_n "checking for Qt includes""... $ac_c" 1>&6 -echo "configure:5832: checking for Qt includes" >&5 +echo "configure:5878: checking for Qt includes" >&5 ac_find_includes= for ac_dir in $SEARCH_INCLUDE; @@ -5842,7 +5888,7 @@ for ac_dir in $SEARCH_INCLUDE; if test "$ac_find_includes" != "" ; then echo "$ac_t""found $ac_find_includes" 1>&6 echo $ac_n "checking for Qt library""... $ac_c" 1>&6 -echo "configure:5846: checking for Qt library" >&5 +echo "configure:5892: checking for Qt library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -5893,7 +5939,7 @@ fi if test "$wxUSE_MOTIF" = 1; then echo $ac_n "checking for Motif/Lesstif includes""... $ac_c" 1>&6 -echo "configure:5897: checking for Motif/Lesstif includes" >&5 +echo "configure:5943: checking for Motif/Lesstif includes" >&5 ac_find_includes= for ac_dir in $SEARCH_INCLUDE; @@ -5907,7 +5953,7 @@ for ac_dir in $SEARCH_INCLUDE; if test "$ac_find_includes" != "" ; then echo "$ac_t""found $ac_find_includes" 1>&6 echo $ac_n "checking for Motif/Lesstif library""... $ac_c" 1>&6 -echo "configure:5911: checking for Motif/Lesstif library" >&5 +echo "configure:5957: checking for Motif/Lesstif library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -5944,7 +5990,7 @@ for ac_dir in $SEARCH_LIB; CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include" echo "$ac_t""found at $ac_find_libraries" 1>&6 echo $ac_n "checking for Xt library""... $ac_c" 1>&6 -echo "configure:5948: checking for Xt library" >&5 +echo "configure:5994: checking for Xt library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -5970,7 +6016,7 @@ for ac_dir in $SEARCH_LIB; CHECK_LINK="$CHECK_LIB $ac_path_to_link" echo "$ac_t""found at $ac_find_libraries" 1>&6 echo $ac_n "checking for Xpm library""... $ac_c" 1>&6 -echo "configure:5974: checking for Xpm library" >&5 +echo "configure:6020: checking for Xpm library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -6300,7 +6346,7 @@ fi echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 -echo "configure:6304: checking for main in -ldl" >&5 +echo "configure:6350: checking for main in -ldl" >&5 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6308,14 +6354,14 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6346,7 +6392,7 @@ if test "$wxUSE_THREADS" = "1"; then echo $ac_n "checking for pthread_create in -lpthread-0.7""... $ac_c" 1>&6 -echo "configure:6350: checking for pthread_create in -lpthread-0.7" >&5 +echo "configure:6396: checking for pthread_create in -lpthread-0.7" >&5 ac_lib_var=`echo pthread-0.7'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6354,7 +6400,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread-0.7 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6389,17 +6435,17 @@ else ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6 -echo "configure:6393: checking for sys/prctl.h" >&5 +echo "configure:6439: checking for sys/prctl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6425,7 +6471,7 @@ fi echo $ac_n "checking for pthread_setcanceltype in -lpthread""... $ac_c" 1>&6 -echo "configure:6429: checking for pthread_setcanceltype in -lpthread" >&5 +echo "configure:6475: checking for pthread_setcanceltype in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_setcanceltype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6433,7 +6479,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6480,7 +6526,7 @@ EOF echo $ac_n "checking for printf in -lposix4""... $ac_c" 1>&6 -echo "configure:6484: checking for printf in -lposix4" >&5 +echo "configure:6530: checking for printf in -lposix4" >&5 ac_lib_var=`echo posix4'_'printf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6488,7 +6534,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/configure.in b/configure.in index d8a6b1a5e8..3a2e876435 100644 --- a/configure.in +++ b/configure.in @@ -916,6 +916,13 @@ if test "$wxUSE_UNIX" = 1 ; then AC_DEFINE(__UNIX__) fi +dnl ---------------------------------------------------------------- +dnl Linux: test for libc5/glibc2: glibc2 has gettext() included +dnl ---------------------------------------------------------------- +if test "$USE_LINUX" = 1; then + AC_CHECK_LIB(c,gettext,AC_DEFINE(wxHAVE_GLIBC2)) +fi + dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ---------------------------------------------------------------- diff --git a/setup/setup.hin b/setup/setup.hin index 36fb812210..5937b5cc9c 100644 --- a/setup/setup.hin +++ b/setup/setup.hin @@ -55,6 +55,10 @@ * Use Threads */ #define wxUSE_THREADS 0 +/* + * Have glibc2 + */ +#define wxHAVE_GLIBC2 0 //------------------------------------------------------------------------ // GUI control options (allways enabled in wxGTK) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 9b7fbe2ecd..ef8e6fd1e9 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -518,11 +518,10 @@ void wxSocketBase::Discard() // Meanwhile, if your compiler complains about socklen_t, // switch lines below. -#if defined(__LINUX__) -// #if 0 -#define wxSOCKET_INT socklen_t +#if wxHAVE_GLIBC2 +# define wxSOCKET_INT socklen_t #else -#define wxSOCKET_INT int +# define wxSOCKET_INT int #endif // -------------------------------------------------------------- diff --git a/src/iodbc/config.h b/src/iodbc/config.h index e4319509a8..6cd62312c3 100644 --- a/src/iodbc/config.h +++ b/src/iodbc/config.h @@ -29,8 +29,14 @@ typedef WORD WPARAM; typedef DWORD LPARAM; - typedef void* HWND; - typedef int BOOL; +// KB: I don't see where HWND and BOOL could get defined before here, +// but putting in the #ifndef's solved the compilation problem on Solaris. +#ifndef HWND +typedef void* HWND; +#endif +#ifndef BOOL +typedef int BOOL; +#endif # endif /* _UNIX_ */ diff --git a/src/iodbc/henv.h b/src/iodbc/henv.h index 191476d28d..96b0b600a0 100644 --- a/src/iodbc/henv.h +++ b/src/iodbc/henv.h @@ -1,7 +1,7 @@ #ifndef _HENV_H #define _HENV_H -# include +# include "config.h" # include # include