]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
removed wcslen() implementation, it is now inline in wxchar.h
[wxWidgets.git] / configure.in
index 6156f555af8b44bfeff5c5b5a0fd97b2e32a0707..e4dd9d37811cf26340f070e0c5aea2790a42ba8c 100644 (file)
@@ -715,8 +715,8 @@ WX_ARG_ENABLE(soname,      [  --enable-soname         set the DT_SONAME field in
 WX_ARG_ENABLE(optimise,    [  --enable-optimise       create optimised code], wxUSE_OPTIMISE)
 WX_ARG_ENABLE(debug,       [  --enable-debug          same as debug_flag and debug_info], wxUSE_DEBUG)
 
-dnl allow the precompiled header option to be disabled under Mac OS X
-WX_ARG_ENABLE(precomp,     [  --enable-precomp        enable use of precompiled headers (Mac OS X)], wxUSE_PRECOMP)
+dnl allow the precompiled header option to be disabled under Mac OS X/Darwin
+WX_ARG_ENABLE(precomp,     [  --enable-precomp        enable use of precompiled headers (Mac OS X/Darwin)], wxUSE_PRECOMP)
 
 if test "$wxUSE_DEBUG" = "yes"; then
   DEFAULT_wxUSE_DEBUG_FLAG=yes
@@ -1423,6 +1423,13 @@ case "${host}" in
     arm-*-linux* )
         AC_CHECK_SIZEOF(long long, 8)
     ;;
+    *-hp-hpux* )
+        AC_CHECK_SIZEOF(long long, 0)
+        if test "$ac_cv_sizeof_long_long" != "0"; then
+            dnl HPUX 10.20 headers need this define in order to use long long definitions
+            CPPFLAGS="$CPPFLAGS -D_INCLUDE_LONGLONG"
+        fi
+    ;;
     * )
         AC_CHECK_SIZEOF(long long, 0)
 esac
@@ -1469,11 +1476,12 @@ dnl wx/defs.h which defines these constants leading to inconsistent
 dnl sizeof(off_t) in different source files of the same program and linking
 dnl problems
 if test "x$wx_largefile" = "xyes"; then
-    if test "x$ac_cv_sys_file_offset_bits" = "xyes"; then
-        CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
+    if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
+        WX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
     else
-        CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
+        WX_LARGEFILE_FLAGS="-D_LARGE_FILES"
     fi
+    CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS"
 fi
 
 dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
@@ -1907,6 +1915,16 @@ if test "$USE_WIN32" = 1 ; then
     RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
 fi
 
+if test "$USE_DARWIN" = 1; then
+    dnl Mac OS X/Darwin GCC uses precompiled headers by default
+    dnl this can cause problems both when compiling wxMac and wxBase
+    if test "$wxUSE_PRECOMP" = "yes"; then
+        CPPFLAGS="$CPPFLAGS -cpp-precomp"
+    else
+        CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+    fi
+fi
+
 if test "$wxUSE_GUI" = "yes"; then
     USE_GUI=1
 
@@ -2327,7 +2345,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
         for libp in "" " -lXp"; do
             if test "$libs_found" = "0"; then
                 for libsm_ice in " -lSM -lICE"; do
-                    if test "$libs_found" = "0"; then                
+                    if test "$libs_found" = "0"; then
                         save_LIBS="$LIBS"
                         LIBS="$GUI_TK_LIBRARY -lXm${xpm_link} ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11"
                         save_CFLAGS=$CFLAGS
@@ -2372,14 +2390,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
     fi
 
     if test "$wxUSE_MAC" = 1; then
-        if test "$wxUSE_PRECOMP" = "yes"; then
-            CPPFLAGS="$CPPFLAGS -cpp-precomp"
-        else
-            CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
-        fi
-        CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
-        CFLAGS="$CFLAGS -fpascal-strings"
-        CXXFLAGS="$CXXFLAGS -fpascal-strings"
+        CPPFLAGS="$CPPFLAGS -fpascal-strings -I\${top_srcdir}/src/mac/morefile -I/Developer/Headers/FlatCarbon"
 
         TOOLKIT_VPATH="\${top_srcdir}/src/mac${PATH_IFS}\${top_srcdir}/src/mac/morefile"
         TOOLKIT=MAC
@@ -2669,8 +2680,9 @@ if test "$wxUSE_SHARED" = "yes"; then
     case "${host}" in
       *-hp-hpux* )
         dnl default settings are good for gcc but not for the native HP-UX
-        if test "$GCC" == "yes"; then
-            SHARED_LD="${SHARED_LD} ${PIC_FLAG}"
+        if test "$GCC" = "yes"; then
+            dnl -o flag must be after PIC flag
+            SHARED_LD="${CXX} -shared ${PIC_FLAG} -o"
         else
             dnl no idea why it wants it, but it does
             LDFLAGS="$LDFLAGS -L/usr/lib"
