]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
apptraits for wxMac classic and carbon
[wxWidgets.git] / configure.in
index 61069b7e6117840fd5dd2d1d9b6ecea20fc12d8b..76b1a6ee3a9311823399a2d8c65d45402162e545 100644 (file)
@@ -336,7 +336,6 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_THREADS=yes
 
   DEFAULT_wxUSE_SHARED=yes
-  DEFAULT_wxUSE_SONAME=no
   DEFAULT_wxUSE_OPTIMISE=no
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
@@ -501,6 +500,8 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_XPM=no
   DEFAULT_wxUSE_ICO_CUR=no
   DEFAULT_wxUSE_ACCESSIBILITY=no
+  
+  DEFAULT_wxUSE_MONOLITHIC=yes
 else
   DEFAULT_wxUSE_UNIVERSAL=no
 
@@ -509,7 +510,6 @@ else
   DEFAULT_wxUSE_THREADS=yes
 
   DEFAULT_wxUSE_SHARED=yes
-  DEFAULT_wxUSE_SONAME=no
   DEFAULT_wxUSE_OPTIMISE=yes
   DEFAULT_wxUSE_PROFILE=no
   DEFAULT_wxUSE_NO_DEPS=no
@@ -673,6 +673,8 @@ else
   DEFAULT_wxUSE_XPM=yes
   DEFAULT_wxUSE_ICO_CUR=yes
   DEFAULT_wxUSE_ACCESSIBILITY=no
+  
+  DEFAULT_wxUSE_MONOLITHIC=yes
 fi
 
 dnl WX_ARG_WITH should be used to select whether an external package will be
@@ -703,6 +705,7 @@ dnl     doing
 dnl ---------------------------------------------------------------------------
 
 WX_ARG_ENABLE(gui,         [  --enable-gui            use GUI classes], wxUSE_GUI)
+WX_ARG_ENABLE(monolithic,  [  --disable-monolithic    don't build wxWindows as single library], wxUSE_MONOLITHIC)
 
 if test "$wxUSE_GUI" = "yes"; then
 
@@ -739,7 +742,6 @@ dnl compile options
 dnl ---------------------------------------------------------------------------
 
 WX_ARG_ENABLE(shared,      [  --enable-shared         create shared library code], wxUSE_SHARED)
-WX_ARG_ENABLE(soname,      [  --enable-soname         set the DT_SONAME field in ELF shared libraries], wxUSE_SONAME)
 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)
 
@@ -1184,7 +1186,11 @@ if test "$wxUSE_GUI" = "yes"; then
       fi
     done
 else
-    AC_MSG_RESULT(base ($host_alias hosted) only)
+    if test "x$host_alias" != "x"; then
+        AC_MSG_RESULT(base ($host_alias hosted) only)
+    else
+        AC_MSG_RESULT(base only)
+    fi
 fi
 
 dnl ---------------------------------------------------------------------------
@@ -2096,7 +2102,7 @@ if test "$USE_WIN32" = 1 ; then
 
     dnl --- FIXME: This is still a somewhat random list of libs,
     dnl ---        some of them should probably be included conditionally.
-    LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32"
+    LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
 
     if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
         LIBS="$LIBS -loleacc"
@@ -2105,7 +2111,7 @@ if test "$USE_WIN32" = 1 ; then
     case "${host}" in
         *-*-cygwin* )
             dnl Cygwin doesn't include these by default
-            LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32"
+            LIBS="$LIBS -lkernel32 -luser32"
             TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__"
     esac
 
@@ -2148,10 +2154,6 @@ if test "$wxUSE_GUI" = "yes"; then
     if test "$wxUSE_MSW" = 1 ; then
         TOOLKIT=MSW
         GUIDIST=MSW_DIST
-
-        dnl -mwindows causes a heap of other default gui libs to be linked in.
-        dnl All platforms need this, except maybe cygwin
-        LDFLAGS="$LDFLAGS -Wl,--subsystem,windows -mwindows"
     fi
 
     if test "$wxUSE_GTK" = 1; then
@@ -3098,12 +3100,6 @@ if test "$wxUSE_SHARED" = "yes"; then
             fi
         fi
 
-        if test "$wxUSE_SONAME" = "yes" ; then
-            SONAME_FLAGS="-Wl,-soname,${WX_LIBRARY_LINK1}"
-            SONAME_FLAGS_GL="-Wl,-soname,${WX_LIBRARY_LINK1_GL}"
-            dnl substitute this in makelib.env for the contrib libs
-            WX_TARGET_LIBRARY_SONAME="-Wl,-soname,\$(TARGETLIB_LINK1)"
-        fi
         SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
       ;;
 
