]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
wxPython doc updates
[wxWidgets.git] / configure.in
index 014e5657060ed716118ccc05b8a55c62034313a2..8128b0c3ea3524621a9d68dd04749dcb0ec649e7 100644 (file)
@@ -223,51 +223,6 @@ AC_DEFUN(WX_CPP_BOOL,
   fi
 ])
 
-dnl ---------------------------------------------------------------------------
-dnl WX_CPP_SIZE_T_IS_NOT_INT checks whether size_t and int are different types,
-dnl i.e. whether we may overload operator[] on its argument type
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN(WX_CPP_SIZE_T_IS_NOT_INT,
-[
-  AC_CACHE_CHECK([if size_t and int are different types], wx_cv_cpp_sizet_not_int,
-  [
-    AC_LANG_SAVE
-    AC_LANG_CPLUSPLUS
-
-    AC_TRY_RUN([
-        #include <stdlib.h>
-
-        class S
-        {
-        public:
-          S(char *s) { m_s = s; }
-
-          char operator[](size_t n) const { return m_s[n]; }
-          char operator[](int n) const { return m_s[n]; }
-
-        private:
-          char *m_s;
-        };
-
-        int main()
-        {
-            S s("dummy");
-            size_t n1 = 2;
-            int n2 = 3;
-
-            return s[n1] == s[n2];
-        }
-      ],
-      AC_DEFINE(wxUSE_SIZE_T_STRING_OPERATOR) wx_cv_cpp_sizet_not_int=yes,
-      wx_cv_cpp_sizet_not_int=no,
-      wx_cv_cpp_sizet_not_int=no
-    )
-
-    AC_LANG_RESTORE
-  ])
-])
-
 dnl ---------------------------------------------------------------------------
 dnl a slightly better AC_C_BIGENDIAN macro which allows cross-compiling
 dnl ---------------------------------------------------------------------------
@@ -931,13 +886,13 @@ if test "$wxUSE_GUI" = "no"; then
   DEFAULT_wxUSE_FS_ZIP=no
   DEFAULT_wxUSE_BUSYINFO=no
   DEFAULT_wxUSE_ZIPSTREAM=no
-  DEFAULT_wxUSE_VALIDATORS=yes
+  DEFAULT_wxUSE_VALIDATORS=no
   DEFAULT_wxUSE_ACCEL=no
   DEFAULT_wxUSE_CARET=no
   DEFAULT_wxUSE_BMPBUTTON=no
   DEFAULT_wxUSE_CHECKBOX=no
   DEFAULT_wxUSE_CHECKLST=no
-  DEFAULT_wxUSE_CHOICE=yes
+  DEFAULT_wxUSE_CHOICE=no
   DEFAULT_wxUSE_COMBOBOX=no
   DEFAULT_wxUSE_GAUGE=no
   DEFAULT_wxUSE_GRID=no
@@ -956,7 +911,7 @@ if test "$wxUSE_GUI" = "no"; then
   DEFAULT_wxUSE_STATBMP=no
   DEFAULT_wxUSE_STATBOX=no
   DEFAULT_wxUSE_STATLINE=no
-  DEFAULT_wxUSE_STATUSBAR=yes
+  DEFAULT_wxUSE_STATUSBAR=no
   DEFAULT_wxUSE_TABDIALOG=no
   DEFAULT_wxUSE_TOOLBAR=no
   DEFAULT_wxUSE_TREECTRL=no
@@ -1397,7 +1352,16 @@ dnl Define search path for includes and libraries: all headers and libs will be
 dnl looked for in all directories of this path
 dnl ---------------------------------------------------------------------------
 
+dnl notice that /usr/include should not be in this list, otherwise it breaks
+dnl compilation on Solaris/gcc because standard headers are included instead
+dnl of the gcc ones (correction: it *is* needed for broken AIX compiler - but
+dnl do put it last!)
+dnl
+dnl Also try to put all directories which may contain X11R6 before those which
+dnl may contain X11R5/4 - we want to use R6 on machines which have both!
 SEARCH_INCLUDE="\
+    /usr/local/include        \
+                              \
     /usr/Motif-1.2/include    \
     /usr/Motif-2.1/include    \
                               \
@@ -1408,16 +1372,15 @@ SEARCH_INCLUDE="\
                               \
     /usr/Motif1.2/include     \
     /usr/dt/include           \
+    /usr/openwin/include      \
+                              \
     /usr/include/Xm           \
                               \
     /usr/X11R6/include        \
+    /usr/X11R6.4/include      \
     /usr/X11R5/include        \
     /usr/X11R4/include        \
                               \
-    /usr/X11R6/lib            \
-    /usr/X11R5/lib            \
-    /usr/X11R4/lib            \
-                              \
     /usr/include/X11R6        \
     /usr/include/X11R5        \
     /usr/include/X11R4        \
