]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
fixed bug with the text attr not being reset even after SetDefaultStyle(wxTextAttr...
[wxWidgets.git] / configure.in
index aa76f2176aa6d1bd508648a09a2ad11e1ecf5144..1903aa6f42e8707212e854245866c074ab170558 100644 (file)
@@ -335,8 +335,8 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_OPTIMISE=no
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
-  DEFAULT_wxUSE_NO_RTTI=yes
-  DEFAULT_wxUSE_NO_EXCEPTIONS=yes
+  DEFAULT_wxUSE_NO_RTTI=no
+  DEFAULT_wxUSE_NO_EXCEPTIONS=no
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=yes
   DEFAULT_wxUSE_DEBUG_INFO=yes
@@ -509,8 +509,8 @@ else
   DEFAULT_wxUSE_OPTIMISE=yes
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
-  DEFAULT_wxUSE_NO_RTTI=yes
-  DEFAULT_wxUSE_NO_EXCEPTIONS=yes
+  DEFAULT_wxUSE_NO_RTTI=no
+  DEFAULT_wxUSE_NO_EXCEPTIONS=no
   DEFAULT_wxUSE_PERMISSIVE=no
   DEFAULT_wxUSE_DEBUG_FLAG=no
   DEFAULT_wxUSE_DEBUG_INFO=no
@@ -1170,6 +1170,11 @@ dnl   defines CC with the compiler to use
 dnl   defines GCC with yes if using gcc
 dnl   defines GCC empty if not using gcc
 dnl   defines CFLAGS
+dnl
+dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
+dnl default CFLAGS (something like "-g -O2") - we don't need this as add
+dnl -g and -O flags ourselves below
+CFLAGS=${CFLAGS:=}
 AC_PROG_CC
 
 dnl is -traditional needed for correct compilations
@@ -1184,6 +1189,9 @@ dnl   defines CXX with the compiler to use
 dnl   defines GXX with yes if using gxx
 dnl   defines GXX empty if not using gxx
 dnl   defines CXXFLAGS
+dnl
+dnl see CFLAGS line above
+CXXFLAGS=${CXXFLAGS:=}
 AC_PROG_CXX
 
 AC_LANG_RESTORE
@@ -2425,7 +2433,7 @@ if test "$wxUSE_SHARED" = "yes"; then
         CXXFLAGS="$CXXFLAGS -fno-common -DDYLIB_INIT"
         dnl Executables must necessarily fully bind the wxWindows library at
         dnl program launch otherwise lazy binding breaks RTTI class info
-        LDFLAGS="$LDFLAGS -Wl,-bind_at_load"
+        LDFLAGS_EXE="$LDFLAGS_EXE -Wl,-bind_at_load"
         SHARED_LD="$CXX -dynamiclib -init _wxWindowsDylibInit -o"
         PIC_FLAG="-dynamic -fPIC"
         SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
@@ -3161,8 +3169,8 @@ if test "$TOOLKIT" != "MSW"; then
         case "${host}" in
           *-*-solaris2* | *-*-sunos4* )
                 if test "x$GCC" = "xyes"; then
-                    dnl apparently some Solaris/gcc combinations use this one
-                    THREAD_OPTS="$THREAD_OPTS -pthreads"
+                    dnl Solaris/gcc combination use this one for some reason
+                    THREAD_OPTS="-pthreads $THREAD_OPTS"
                 else
                     THREAD_OPTS="-mt $THREAD_OPTS"
                 fi
@@ -3172,16 +3180,21 @@ if test "$TOOLKIT" != "MSW"; then
                 dnl and finally the userland threads
                 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
                 ;;
-          *-*-aix* )
+          *-*-darwin*)
+                dnl Darwin / Mac OS X just uses -lpthread tested below
+                THREAD_OPTS=""
+                ;;
+          *-*-aix*)
                 dnl AIX calls the library libpthreads - thanks IBM!
                 THREAD_OPTS="pthreads"
                 ;;
-          *)
-                dnl the default is ok but if it doesn't work try without it
-                dnl just in case
-                THREAD_OPTS="$THREAD_OPTS none"
         esac
 