@@ -3141,8 +3137,6 @@ if test "$wxUSE_SHARED" = "yes"; then
         else
             SHARED_LD="${CXX} -G -o"
             PIC_FLAG="-KPIC"
-            SONAME_FLAGS="-h ${WX_LIBRARY_NAME_SHARED}"
-            SONAME_FLAGS_GL="-h ${WX_LIBRARY_NAME_SHARED_GL}"
             SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
         fi
       ;;
@@ -3159,11 +3153,6 @@ if test "$wxUSE_SHARED" = "yes"; then
         dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
         SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
         PIC_FLAG="-dynamic -fPIC"
-        dnl library installation base name and wxMac resources file base name
-        dnl must be identical in order for the resource file to be found at
-        dnl run time in src/mac/app.cpp
-        SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1}"
-        SONAME_FLAGS_GL="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION} -install_name \$(libdir)/${WX_LIBRARY_LINK1_GL}"
       ;;
 
       *-*-aix* )
@@ -5545,6 +5534,10 @@ if test "$wxUSE_GUI" = "yes"; then
     SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \
                      drawing dynamic erase event exec font image \
                      minimal propsize rotate shaped widgets"
+
+    if test "$wxUSE_MONOLITHIC" != "yes"; then
+        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
+    fi
 else
     SAMPLES_SUBDIRS="console"
 fi
@@ -5562,6 +5555,24 @@ INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_NAME} \
 $REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE \
 $TOOLKIT_INCLUDE"
 
+dnl C/C++ compiler options used to compile wxWindows
+if test "$GXX" = yes ; then
+    dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
+    CXXWARNINGS="-Wall"
+    dnl should enable this one day...
+    dnl CXXWARNINGS="-Wall -Werror"
+fi
+
+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 $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
+CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
+LIBS=`echo $LIBS | sed 's/ \+/ /g'`
+
+LDFLAGS="$LDFLAGS $PROFILE"
+
 dnl wxGTK does not need TOOLKIT includes in wx-config
 if test "$wxUSE_GTK" = 1; then
     WXCONFIG_INCLUDE=
@@ -5584,8 +5595,17 @@ AC_SUBST(wxUSE_LIBTIFF)
 
 EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS"
 
-dnl FIXME -- must use configure option!
-MONOLITHIC=1
+if test $wxUSE_MONOLITHIC = "yes" ; then
+    MONOLITHIC=1
+else
+    MONOLITHIC=0
+fi
+
+dnl FIXME -- make configurable!
+VENDOR="custom"
+OFFICIAL_BUILD=0
+AC_SUBST(VENDOR)
+AC_SUBST(OFFICIAL_BUILD)
 
 AC_SUBST(WXUNIV)
 AC_SUBST(MONOLITHIC)
@@ -5600,23 +5620,7 @@ AC_SUBST(SAMPLES_RPATH_FLAG)
 
 AC_BAKEFILE
 
-dnl C/C++ compiler options used to compile wxWindows
-if test "$GXX" = yes ; then
-    dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
-    CXXWARNINGS="-Wall"
-    dnl should enable this one day...
-    dnl CXXWARNINGS="-Wall -Werror"
-fi
-
-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'`
 
-LDFLAGS="$LDFLAGS $PROFILE"
 
 dnl for convenience, sort the samples in alphabetical order
 dnl
@@ -5658,12 +5662,7 @@ AC_SUBST(WX_ALL_INSTALLED)
 
 AC_SUBST(SHARED_LD)
 AC_SUBST(PIC_FLAG)
-AC_SUBST(CODE_GEN_FLAGS)
-AC_SUBST(CODE_GEN_FLAGS_CXX)
 
-AC_SUBST(SONAME_FLAGS)
-AC_SUBST(SONAME_FLAGS_GL)
-AC_SUBST(WX_TARGET_LIBRARY_SONAME)
 AC_SUBST(WX_TARGET_LIBRARY_TYPE)
 
 AC_SUBST(STATIC_FLAG)
@@ -5693,6 +5692,8 @@ AC_SUBST(WXCONFIG_LIBS_STATIC_GL)
 AC_SUBST(WXCONFIG_INCLUDE)
 AC_SUBST(WXCONFIG_RPATH)
 AC_SUBST(WX_LARGEFILE_FLAGS)