@@ -1439,9 +1402,6 @@ SEARCH_INCLUDE="\
     /usr/x386/include         \
     /usr/XFree86/include/X11  \
                               \
-    /usr/include              \
-    /usr/local/include        \
-                              \
     /usr/include/gtk          \
     /usr/local/include/gtk    \
     /usr/include/glib         \
@@ -1459,9 +1419,9 @@ SEARCH_INCLUDE="\
     /usr/local/x11r5/include  \
     /usr/lpp/Xamples/include  \
                               \
-    /usr/openwin/include      \
     /usr/openwin/share/include \
-    "
+                               \
+    /usr/include"
 
 SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
 
@@ -1674,7 +1634,7 @@ if test "$wxUSE_MOTIF" = 1; then
         AC_MSG_WARN(library will be compiled without support for images in XPM format)
     fi
 
-    GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -lm"
+    GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXext -lXt -lX11 -lm"
     GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
     TOOLKIT=MOTIF
 
@@ -1769,7 +1729,7 @@ if test "$wxUSE_SHARED" = "yes"; then
             PIC_FLAG="-fPIC"
         else
             SHARED_LD="${CXX} -G -o"
-            PIC_FLAG="PIC"
+            PIC_FLAG="-KPIC"
         fi
         WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
         WX_ALL="CREATE_LINKS"
@@ -1824,8 +1784,10 @@ if test "$wxUSE_SHARED" = "yes"; then
         AC_MSG_ERROR(unknown system type ${host}.)
     esac
 
-    dnl set target to shared
-    WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
+    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}"
@@ -1899,9 +1861,6 @@ WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
 dnl check whether C++ compiler supports bool built-in type
 WX_CPP_BOOL
 
-dnl check whether overloading on size_t/int parameter works
-WX_CPP_SIZE_T_IS_NOT_INT
-
 dnl check whether we should define _GNU_SOURCE
 WX_GNU_EXTENSIONS
 
@@ -1992,10 +1951,32 @@ AC_CHECK_FUNCS(uname gethostname, break)
 dnl check for MT-safe version of strtok
 AC_CHECK_FUNCS(strtok_r)
 
-dnl check for inet_addr, inet_aton, ...
-AC_CHECK_FUNCS(inet_addr)
-AC_CHECK_FUNCS(inet_aton)
-AC_CHECK_LIB(resolv, inet_aton)
+dnl check for inet_addr and inet_aton (these may live either in libc, or in
+dnl libnsl or libresolv)
+INET_LINK=
+AC_CHECK_FUNCS(inet_addr,
+    AC_DEFINE(HAVE_INET_ADDR),
+    [
+        AC_CHECK_LIB(nsl, inet_addr,
+            INET_LINK="nsl",          
+            AC_CHECK_LIB(resolv, inet_addr,
+                INET_LINK="resolv"
+            )
+        )
+    ]
+)
+
+AC_CHECK_FUNCS(inet_aton,
+        AC_DEFINE(HAVE_INET_ATON),
+        [
+            dnl only check it in the same lib
+            AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
+        ])
+
+if test "x$INET_LINK" != "x"; then
+    AC_DEFINE(HAVE_INET_ADDR)
+    INET_LINK="-l$INET_LINK"
+fi
 
 fi
 dnl Unix
@@ -2130,6 +2111,23 @@ 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
+    dnl and now try with C++
+    unset ac_cv_func_strtok_r
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    AC_CHECK_FUNCS(strtok_r)
+    AC_LANG_RESTORE
+
+    if test "$ac_cv_func_strtok_r" != "yes"; then
+      ac_cv_func_strtok_r=yes
+      CFLAGS="${CFLAGS} -D_REENTRANT"
+      CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
+    fi
+  fi
 fi
 
 if test "$WXGTK12" = 1 ; then
@@ -2292,11 +2290,6 @@ if test "$wxUSE_APPLE_IEEE" = "yes"; then
   AC_DEFINE(wxUSE_APPLE_IEEE)
 fi
 
-if test "$wxUSE_TIMEDATE" = "yes"; then
-  AC_DEFINE(wxUSE_TIMEDATE)
-  SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
-fi
-
 if test "$wxUSE_WAVE" = "yes"; then
   AC_DEFINE(wxUSE_WAVE)
 fi
@@ -2359,12 +2352,6 @@ if test "$wxUSE_LONGLONG" = "yes"; then
   AC_DEFINE(wxUSE_LONGLONG)
 fi
 
-if test "$wxUSE_SOCKETS" = "yes" ; then
-    AC_DEFINE(wxUSE_SOCKETS)
-    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
-    INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
-fi
-
 if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then
   AC_DEFINE(wxUSE_DIALUP_MANAGER)
 fi
@@ -2377,11 +2364,75 @@ if test "$wxUSE_SERIAL" = "yes" ; then
   AC_DEFINE(wxUSE_SERIAL)
 fi
 
