]> git.saurik.com Git - wxWidgets.git/commitdiff
*** empty log message ***
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 18 Jul 2004 11:19:34 +0000 (11:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 18 Jul 2004 11:19:34 +0000 (11:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

Makefile.in
build/bakefiles/make_dist.mk
build/bakefiles/wx.bkl
configure
configure.in
docs/changes.txt
wx-config-wrapper.in [new file with mode: 0755]
wx-config.in
wxwin.m4

index 620d618369bbc4bc790a8dc2c2f5268c6674a4aa..bf616a680468adfdcaa19897c55a245800f9aac2 100644 (file)
@@ -7411,8 +7411,10 @@ samples:
 
 install-wxconfig: 
        $(INSTALL_DIR) $(DESTDIR)$(bindir)
-       $(INSTALL_PROGRAM) wx$(TOOLCHAIN_NAME)-config $(DESTDIR)$(bindir)
-       (cd $(DESTDIR)$(bindir) && rm -f wx-config && $(LN_S) wx$(TOOLCHAIN_NAME)-config wx-config)
+       $(INSTALL_DIR) $(DESTDIR)$(libdir)/wx/config
+       $(INSTALL_PROGRAM) lib/wx/config/$(TOOLCHAIN_NAME) $(DESTDIR)$(libdir)/wx/config
+       $(INSTALL_PROGRAM) wx-config $(DESTDIR)$(bindir)
+       (cd $(DESTDIR)$(bindir) && rm -f wx$(TOOLCHAIN_NAME)-config && $(LN_S) wx-config wx$(TOOLCHAIN_NAME)-config)
 
 locale_install: 
        $(INSTALL_DIR) $(DESTDIR)$(datadir)/locale
@@ -19826,6 +19828,7 @@ ALL_DIST: distrib_clean
        cp $(WXDIR)/install-sh $(DISTDIR)
        cp $(WXDIR)/mkinstalldirs $(DISTDIR)
        cp $(WXDIR)/wx-config.in $(DISTDIR)
+       cp $(WXDIR)/wx-config-wrapper.in $(DISTDIR)
        cp $(WXDIR)/version-script.in $(DISTDIR)
        cp $(WXDIR)/setup.h.in $(DISTDIR)
        cp $(WXDIR)/setup.h_vms $(DISTDIR)
index e833be05a1c739ff5ba4e229eb491456032fb910..0f19679ac7c271f84e95b72e57d91575c8ab5343 100644 (file)
@@ -77,6 +77,7 @@ ALL_DIST: distrib_clean
        cp $(WXDIR)/install-sh $(DISTDIR)
        cp $(WXDIR)/mkinstalldirs $(DISTDIR)
        cp $(WXDIR)/wx-config.in $(DISTDIR)
+       cp $(WXDIR)/wx-config-wrapper.in $(DISTDIR)
        cp $(WXDIR)/version-script.in $(DISTDIR)
        cp $(WXDIR)/setup.h.in $(DISTDIR)
        cp $(WXDIR)/setup.h_vms $(DISTDIR)
index c85d937d961c761760565aafc60be015304c4190..8e517de8d63bfa1725c120d085b81373076e81fd 100644 (file)
             <dependency-of>install</dependency-of>
             <command>
                 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-                $(INSTALL_PROGRAM) wx$(TOOLCHAIN_NAME)-config $(DESTDIR)$(BINDIR)
-                (cd $(DESTDIR)$(BINDIR) &amp;&amp; rm -f wx-config &amp;&amp; $(LN_S) wx$(TOOLCHAIN_NAME)-config wx-config)
+                $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/wx/config
+                $(INSTALL_PROGRAM) lib/wx/config/$(TOOLCHAIN_NAME) $(DESTDIR)$(LIBDIR)/wx/config
+                $(INSTALL_PROGRAM) wx-config $(DESTDIR)$(BINDIR)
+                (cd $(DESTDIR)$(BINDIR) &amp;&amp; rm -f wx$(TOOLCHAIN_NAME)-config &amp;&amp; $(LN_S) wx-config wx$(TOOLCHAIN_NAME)-config)
             </command>
         </action>
 
index ee76cc8a71ae04fb5b55364c32c526ac7ba1144a..d5a0eb60e3842b617e8442822257faaee86679d4 100755 (executable)
--- a/configure
+++ b/configure
@@ -41060,7 +41060,7 @@ fi
           ac_config_headers="$ac_config_headers setup.h"
 
 
-                              ac_config_files="$ac_config_files wx-config version-script Makefile"
+                                        ac_config_files="$ac_config_files wx-config wx-config-wrapper version-script Makefile"
 
 
           ac_config_commands="$ac_config_commands default"
@@ -41771,6 +41771,7 @@ do
   case "$ac_config_target" in
   # Handling of arguments.
   "wx-config" ) CONFIG_FILES="$CONFIG_FILES wx-config" ;;
+  "wx-config-wrapper" ) CONFIG_FILES="$CONFIG_FILES wx-config-wrapper" ;;
   "version-script" ) CONFIG_FILES="$CONFIG_FILES version-script" ;;
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "$mk" ) CONFIG_FILES="$CONFIG_FILES $mk" ;;
@@ -42752,18 +42753,15 @@ esac
 echo "$as_me: executing $ac_dest commands" >&6;}
   case $ac_dest in
     default )