+AC_SUBST(CODE_GEN_FLAGS)
+AC_SUBST(CODE_GEN_FLAGS_CXX)
 
 dnl the list of files to compile/install
 AC_SUBST(ALL_OBJECTS)
@@ -5807,172 +5808,46 @@ AC_CONFIG_COMMANDS([default],
          )
 
 
-dnl Configure samples if their sources are present:
-if test -d ${srcdir}/samples ; then
-    AC_CONFIG_FILES([
-        samples/Makefile
-        samples/access/Makefile
-        samples/artprov/Makefile
-        samples/caret/Makefile
-        samples/calendar/Makefile
-        samples/checklst/Makefile
-        samples/config/Makefile
-        samples/controls/Makefile
-        samples/console/Makefile
-        samples/db/Makefile
-        samples/dialogs/Makefile
-        samples/dialup/Makefile
-        samples/docview/Makefile
-        samples/docvwmdi/Makefile
-        samples/dnd/Makefile
-        samples/dragimag/Makefile
-        samples/drawing/Makefile
-        samples/dynamic/Makefile
-        samples/erase/Makefile
-        samples/event/Makefile
-        samples/exec/Makefile
-        samples/font/Makefile
-        samples/grid/Makefile
-        samples/help/Makefile
-        samples/image/Makefile
-        samples/internat/Makefile
-        samples/ipc/Makefile
-        samples/joytest/Makefile
-        samples/keyboard/Makefile
-        samples/layout/Makefile
-        samples/listctrl/Makefile
-        samples/mdi/Makefile
-        samples/menu/Makefile
-        samples/memcheck/Makefile
-        samples/minifram/Makefile
-        samples/minimal/Makefile
-        samples/mobile/Makefile
-        samples/mobile/wxedit/Makefile
-        samples/mobile/styles/Makefile
-        samples/multimon/Makefile
-        samples/notebook/Makefile
-        samples/oleauto/Makefile
-        samples/ownerdrw/Makefile
-        samples/png/Makefile
-        samples/printing/Makefile
-        samples/propsize/Makefile
-        samples/regtest/Makefile
-        samples/rotate/Makefile
-        samples/sashtest/Makefile
-        samples/shaped/Makefile
-        samples/scroll/Makefile
-        samples/scrollsub/Makefile
-        samples/sockets/Makefile
-        samples/splitter/Makefile
-        samples/statbar/Makefile
-        samples/taskbar/Makefile
-        samples/text/Makefile
-        samples/thread/Makefile
-        samples/toolbar/Makefile
-        samples/treectrl/Makefile
-        samples/typetest/Makefile
-        samples/validate/Makefile
-        samples/widgets/Makefile
-        samples/wizard/Makefile
-        samples/htlbox/Makefile
-        samples/html/Makefile
-        samples/html/about/Makefile
-        samples/html/help/Makefile
-        samples/html/printing/Makefile
-        samples/html/helpview/Makefile
-        samples/html/test/Makefile
-        samples/html/zip/Makefile
-        samples/html/virtual/Makefile
-        samples/html/widget/Makefile
-        samples/opengl/Makefile
-        samples/opengl/cube/Makefile
-        samples/opengl/penguin/Makefile
-        samples/opengl/isosurf/Makefile
-    ])
-fi
-
-dnl Configure demos if their sources are present:
-if test -d ${srcdir}/demos ; then
-    AC_CONFIG_FILES([
-        demos/Makefile
-        demos/bombs/Makefile
-        demos/dbbrowse/Makefile
-        demos/forty/Makefile
-        demos/fractal/Makefile
-        demos/life/Makefile
-        demos/poem/Makefile
-    ])
-fi
-
-dnl Configure utils if their sources are present:
-if test -d ${srcdir}/utils ; then
-    AC_CONFIG_FILES([
-        utils/Makefile
-        utils/makegen/Makefile
-        utils/HelpGen/Makefile
-        utils/HelpGen/src/Makefile
-        utils/tex2rtf/Makefile
-        utils/tex2rtf/src/Makefile
-        utils/hhp2cached/Makefile
-        utils/dialoged/Makefile
-        utils/dialoged/src/Makefile
-        utils/emulator/Makefile
-        utils/emulator/src/Makefile
-        utils/helpview/Makefile
-        utils/helpview/src/Makefile
-        utils/configtool/Makefile
-        utils/configtool/src/Makefile
-    ])
-fi
+dnl Configure samples, contrib etc. directories, but only if they are present:
+if test "$wxUSE_GUI" = "yes"; then
+    SUBDIRS="samples demos utils contrib"
+else dnl we build wxBase only
+    dnl there are no wxBase programs in contrib nor demos
+    SUBDIRS="samples utils"
+fi
+
+for subdir in `echo $SUBDIRS`; do
+    if test -d ${srcdir}/${subdir} ; then
+        if test "$wxUSE_GUI" = "yes"; then
+            if test ${subdir} = "samples"; then
+                dnl only take those samples which compile in the current
+                dnl configuration and which exist
+                for sample in `echo $SAMPLES_SUBDIRS`; do
+                    if test -d $srcdir/samples/$sample; then
+                        makefiles="samples/$sample/Makefile.in $makefiles"
+                    fi
+                done
+            else dnl assume that everything compiles for utils &c
+                makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
+            fi
+        else dnl we build wxBase only
+            dnl don't take all samples/utils, just those which build with
+            dnl wxBase
+            if test ${subdir} = "samples"; then
+                makefiles="samples/console/Makefile.in"
+            else dnl utils
+                makefiles="utils/HelpGen/Makefile.in \
+                           utils/HelpGen/src/Makefile.in \
+                           utils/makegen/Makefile.in"
+            fi
+        fi
 