+dnl ------------------------------------------------------------------------
+dnl time/date functions
+dnl ------------------------------------------------------------------------
+
+if test "$wxUSE_TIMEDATE" = "yes"; then
+    AC_CHECK_FUNCS(gettimeofday localtime ftime)
+
+    if test "$ac_cv_func_gettimeofday" = "yes"; then
+        AC_CACHE_CHECK([whether gettimeofday takes two arguments],
+                       wx_cv_func_gettimeofday_has_2_args,
+        [
+            dnl on some _really_ old systems it takes only 1 argument
+            AC_LANG_SAVE
+            AC_LANG_CPLUSPLUS
+
+            AC_TRY_COMPILE(
+                [
+                    #include <sys/time.h>
+                    #include <unistd.h>
+                ],
+                [
+                    struct timeval tv;
+                    struct timezone tz;
+                    gettimeofday(&tv, &tz);
+                ],
+                wx_cv_func_gettimeofday_has_2_args=yes,
+                AC_TRY_COMPILE(
+                    [
+                        #include <sys/time.h>
+                        #include <unistd.h>
+                    ],
+                    [
+                        struct timeval tv;
+                        gettimeofday(&tv);
+                    ],
+                    wx_cv_func_gettimeofday_has_2_args=no,
+                    wx_cv_func_gettimeofday_has_2_args=unknown
+                )
+            )
+            AC_LANG_RESTORE
+        ])
+
+        if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
+            AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
+        fi
+    fi
+
+    AC_DEFINE(wxUSE_TIMEDATE)
+    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
+fi
+
 dnl ------------------------------------------------------------------------
 dnl wxSocket
 dnl ------------------------------------------------------------------------
 
 if test "$wxUSE_SOCKETS" = "yes"; then
+    dnl under Solaris, socket functions live in -lsocket
+    AC_CHECK_FUNC(socket,,
+        AC_CHECK_LIB(socket, socket,
+            INET_LINK="$INET_LINK -lsocket",
+            [
+                AC_MSG_WARN([socket library not found - sockets will be disabled])
+                wxUSE_SOCKETS=no
+            ]
+        )
+    )
+fi
+
+if test "$wxUSE_SOCKETS" = "yes" ; then
     AC_LANG_SAVE
     AC_LANG_CPLUSPLUS
     dnl determine the type of third argument for getsockname
@@ -2398,11 +2449,15 @@ if test "$wxUSE_SOCKETS" = "yes"; then
                 [#include <sys/socket.h>],
                 [int len; getsockname(0, 0, &len);],
                 AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
-            AC_MSG_RESULT(unknown)
-        )
+                AC_MSG_RESULT(unknown)
+            )
         )
     )
     AC_LANG_RESTORE
+
+    AC_DEFINE(wxUSE_SOCKETS)
+    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
+    INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
 fi
 
 dnl ---------------------------------------------------------------------------
@@ -2839,7 +2894,7 @@ dnl ---------------------------------------------------------------------------
 GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
 
 dnl all additional libraries (except wxWindows itself) we link with
-EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK"
+EXTRA_LIBS="$LIBS $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $DL_LINK"
 if test "$wxUSE_GUI" = "yes"; then
     EXTRA_LIBS="$EXTRA_LIBS $GUILIBS"
 fi
@@ -2861,9 +2916,8 @@ if test "$GXX" = yes ; then
 fi
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
 
-CPPFLAGS="-I\${top_srcdir}/include $CPPFLAGS"
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
-CXXFLAGS="$CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS"
+CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS | sed 's/ \\+/ /g'`
+CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
 
 if test "$wxUSE_GUI" = "yes"; then
     dnl TODO add checks that these samples will really compile (i.e. all the
@@ -2989,17 +3043,18 @@ AC_OUTPUT([
             samples/listctrl/Makefile
             samples/mdi/Makefile
             samples/minifram/Makefile
-           samples/minimal/Makefile
+            samples/minimal/Makefile
             samples/nettest/Makefile
             samples/newgrid/Makefile
             samples/notebook/Makefile
             samples/png/Makefile
             samples/printing/Makefile
-           samples/proplist/Makefile
+            samples/proplist/Makefile
             samples/richedit/Makefile
             samples/resource/Makefile
             samples/sashtest/Makefile
             samples/scroll/Makefile
+            samples/scrollsub/Makefile
             samples/splitter/Makefile
             samples/text/Makefile
             samples/thread/Makefile
@@ -3038,10 +3093,11 @@ AC_OUTPUT([
             if test ! -d include/wx/${TOOLKIT_DIR}; then
               mkdir include/wx/${TOOLKIT_DIR}
             fi
-            cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
+            if test -f setup.h; then
+                mv -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
+            fi
           ],
           [
-            LN_S="${ac_cv_prog_LN_S}"
             TOOLKIT_DIR="${TOOLKIT_DIR}"
           ]
          )