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
This commit is contained in:
Karsten Ballüder 1999-01-13 11:50:30 +00:00
parent 8c73964939
commit 6d5977dfdf
6 changed files with 94 additions and 32 deletions

96
configure vendored
View File

@ -5674,6 +5674,52 @@ EOF
fi 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 <<EOF
#line 5688 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gettext();
int main() {
gettext()
; return 0; }
EOF
if { (eval echo configure:5699: \"$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
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=
TOOLKIT_DEF= TOOLKIT_DEF=
@ -5720,7 +5766,7 @@ fi
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -5751,7 +5797,7 @@ fi
min_gtk_version=1.0.4 min_gtk_version=1.0.4
echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 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="" no_gtk=""
if test "$GTK_CONFIG" != "no" ; then if test "$GTK_CONFIG" != "no" ; then
GTK_CFLAGS=`$GTK_CONFIG --cflags` 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" echo $ac_n "cross compiling; assumed OK... $ac_c"
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 5768 "configure" #line 5814 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -5788,7 +5834,7 @@ main ()
} }
EOF 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 then
: :
else else
@ -5828,7 +5874,7 @@ fi
if test "$wxUSE_QT" = 1; then if test "$wxUSE_QT" = 1; then
echo $ac_n "checking for Qt includes""... $ac_c" 1>&6 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= ac_find_includes=
for ac_dir in $SEARCH_INCLUDE; for ac_dir in $SEARCH_INCLUDE;
@ -5842,7 +5888,7 @@ for ac_dir in $SEARCH_INCLUDE;
if test "$ac_find_includes" != "" ; then if test "$ac_find_includes" != "" ; then
echo "$ac_t""found $ac_find_includes" 1>&6 echo "$ac_t""found $ac_find_includes" 1>&6
echo $ac_n "checking for Qt library""... $ac_c" 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= ac_find_libraries=
for ac_dir in $SEARCH_LIB; for ac_dir in $SEARCH_LIB;
@ -5893,7 +5939,7 @@ fi
if test "$wxUSE_MOTIF" = 1; then if test "$wxUSE_MOTIF" = 1; then
echo $ac_n "checking for Motif/Lesstif includes""... $ac_c" 1>&6 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= ac_find_includes=
for ac_dir in $SEARCH_INCLUDE; for ac_dir in $SEARCH_INCLUDE;
@ -5907,7 +5953,7 @@ for ac_dir in $SEARCH_INCLUDE;
if test "$ac_find_includes" != "" ; then if test "$ac_find_includes" != "" ; then
echo "$ac_t""found $ac_find_includes" 1>&6 echo "$ac_t""found $ac_find_includes" 1>&6
echo $ac_n "checking for Motif/Lesstif library""... $ac_c" 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= ac_find_libraries=
for ac_dir in $SEARCH_LIB; for ac_dir in $SEARCH_LIB;
@ -5944,7 +5990,7 @@ for ac_dir in $SEARCH_LIB;
CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include" CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
echo "$ac_t""found at $ac_find_libraries" 1>&6 echo "$ac_t""found at $ac_find_libraries" 1>&6
echo $ac_n "checking for Xt library""... $ac_c" 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= ac_find_libraries=
for ac_dir in $SEARCH_LIB; for ac_dir in $SEARCH_LIB;
@ -5970,7 +6016,7 @@ for ac_dir in $SEARCH_LIB;
CHECK_LINK="$CHECK_LIB $ac_path_to_link" CHECK_LINK="$CHECK_LIB $ac_path_to_link"
echo "$ac_t""found at $ac_find_libraries" 1>&6 echo "$ac_t""found at $ac_find_libraries" 1>&6
echo $ac_n "checking for Xpm library""... $ac_c" 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= ac_find_libraries=
for ac_dir in $SEARCH_LIB; for ac_dir in $SEARCH_LIB;
@ -6300,7 +6346,7 @@ fi
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -6308,14 +6354,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6312 "configure" #line 6358 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6319: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else 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 $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_%'` 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 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -6354,7 +6400,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread-0.7 $LIBS" LIBS="-lpthread-0.7 $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6358 "configure" #line 6404 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -6365,7 +6411,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6369: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -6389,17 +6435,17 @@ else
ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6398 "configure" #line 6444 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/prctl.h> #include <sys/prctl.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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` ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -6425,7 +6471,7 @@ fi
echo $ac_n "checking for pthread_setcanceltype in -lpthread""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo pthread'_'pthread_setcanceltype | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -6433,7 +6479,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6437 "configure" #line 6483 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -6444,7 +6490,7 @@ int main() {
pthread_setcanceltype() pthread_setcanceltype()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6448: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -6480,7 +6526,7 @@ EOF
echo $ac_n "checking for printf in -lposix4""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo posix4'_'printf | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -6488,7 +6534,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS" LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6492 "configure" #line 6538 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -6499,7 +6545,7 @@ int main() {
printf() printf()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6503: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else

View File

@ -916,6 +916,13 @@ if test "$wxUSE_UNIX" = 1 ; then
AC_DEFINE(__UNIX__) AC_DEFINE(__UNIX__)
fi 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 ----------------------------------------------------------------
dnl search for toolkit (widget sets) dnl search for toolkit (widget sets)
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------

View File

@ -55,6 +55,10 @@
* Use Threads * Use Threads
*/ */
#define wxUSE_THREADS 0 #define wxUSE_THREADS 0
/*
* Have glibc2
*/
#define wxHAVE_GLIBC2 0
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// GUI control options (allways enabled in wxGTK) // GUI control options (allways enabled in wxGTK)

View File

@ -518,11 +518,10 @@ void wxSocketBase::Discard()
// Meanwhile, if your compiler complains about socklen_t, // Meanwhile, if your compiler complains about socklen_t,
// switch lines below. // switch lines below.
#if defined(__LINUX__) #if wxHAVE_GLIBC2
// #if 0 # define wxSOCKET_INT socklen_t
#define wxSOCKET_INT socklen_t
#else #else
#define wxSOCKET_INT int # define wxSOCKET_INT int
#endif #endif
// -------------------------------------------------------------- // --------------------------------------------------------------

View File

@ -29,8 +29,14 @@
typedef WORD WPARAM; typedef WORD WPARAM;
typedef DWORD LPARAM; typedef DWORD LPARAM;
typedef void* HWND; // KB: I don't see where HWND and BOOL could get defined before here,
typedef int BOOL; // 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_ */ # endif /* _UNIX_ */

View File

@ -1,7 +1,7 @@
#ifndef _HENV_H #ifndef _HENV_H
#define _HENV_H #define _HENV_H
# include <config.h> # include "config.h"
# include <dlproc.h> # include <dlproc.h>
# include <isql.h> # include <isql.h>