-dnl Configure contrib libs & samples if their sources are present:
-if test -d ${srcdir}/contrib ; then
-    AC_CONFIG_FILES([
-        contrib/src/Makefile
-        contrib/src/deprecated/Makefile
-        contrib/src/ogl/Makefile
-        contrib/src/mmedia/Makefile
-        contrib/src/stc/Makefile
-        contrib/src/svg/Makefile           
-        contrib/src/xrc/Makefile
-        contrib/src/gizmos/Makefile
-        contrib/src/plot/Makefile
-        contrib/src/applet/Makefile
-        contrib/src/fl/Makefile
-        contrib/src/net/Makefile
-        contrib/samples/Makefile
-        contrib/samples/deprecated/Makefile
-        contrib/samples/deprecated/proplist/Makefile
-        contrib/samples/deprecated/resource/Makefile
-        contrib/samples/deprecated/treelay/Makefile
-        contrib/samples/mmedia/Makefile
-        contrib/samples/ogl/Makefile
-        contrib/samples/ogl/ogledit/Makefile
-        contrib/samples/ogl/studio/Makefile
-        contrib/samples/stc/Makefile
-        contrib/samples/svg/Makefile
-        contrib/samples/gizmos/Makefile
-        contrib/samples/gizmos/editlbox/Makefile
-        contrib/samples/gizmos/dynsash/Makefile
-        contrib/samples/gizmos/dynsash_switch/Makefile
-        contrib/samples/gizmos/multicell/Makefile
-        contrib/samples/gizmos/splittree/Makefile
-        contrib/samples/gizmos/led/Makefile
-        contrib/samples/xrc/Makefile
-        contrib/samples/plot/Makefile
-        contrib/samples/applet/Makefile
-        contrib/samples/fl/Makefile
-        contrib/samples/fl/fl_demo1/Makefile
-        contrib/samples/fl/fl_demo2/Makefile
-        contrib/samples/fl/fl_sample1/Makefile
-        contrib/samples/fl/fl_sample2/Makefile
-        contrib/samples/fl/fl_sample3/Makefile
-        contrib/utils/Makefile
-        contrib/utils/wxrc/Makefile
-        contrib/utils/wxrcedit/Makefile
-        contrib/utils/convertrc/Makefile
-    ])
-fi
+        for mkin in $makefiles ; do
+            mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'`
+            AC_CONFIG_FILES([$mk])
+        done
+    fi
+done
 
 
 AC_OUTPUT
@@ -5982,6 +5857,7 @@ echo
 echo "Configured wxWindows ${WX_VERSION} for \`${host}'"
 echo ""
 echo "  Which GUI toolkit should wxWindows use?                 ${TOOLKIT:-base only}"
+echo "  Should wxWindows be compiled into single library?       ${wxUSE_MONOLITHIC:-yes}"
 
 echo "  Should wxWindows be compiled in debug mode?             ${wxUSE_DEBUG:-no}"
 echo "  Should wxWindows be linked as a shared library?         ${wxUSE_SHARED:-no}"