]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
1. made wxBase compile/link/run again under Unix
[wxWidgets.git] / configure.in
index aefb357b153d0ff58d3fa96ce64798dd39e67414..d71e25eff030e28d63067470e01a0692a0f52626 100644 (file)
@@ -465,6 +465,7 @@ dnl ------------------------------------------------------------------------
 
 dnl assume Unix
 USE_UNIX=1
+USE_WIN32=0
 USE_LINUX=
 USE_SGI=
 USE_HPUX=
@@ -583,6 +584,7 @@ case "${host}" in
 
   *-*-cygwin32* )
     USE_UNIX=0
+    USE_WIN32=1
     AC_DEFINE(__WIN32__)
     AC_DEFINE(__WIN95__)
     AC_DEFINE(__WINDOWS__)
@@ -593,6 +595,7 @@ case "${host}" in
   ;;
   *-*-mingw32* )
     USE_UNIX=0
+    USE_WIN32=1
     AC_DEFINE(__WIN32__)
     AC_DEFINE(__WIN95__)
     AC_DEFINE(__WINDOWS__)
@@ -1510,7 +1513,12 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
     INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS msw"
     dnl --- Quick & Dirty ; link against most/all libraries
     dnl --- This will bloat the executable, but it'll work for now...
-    LIBS="$LIBS  -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32"
+    LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32"
+
+    dnl -mwindows is needed to avoid that spawning of a console window
+    if test "$wxUSE_MINGW" = 1; then
+        LDFLAGS="$LDFLAGS -mwindows"
+    fi
 
     TOOLKIT=MSW
 
@@ -1595,18 +1603,30 @@ if test "$wxUSE_WINE" = 1; then
 fi
 
 if test "$wxUSE_MOTIF" = 1; then
-    dnl find the X11 include and library files
-    dnl   defines x_includes and x_libraries
-    AC_PATH_XTRA
-
-    if test "$no_x" = "yes"; then
-      AC_MSG_ERROR(X11 libraries not found, aborting)
+    AC_MSG_CHECKING(for X11 headers)
+    WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h)
+    if test "$ac_find_includes" != "" ; then
+        AC_MSG_RESULT(found $ac_find_includes)
+    else
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
     fi
 
-    TOOLKIT_INCLUDE="$X_CFLAGS"
-    GUI_TK_LIBRARY="$X_LIBS"
+    AC_MSG_CHECKING(for X11 libraries)
+    WX_PATH_FIND_LIBRARIES($SEARCH_LIB, X11)
+    if test "$ac_find_libraries" != "" ; then
+        WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
+        WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
+
+        GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
+        TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
+        AC_MSG_RESULT(found at $ac_find_libraries)
+    else
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
+    fi
 
-    AC_MSG_CHECKING(for Motif/Lesstif includes)
+    AC_MSG_CHECKING(for Motif/Lesstif headers)
     WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
     if test "$ac_find_includes" != "" ; then
         AC_MSG_RESULT(found $ac_find_includes)
@@ -1621,7 +1641,7 @@ if test "$wxUSE_MOTIF" = 1; then
         WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
         WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
 
-        CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
+        GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
         TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
         AC_MSG_RESULT(found at $ac_find_libraries)
     else
@@ -1633,7 +1653,7 @@ if test "$wxUSE_MOTIF" = 1; then
     WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
     if test "$ac_find_libraries" != "" ; then
         WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
-        CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
+        GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
         AC_MSG_RESULT(found at $ac_find_libraries)
     else
         AC_MSG_RESULT(no)
@@ -1645,7 +1665,7 @@ if test "$wxUSE_MOTIF" = 1; then
     WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
     if test "$ac_find_libraries" != "" ; then
         WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
-        CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
+        GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
         XPM_LINK="-lXpm "
         AC_DEFINE(wxHAVE_LIB_XPM)
         AC_MSG_RESULT(found at $ac_find_libraries)
@@ -1715,14 +1735,16 @@ WX_ALL=
 WX_ALL_INSTALLED=
 
 if test "$wxUSE_SHARED" = "yes"; then
-    dnl set target to shared
-    WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
-
     case "${host}" in
       *-hp-hpux* )
+        if test "$GCC" = yes ; then
+            SHARED_LD="${CC} -shared -o"
+            PIC_FLAG="-fPIC"
+        else
+            SHARED_LD="${CXX} -b -o"
+            PIC_FLAG="+Z"
+        fi
         WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl"
-        SHARED_LD="${CXX} -b -o"
-        PIC_FLAG="+Z"
         WX_ALL=${WX_LIBRARY_NAME_SHARED}
       ;;
       *-*-linux* )
@@ -1802,6 +1824,10 @@ if test "$wxUSE_SHARED" = "yes"; then
         AC_MSG_ERROR(unknown system type ${host}.)
     esac
 
+    dnl set target to shared if not explicitly chose static before
+    if test "x$WX_TARGET_LIBRARY" = "x"; then
+        WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
+    fi
 else
     dnl set target to static
     WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
@@ -2106,6 +2132,13 @@ if test "$wxUSE_THREADS" = "yes"; then
   CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
 
   SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
+else
+  dnl on some systems, _REENTRANT should bedefined if we want to use any _r()
+  dnl functions - add tests for other functions here as well
+  if test "$ac_cv_func_strtok_r" = "yes"; then
+    CFLAGS="${CFLAGS} -D_REENTRANT"
+    CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
+  fi
 fi
 
 if test "$WXGTK12" = 1 ; then
@@ -2364,15 +2397,15 @@ if test "$wxUSE_SOCKETS" = "yes"; then
     AC_MSG_CHECKING(the type of the third argument of getsockname)
     AC_TRY_COMPILE(
         [#include <sys/socket.h>],
-        [socklen_t len; getsockname(0, NULL, &len);],
+        [socklen_t len; getsockname(0, 0, &len);],
         AC_DEFINE(SOCKLEN_T, socklen_t) AC_MSG_RESULT(socklen_t),
            AC_TRY_COMPILE(
             [#include <sys/socket.h>],
-            [size_t len; getsockname(0, NULL, &len);],
+            [size_t len; getsockname(0, 0, &len);],
             AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t),
             AC_TRY_COMPILE(
                 [#include <sys/socket.h>],
-                [int len; getsockname(0, NULL, &len);],
+                [int len; getsockname(0, 0, &len);],
                 AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
             AC_MSG_RESULT(unknown)
         )
@@ -2562,10 +2595,21 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
         wxUSE_DRAG_AND_DROP=no
     fi
 
+    if test "$USE_WIN32" = 1; then
+        dnl check for ole headers and disable DnD if not present (earlier
+        dnl versions of mingw32 don't have them)
+        AC_CHECK_HEADERS(ole2.h)
+        if test "x$HAVE_OLE2_H" = x ; then
+            AC_MSG_WARN(Drag and drop disabled because OLE headers not found)
+            wxUSE_DRAG_AND_DROP=no
+        fi
+    fi
+
     if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
         AC_DEFINE(wxUSE_DRAG_AND_DROP)
         SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
     fi
+
 fi
 
 if test "$wxUSE_SPLINES" = "yes" ; then
@@ -2965,6 +3009,7 @@ AC_OUTPUT([
             samples/resource/Makefile
             samples/sashtest/Makefile
             samples/scroll/Makefile
+            samples/scrollsub/Makefile
             samples/splitter/Makefile
             samples/text/Makefile
             samples/thread/Makefile