-                                                                                                if test ! -h wx-config; then
-                chmod +x wx-config
-                mv wx-config wx${TOOLCHAIN_NAME}-config
-                ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
-            fi
-
             if test ! -d lib; then
               mkdir lib
             fi
             if test ! -d lib/wx; then
               mkdir lib/wx
             fi
+            if test ! -d lib/wx/config; then
+              mkdir lib/wx/config
+            fi
             if test ! -d lib/wx/include; then
               mkdir lib/wx/include
             fi
@@ -42776,6 +42774,18 @@ echo "$as_me: executing $ac_dest commands" >&6;}
             if test -f setup.h; then
               mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
             fi
+
+            if test -f wx-config; then
+                chmod +x wx-config
+                mv -f wx-config lib/wx/config/${TOOLCHAIN_NAME}
+                rm -f wx${TOOLCHAIN_NAME}-config
+                ${LN_S} wx-config wx${TOOLCHAIN_NAME}-config
+            fi
+
+            if test -f wx-config-wrapper; then
+                chmod +x wx-config-wrapper
+                mv -f wx-config-wrapper wx-config
+            fi
            ;;
   esac
 done
index c952639b43743e0c5e825f2221400f01cb776133..ace3f1074a6298592de7c68e2e448272be168931 100644 (file)
@@ -6239,31 +6239,22 @@ dnl (the original file name may be overriden by appending another name after a
 dnl colon)
 AC_CONFIG_FILES([
             wx-config
+            wx-config-wrapper
             version-script
             Makefile
           ])
 
 AC_CONFIG_COMMANDS([default],
           [
-            dnl This test is required to make the following idempotent.
-            dnl Otherwise running config.status or rerunning configure
-            dnl would stomp the wx-config link or try to move it onto
-            dnl itself.
-            dnl Use -h instead of -L to test for link (GD)
-            dnl   -h is documented as obsolete under Mac OS X but works
-            dnl   -L is obsolete under Solaris8
-            if test ! -h wx-config; then
-                chmod +x wx-config
-                mv wx-config wx${TOOLCHAIN_NAME}-config
-                ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
-            fi
-
             if test ! -d lib; then
               mkdir lib
             fi
             if test ! -d lib/wx; then
               mkdir lib/wx
             fi
+            if test ! -d lib/wx/config; then
+              mkdir lib/wx/config
+            fi
             if test ! -d lib/wx/include; then
               mkdir lib/wx/include
             fi
@@ -6276,6 +6267,18 @@ AC_CONFIG_COMMANDS([default],
             if test -f setup.h; then
               mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
             fi
+            
+            if test -f wx-config; then
+                chmod +x wx-config
+                mv -f wx-config lib/wx/config/${TOOLCHAIN_NAME}
+                rm -f wx${TOOLCHAIN_NAME}-config
+                ${LN_S} wx-config wx${TOOLCHAIN_NAME}-config
+            fi
+            
+            if test -f wx-config-wrapper; then
+                chmod +x wx-config-wrapper
+                mv -f wx-config-wrapper wx-config
+            fi
           ],
           [
             TOOLCHAIN_NAME="${TOOLCHAIN_NAME}"
index edae6b67be3db3f1b9b5edf58be069e4acf265f2..2b8bf2bd606fabc8dd4378ad8d625719e28e8882 100644 (file)
@@ -221,6 +221,8 @@ Unix:
 
 - wxTaskBarIcon now supports freedesktop.org System Tray protocol
 - security fixes to wxSingleInstanceChecker
+- wx-config script was modified to allow choosing from multiple installed
+  builds of wxWidgets
 
 wxGTK:
 
diff --git a/wx-config-wrapper.in b/wx-config-wrapper.in
new file mode 100755 (executable)
index 0000000..5fc351c
--- /dev/null
@@ -0,0 +1,180 @@
+#!/bin/sh
+
+# -------------------------------------------------------------------------
+# Location of wx:
+# -------------------------------------------------------------------------
+
+update_prefixes()
+{
+    includedir="@includedir@"
+    libdir="@libdir@"
+}
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+update_prefixes
+
+srcdir="@top_srcdir@"
+builddir="@top_builddir_wxconfig@"
+
+
+# -------------------------------------------------------------------------
+# Wrapper script:
+# -------------------------------------------------------------------------
+
+exec_prefix_set=no
+
+# return the absolute path prepending builddir to it if needed
+makeabs()
+{
+    path=$1
+    # TODO: this only works under Unix and even there it could be
+    #       enhanced to remove ".." and "."
+    if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
+        if [ $path = "." ]; then
+            path=$builddir
+        else
+            path="$builddir/$path"
+        fi
+    fi
+
+    echo $path
+}
+
+# these determine wx-config script to use:
+m_toolkit='*'
+m_univ='*'
+m_unicode='*'
+m_debug='*'
+m_version='*.*'
+
+# lists all wx-config scripts that match criteria specified above
+list_wx_config_scripts()
+{
+    mask="${m_toolkit}${m_univ}${m_unicode}${m_debug}-${m_version}"
+        
+    # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
+    # try to extract the mask from it:
+    myname=`basename $0`
+    if test $myname != wx-config ; then
+        toolchain=`echo $myname | sed 's/wx\(.*\)-config/\1/'`
+        if test -f ${libdir}/wx/config/${toolchain} ; then
+            mask=$toolchain
+        fi
+    fi
+
+    if test -d ${libdir}/wx/config ; then
+        (cd ${libdir}/wx/config/ && ls -1 $mask 2>/dev/null)
+    fi
+}
+
+# find first wx-config script that matches criteria
+find_wx_config_script()
+{
+    all_scripts=`list_wx_config_scripts`
+    # unless wxBase was explicitly requested, try to find a GUI version:
+    if test "$m_toolkit" != "base" ; then
+        script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
+        if test "x$script" != "x" ; then
+            echo ${libdir}/wx/config/${script}
+        fi
+    fi
+   
+    # otherwise (or if no GUI script was found), use alphabetically 1st script:
+    script=`echo $all_scripts | head -n 1`
+    if test -z "$script" ; then
+        echo "no suitable wx-config script found" >&2
+        exit 1
+    fi
+    echo ${libdir}/wx/config/${script}
+}
+
+
+# handle options:
+# arguments to pass to the real wx-config script:
+args=""
+
+for i in $*; do
+    case "$i" in
+        -*=*) optarg=`echo "$i" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+        *) optarg= ;;
+    esac
+
+    case $i in
+        --inplace)
+            prefix=`makeabs $srcdir`
+            exec_prefix=`makeabs $builddir`
+            exec_prefix_set=yes
+            update_prefixes
+            args="$args --inplace"
+            ;;
+        --prefix=*)
+            prefix=$optarg
+            if test $exec_prefix_set = no ; then
+                exec_prefix=$optarg
+            fi
+            update_prefixes
+            ;;
+        --exec-prefix=*)
+            exec_prefix=$optarg
+            exec_prefix_set=yes
+            update_prefixes
+            ;;
+
+        --list)
+            # list available wx versions:
+            list_wx_config_scripts
+            exit
+            ;;
+
+        --toolkit=*)
+            m_toolkit=$optarg
+            ;;
+        --version=*)
+            m_version=$optarg
+            ;;
+        --unicode=*)
+            if test "x$optarg" = "xyes" ; then
+                m_unicode="u"
+            else
+                m_unicode=""
+            fi
+            ;;
+        --unicode)
+            m_unicode="u"
+            ;;
+        --debug=*)
+            if test "x$optarg" = "xyes" ; then
+                m_debug="d"
+            else
+                m_debug=""
+            fi
+            ;;
+        --debug)
+            m_debug="d"
+            ;;
+        --universal=*)
+            if test "x$optarg" = "xyes" ; then
+                m_univ="univ"
+            else
+                m_univ=""
+            fi
+            ;;
+        --universal)
+            m_univ="univ"
+            ;;
+        *)
+            args="$args $i"
+            ;;
+    esac
+done
+
+args="$args --prefix=$prefix --exec-prefix=$exec_prefix"
+
+script=`find_wx_config_script`;
+if test "x$script" != "x" ; then
+    $script $args
+    exit $?
+else
+    exit 1
+fi
index 3977e1037a12829e78c77a8a4e859f90cc49b379..579bcf0d63e16664c0a279fee5e1be39e0b937ec 100755 (executable)
@@ -144,29 +144,13 @@ get_ldflags_gui()
     echo $flags_to_ret
 }
 
-# return the absolute path prepending builddir to it if needed
-makeabs()
-{
-    path=$1
-    # TODO: this only works under Unix and even there it could be
-    #       enhanced to remove ".." and "."
-    if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
-        if [ $path = "." ]; then
-            path=$builddir
-        else
-            path="$builddir/$path"
-        fi
-    fi
-
-    echo $path
-}
-
 usage()
 {
     cat <<EOF
 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--inplace]
-                 [--version] [--release]
-                 [--basename] [--static] [--libs] [--gl-libs]
+                 [--toolkit=TOOLKIT] [--unicode[=yes|no]] [--debug[=yes|no]]
+                 [--universal[=yes|no]] [--version[=VERSION]] [--release]
+                 [--list] [--basename] [--static] [--libs] [--gl-libs]
                  [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
                  [--cc] [--cxx] [--ld] [LIBRARIES]
 
@@ -197,6 +181,11 @@ in by default.
 
 --gl-libs option is deprecated, use "--libs gl" instead.
 
+If there are several different builds of wxWidgets installed in same prefix,
+you can use --toolkit, --unicode, --debug, --universal and --version options
+to select one of them. Use --list option to show all available builds that
+match given criteria.
+
 EOF
 
     exit $1
@@ -305,11 +294,7 @@ while test $# -gt 0; do
 
   case $1 in
     --inplace)
-      prefix=`makeabs $srcdir`
-      exec_prefix=`makeabs $builddir`
-      exec_prefix_set=yes
       inplace_flag=yes
-      update_prefixes
       ;;
     --prefix=*)
       prefix=$optarg
index 299bb376b3ae905b04e2809f4419c58ad055465e..d0415b928402afcbabb6ef5006b2b819e0c491c9 100644 (file)
--- a/wxwin.m4
+++ b/wxwin.m4
@@ -53,7 +53,7 @@ AC_DEFUN([AM_OPTIONS_WXCONFIG],
 
 dnl ---------------------------------------------------------------------------
 dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl                  [, WX-LIBS]]])
+dnl                  [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
 dnl
 dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
 dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
@@ -61,13 +61,18 @@ dnl environment variable to override the default name of the wx-config script
 dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
 dnl case the macro won't even waste time on tests for its existence.
 dnl
-dnl Optional WX-LIBS argument contains comma-separated list of wxWindows
-dnl libraries to link against (it may include contrib libraries). If it is not
-dnl specified then WX_LIBS and WX_LIBS_STATIC will contain flags to link
-dnl with all of the core wxWindows libraries.
+dnl Optional WX-LIBS argument contains comma- or space-separated list of
+dnl wxWindows libraries to link against (it may include contrib libraries). If
+dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
+dnl link with all of the core wxWindows libraries.
+dnl
+dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
+dnl invocation command in present. It can be used to fine-tune lookup of
+dnl best wxWidgets build available.
 dnl
 dnl Example use:
-dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net])
+dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
+dnl                    [--unicode --debug])
 dnl ---------------------------------------------------------------------------
 
 dnl
@@ -94,10 +99,6 @@ AC_DEFUN([AM_PATH_WXCONFIG],
      WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
   fi
 
-  if test "x$4" != "x" ; then
-     wx_config_args="$wx_config_args $4"
-  fi
-
   dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
   if test -x "$WX_CONFIG_NAME" ; then
      AC_MSG_CHECKING(for wx-config)
@@ -112,11 +113,15 @@ AC_DEFUN([AM_PATH_WXCONFIG],
     no_wx=""
 
     min_wx_version=ifelse([$1], ,2.2.1,$1)
-    AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
+    if test -z "$5" ; then
+      AC_MSG_CHECKING([for wxWindows version >= $min_wx_version])
+    else
+      AC_MSG_CHECKING([for wxWindows version >= $min_wx_version ($5)])
+    fi
 
-    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
+    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
 
-    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
+    WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
     wx_config_major_version=`echo $WX_VERSION | \
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
     wx_config_minor_version=`echo $WX_VERSION | \
@@ -132,28 +137,29 @@ AC_DEFUN([AM_PATH_WXCONFIG],
            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
     wx_ver_ok=""
-    if test $wx_config_major_version -gt $wx_requested_major_version; then
-      wx_ver_ok=yes
-    else
-      if test $wx_config_major_version -eq $wx_requested_major_version; then
-         if test $wx_config_minor_version -gt $wx_requested_minor_version; then
-            wx_ver_ok=yes
-         else
-            if test $wx_config_minor_version -eq $wx_requested_minor_version; then
-               if test $wx_config_micro_version -ge $wx_requested_micro_version; then
-                  wx_ver_ok=yes
-               fi
-            fi
-         fi
+    if test "x$WX_VERSION" != x ; then
+      if test $wx_config_major_version -gt $wx_requested_major_version; then
+        wx_ver_ok=yes
+      else
+        if test $wx_config_major_version -eq $wx_requested_major_version; then
+           if test $wx_config_minor_version -gt $wx_requested_minor_version; then
+              wx_ver_ok=yes
+           else
+              if test $wx_config_minor_version -eq $wx_requested_minor_version; then
+                 if test $wx_config_micro_version -ge $wx_requested_micro_version; then
+                    wx_ver_ok=yes
+                 fi
+              fi
+           fi
+        fi
       fi
     fi
 
     if test "x$wx_ver_ok" = x ; then
       no_wx=yes
     else
-      wx_libs_arg="--libs"
-      WX_LIBS=`$WX_CONFIG_WITH_ARGS $wx_libs_arg`
-      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static $wx_libs_arg`
+      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
+      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
 
       dnl starting with version 2.2.6 wx-config has --cppflags argument
       wx_has_cppflags=""