+        dnl simply linking with libpthread should make the test below work but
+        dnl it's far from certain that the threaded programs compiled without
+        dnl any special switches actually work, so try it after all the others
+        THREAD_OPTS="$THREAD_OPTS pthread none"
+
         dnl now test for all possibilities
         THREADS_OK=no
         for flag in $THREAD_OPTS; do
@@ -3204,7 +3217,7 @@ if test "$TOOLKIT" != "MSW"; then
               save_LIBS="$LIBS"
               save_CFLAGS="$CFLAGS"
               LIBS="$THREADS_LINK $LIBS"
-              CFLAGS="$CFLAGS $THREADS_CFLAGS"
+              CFLAGS="$THREADS_CFLAGS $CFLAGS"
 
               AC_TRY_LINK([#include <pthread.h>],
                           [pthread_create(0,0,0,0);],
@@ -3226,6 +3239,10 @@ if test "$TOOLKIT" != "MSW"; then
           wxUSE_THREADS=no
           AC_MSG_WARN([No thread support on this system... disabled])
       else
+          dnl yes, these special compiler flags should be used with the
+          dnl linker as well
+          LIBS="$THREADS_LINK $THREADS_CFLAGS $LIBS"
+
           AC_MSG_CHECKING([if more special flags are required for pthreads])
           flag=no
           case "${host}" in
@@ -3238,14 +3255,11 @@ if test "$TOOLKIT" != "MSW"; then
           esac
           AC_MSG_RESULT(${flag})
           if test "x$flag" != xno; then
-              THREADS_CFLAGS="$flag $THREADS_CFLAGS"
-          fi
-
-          if test "x$THREADS_LINK" != "x"; then
-            LIBS="$THREADS_LINK $LIBS"
+              THREADS_CFLAGS="$THREADS_CFLAGS $flag"
           fi
 
           if test "x$THREADS_CFLAGS" != "x"; then
+            dnl don't add these options to CPPFLAGS as cpp might not know them
             CFLAGS="$CFLAGS $THREADS_CFLAGS"
             CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
           fi
@@ -3381,9 +3395,6 @@ fi
 if test "$wxUSE_THREADS" = "yes"; then
   AC_DEFINE(wxUSE_THREADS)
 
-  dnl we must define _REENTRANT or something along these lines for MT code
-  TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS $THREADS_CFLAGS"
-
   SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
 else
   dnl on some systems, _REENTRANT should be defined if we want to use any _r()
@@ -3469,9 +3480,6 @@ if test "$GCC" = "yes" ; then
     fi
 fi
 
-
-CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
-CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
 if test "$wxUSE_OPTIMISE" = "no" ; then
     OPTIMISE=
 else
@@ -4783,10 +4791,12 @@ fi
 
 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
 
+dnl remove the extra white space from the cc/c++/ld options
 CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
 CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
+LIBS=`echo $LIBS | sed 's/ \+/ /g'`
 
-LDFLAGS="$LDFLAGS$PROFILE"
+LDFLAGS="$LDFLAGS $PROFILE"
 
 dnl for convenience, sort the samples in alphabetical order
 dnl
@@ -4873,6 +4883,7 @@ AC_SUBST(SAMPLES_SUBDIRS)
 dnl additional libraries and linker settings
 AC_SUBST(LDFLAGS)
 AC_SUBST(LDFLAGS_GL)
+AC_SUBST(LDFLAGS_EXE)
 AC_SUBST(OPENGL_LIBS)
 AC_SUBST(DMALLOC_LIBS)
 AC_SUBST(EXTRADEFS)
@@ -4927,7 +4938,7 @@ if test "$wxUSE_GUI" = "yes"; then
     export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \
            wx_cv_path_ifs wx_cv_program_ext \
            wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype
-    AC_CONFIG_SUBDIRS(demos samples utils contrib mobile)
+    AC_CONFIG_SUBDIRS(demos samples utils contrib)
 fi
 
 dnl create each of the files in the space separated list from the file.in