]> git.saurik.com Git - wxWidgets.git/blobdiff - wx-config-wrapper.in
fixed memory leak
[wxWidgets.git] / wx-config-wrapper.in
index 5fc351ca02224c614920cc73a37b356021aeb454..0a69fe6cde17404450afb2a0265cb36387c44846 100755 (executable)
@@ -41,17 +41,18 @@ makeabs()
 }
 
 # these determine wx-config script to use:
 }
 
 # these determine wx-config script to use:
-m_toolkit='*'
-m_univ='*'
-m_unicode='*'
-m_debug='*'
-m_version='*.*'
+m_toolkit='.*'
+m_univ='\(univ\)\?'
+m_unicode='\(unicode\|ansi\)'
+m_debug='\(debug\|release\)'
+m_version='[0-9]\+\.[0-9]\+'
+m_host=''
 
 # lists all wx-config scripts that match criteria specified above
 list_wx_config_scripts()
 {
 
 # 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}"
-        
+    mask="^${m_toolkit}${m_univ}-${m_unicode}-${m_debug}-${m_version}${m_host}$"
+
     # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
     # try to extract the mask from it:
     myname=`basename $0`
     # if wx-config was called via wx$TOOLCHAIN_NAME-config symlink,
     # try to extract the mask from it:
     myname=`basename $0`
@@ -63,7 +64,7 @@ list_wx_config_scripts()
     fi
 
     if test -d ${libdir}/wx/config ; then
     fi
 
     if test -d ${libdir}/wx/config ; then
-        (cd ${libdir}/wx/config/ && ls -1 $mask 2>/dev/null)
+        (cd ${libdir}/wx/config/ && ls -1 | grep "$mask" 2>/dev/null)
     fi
 }
 
     fi
 }
 
@@ -76,6 +77,7 @@ find_wx_config_script()
         script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
         if test "x$script" != "x" ; then
             echo ${libdir}/wx/config/${script}
         script=`echo $all_scripts | tr ' ' '\n' | grep -v '^base' | head -n 1`
         if test "x$script" != "x" ; then
             echo ${libdir}/wx/config/${script}
+           exit 0
         fi
     fi
    
         fi
     fi
    
@@ -135,23 +137,23 @@ for i in $*; do
             ;;
         --unicode=*)
             if test "x$optarg" = "xyes" ; then
             ;;
         --unicode=*)
             if test "x$optarg" = "xyes" ; then
-                m_unicode="u"
+                m_unicode="unicode"
             else
             else
-                m_unicode=""
+                m_unicode="ansi"
             fi
             ;;
         --unicode)
             fi
             ;;
         --unicode)
-            m_unicode="u"
+            m_unicode="unicode"
             ;;
         --debug=*)
             if test "x$optarg" = "xyes" ; then
             ;;
         --debug=*)
             if test "x$optarg" = "xyes" ; then
-                m_debug="d"
+                m_debug="debug"
             else
             else
-                m_debug=""
+                m_debug="release"
             fi
             ;;
         --debug)
             fi
             ;;
         --debug)
-            m_debug="d"
+            m_debug="debug"
             ;;
         --universal=*)
             if test "x$optarg" = "xyes" ; then
             ;;
         --universal=*)
             if test "x$optarg" = "xyes" ; then
@@ -163,13 +165,16 @@ for i in $*; do
         --universal)
             m_univ="univ"
             ;;
         --universal)
             m_univ="univ"
             ;;
+        --host=*)
+            m_host="-$optarg"
+            ;;
         *)
             args="$args $i"
             ;;
     esac
 done
 
         *)
             args="$args $i"
             ;;
     esac
 done
 
-args="$args --prefix=$prefix --exec-prefix=$exec_prefix"
+args="--prefix=$prefix --exec-prefix=$exec_prefix $args"
 
 script=`find_wx_config_script`;
 if test "x$script" != "x" ; then
 
 script=`find_wx_config_script`;
 if test "x$script" != "x" ; then