@@ -2731,8 +2743,9 @@ if test "$wxUSE_SHARED" = "yes"; then
       *-*-darwin* )
         dnl For Unix to MacOS X porting instructions, see:
         dnl http://fink.sourceforge.net/doc/porting/porting.html
-        CFLAGS="$CFLAGS -fno-common -DWXMAKINGDLL"
-        CXXFLAGS="$CXXFLAGS -fno-common -DWXMAKINGDLL"
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -DWXMAKINGDLL"
+        CFLAGS="$CFLAGS -fno-common"
+        CXXFLAGS="$CXXFLAGS -fno-common"
         dnl wxWindows must be fully binded (lazy binding breaks RTTI classinfo)
         dnl this can be done either with the exe linker flag -Wl,-bind_at_load
         dnl or with a double stage link in order to create a single module
@@ -2825,6 +2838,12 @@ if test "$wxUSE_SHARED" = "no"; then
 
     WX_TARGET_LIBRARY_TYPE="a"
     INSTALL_LIBRARY='$(INSTALL_DATA)'
+
+    dnl wx-config should assume the --static flag by default if we don't have
+    dnl any shared libs anyhow
+    STATIC_FLAG="yes"
+else
+    STATIC_FLAG="no"
 fi
 
 if test "$wxUSE_MAC" = 1; then
@@ -3130,7 +3149,7 @@ if test "$USE_BEOS" = 1; then
 fi
 
 if test "$USE_DARWIN" = 1; then
-    dnl Mac OS X has both nanosleep and usleep
+    dnl Mac OS X/Darwin has both nanosleep and usleep
     dnl but only usleep is defined in unistd.h
     AC_DEFINE(HAVE_USLEEP)
     HAVE_SOME_SLEEP_FUNC=1
@@ -3338,6 +3357,9 @@ if test "$TOOLKIT" != "MSW"; then
             *-aix* | *-freebsd*)
                 flag="-D_THREAD_SAFE"
                 ;;
+            *-hp-hpux* )
+                flag="-D_REENTRANT"
+                ;;
             *solaris* | alpha*-osf*)
                 flag="-D_REENTRANT"
                 ;;
@@ -3475,10 +3497,28 @@ else
     if test "$wxUSE_THREADS" = "yes" ; then
       case "${host}" in
         *-*-mingw32* )
-        CFLAGS="$CFLAGS -mthreads"
-        CXXFLAGS="$CXXFLAGS -mthreads"
-        TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads"
-        LDFLAGS="$LDFLAGS -mthreads"
+            dnl check if the compiler accepts -mthreads
+            AC_CACHE_CHECK([if compiler supports -mthreads],
+                wx_cv_cflags_mthread,
+                [
+                    CFLAGS_OLD="$CFLAGS"
+                    CFLAGS="$CFLAGS -mthreads"
+                    AC_TRY_COMPILE([], [],
+                        wx_cv_cflags_mthread=yes,
+                        wx_cv_cflags_mthread=no
+                    )
+                ]
+            )
+
+            if test "$wx_cv_cflags_mthread" = "yes"; then
+                dnl it does, use it
+                CXXFLAGS="$CXXFLAGS -mthreads"
+                TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads"
+                LDFLAGS="$LDFLAGS -mthreads"
+            else
+                dnl it doesn't
+                CFLAGS="$CFLAGS_OLD"
+            fi
         ;;
       esac
     fi
@@ -4189,7 +4229,7 @@ fi
 
 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
 
-dnl     There is now experimental generic MDI support 
+dnl     There is now experimental generic MDI support
 dnl     if test "$wxUSE_UNIVERSAL" = "yes"; then
 dnl         AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
 dnl         wxUSE_MDI_ARCHITECTURE=no
@@ -4976,9 +5016,10 @@ if test "$GXX" = yes ; then
     fi
 fi
 
-EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
+EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
 
 dnl remove the extra white space from the cc/c++/ld options
+CPPFLAGS=`echo $INCLUDES $CPPFLAGS | sed 's/ \\+/ /g'`
 CFLAGS=`echo $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
 CXXFLAGS=`echo $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
 LIBS=`echo $LIBS | sed 's/ \+/ /g'`
@@ -5032,6 +5073,8 @@ AC_SUBST(SONAME_FLAGS_GL)
 AC_SUBST(WX_TARGET_LIBRARY_SONAME)
 AC_SUBST(WX_TARGET_LIBRARY_TYPE)
 
+AC_SUBST(STATIC_FLAG)
+
 dnl debugging options
 AC_SUBST(WXDEBUG_DEFINE)
 
@@ -5054,6 +5097,7 @@ AC_SUBST(WXCONFIG_LIBS_STATIC)
 AC_SUBST(WXCONFIG_LIBS_STATIC_GL)
 AC_SUBST(WXCONFIG_INCLUDE)
 AC_SUBST(WXCONFIG_RPATH)
+AC_SUBST(WX_LARGEFILE_FLAGS)
 
 dnl the list of files to compile/install
 AC_SUBST(ALL_OBJECTS)