]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1372332 ] Support for WX_RESCOMP to allow MSYS+wx-config to work
authorJulian Smart <julian@anthemion.co.uk>
Sat, 11 Mar 2006 14:51:45 +0000 (14:51 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 11 Mar 2006 14:51:45 +0000 (14:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/wxpresets/presets/wx_unix.bkl
wxwin.m4

index f9a69b8815112031bc7d7dab9ba9cc887df2936b..21c0fad580f50f61828b8d71649e3d9499436c74 100644 (file)
@@ -30,6 +30,7 @@ Format-specific notes:
         <option name="WX_CXXFLAGS"/>
         <option name="WX_CPPFLAGS"/>
         <option name="WX_LIBS"/>
+        <option name="WX_RESCOMP"/>
     </if>
 
     <!-- ============================================================== -->
@@ -57,6 +58,10 @@ Format-specific notes:
             <default-value>`$(DOLLAR)(WX_CONFIG) --libs`</default-value>
             <description>wxWidgets libraries to link against</description>
         </option>
+        <option name="WX_RESCOMP">
+            <default-value>`$(DOLLAR)(WX_CONFIG) --rescomp`</default-value>
+            <description>wxWidgets resource compiler and flags</description>
+        </option>
 
         <!-- we need this but the trick used in default-values above
              prevents bakefile from detecting it: -->
@@ -73,6 +78,24 @@ Format-specific notes:
         </error>
     </if>
 
+    <!--
+         We need to re-define the resource compiler, used by bakefile when compiling
+         resources, to the resource compiler returned by 'wx-config --rescomp' since
+         'wx-config --rescomp' returns both the name of the resource compiler to use
+         and the flags required for that compiler (rcflags are rccompiler-specific
+         and thus it would be wrong to use them with other resource compilers).
+
+         This line typically does something *only* when the Makefile.in generated
+         using this bakefile, is used on Windows with MSYS (when using Cygwin, resources
+         are not compiled at all).
+
+         NOTE: overwriting the RESCOMP variable we modify the entire Bakefile behaviour
+               for resource compilation; this could be a problem if the bakefile which
+               includes this file needs the standard Bakefile resource compiler to
+               build a non wx-based application.
+    -->
+    <set var="RESCOMP">$(WX_RESCOMP)</set>
+
     <template id="wx-lib">
         <cxxflags>$(WX_CXXFLAGS)</cxxflags>
         <cflags>$(WX_CFLAGS)</cflags>
index 24c258a24c48d6f590a92facebba1297d38f70ce..9b0eaccf2ec77de96f2a14b0a93b36fa58c24afd 100644 (file)
--- a/wxwin.m4
+++ b/wxwin.m4
@@ -201,6 +201,24 @@ AC_DEFUN([AM_PATH_WXCONFIG],
         fi
       fi
 
+      dnl starting with version 2.7.0 wx-config has --rescomp option
+      wx_has_rescomp=""
+      if test $wx_config_major_version -gt 2; then
+        wx_has_rescomp=yes
+      else
+        if test $wx_config_major_version -eq 2; then
+           if test $wx_config_minor_version -ge 7; then
+              wx_has_rescomp=yes
+           fi
+        fi
+      fi
+      if test "x$wx_has_rescomp" = x ; then
+         dnl cannot give any useful info for resource compiler
+         WX_RESCOMP=
+      else
+         WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
+      fi
+
       if test "x$wx_has_cppflags" = x ; then
          dnl no choice but to define all flags like CFLAGS
          WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
@@ -235,6 +253,7 @@ AC_DEFUN([AM_PATH_WXCONFIG],
        WX_CXXFLAGS=""
        WX_LIBS=""
        WX_LIBS_STATIC=""
+       WX_RESCOMP=""
        ifelse([$3], , :, [$3])
 
     fi
@@ -245,6 +264,8 @@ AC_DEFUN([AM_PATH_WXCONFIG],
     WX_CXXFLAGS=""
     WX_LIBS=""
     WX_LIBS_STATIC=""
+    WX_RESCOMP=""
+
     ifelse([$3], , :, [$3])
 
   fi
@@ -257,6 +278,7 @@ AC_DEFUN([AM_PATH_WXCONFIG],
   AC_SUBST(WX_LIBS)
   AC_SUBST(WX_LIBS_STATIC)
   AC_SUBST(WX_VERSION)
+  AC_SUBST(WX_RESCOMP)
 ])
 
 dnl ---------------------------------------------------------------------------