]> git.saurik.com Git - wxWidgets.git/blobdiff - build/bakefiles/wxpresets/presets/wx_unix.bkl
'configtool' removal.
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx_unix.bkl
index f9a69b8815112031bc7d7dab9ba9cc887df2936b..fca2c126c6f1f3d5e02dff4a552caeb210b898bc 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>
 
     <!-- ============================================================== -->
@@ -37,8 +38,9 @@ Format-specific notes:
     <!-- ============================================================== -->
 
     <if cond="FORMAT=='gnu'">
+        <set var="WX_CONFIG_DEFAULT" overwrite="0">wx-config</set>
         <option name="WX_CONFIG">
-            <default-value>wx-config</default-value>
+            <default-value>$(WX_CONFIG_DEFAULT)</default-value>
             <description>Location and arguments of wx-config script</description>
         </option>
         <option name="WX_CFLAGS">
@@ -53,9 +55,9 @@ Format-specific notes:
             <default-value>`$(DOLLAR)(WX_CONFIG) --cppflags`</default-value>
             <description>C preprocessor flags to use with wxWidgets code</description>
         </option>
-        <option name="WX_LIBS">
-            <default-value>`$(DOLLAR)(WX_CONFIG) --libs`</default-value>
-            <description>wxWidgets libraries to link against</description>
+        <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
@@ -73,6 +75,25 @@ Format-specific notes:
         </error>
     </if>
 
+    <!--
+         We need to re-define the WINDRES resource compiler name to the resource compiler
+         returned by 'wx-config - -rescomp' since this option returns both the name of the
+         resource compiler to use (windres) and the flags required for that compiler.
+
+         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).
+         Without this line, in fact, when compiling with MSYS on Windows, the - -include-dir
+         option which tells windres to look in wxWidgets\include folder would be missing and
+         then windres would fail to find the wxMSW resources.
+
+         NOTE: overwriting the WINDRES variable we add wxWidgets resource flags to
+               all targets which include this bakefile; this could be useless to those
+               targets which are not wx-based eventually present in that bakefile but
+               in any case it shouldn't do any harm.
+    -->
+    <set var="WINDRES">$(WX_RESCOMP)</set>
+
     <template id="wx-lib">
         <cxxflags>$(WX_CXXFLAGS)</cxxflags>
         <cflags>$(WX_CFLAGS)</cflags>
@@ -89,11 +110,27 @@ Format-specific notes:
         -->
     </template>
 
-    <!-- not used together with wx-config: -->
+    <!-- VERY IMPORTANT: <wx-lib>base</wx-lib> must be the last wx-lib tag
+                         in all your bakefiles !!
+    -->
     <define-tag name="wx-lib" rules="exe,dll,module">
-        <if cond="value=='base'">
+        <if cond="FORMAT=='autoconf' and value=='base'">
+            <!-- all wx-dependent libraries should have been already listed
+                 thus we can now add WX_LIBS to the linker line -->
             <ldlibs>$(WX_LIBS)</ldlibs>
         </if>
+        <if cond="FORMAT=='gnu' and value=='base'">
+            <!-- all wx libraries should have been already specified, thus
+                  $(__liblist) should contain the full list... -->
+            <set var="__liblist" append="1">base</set>
+            <ldlibs>`$(WX_CONFIG) --libs $(','.join(__liblist.split()))`</ldlibs>
+        </if>
+        <if cond="FORMAT=='gnu' and value!='base'">
+            <set var="__liblist" append="1">$(value)</set>
+        </if>
+        <if cond="value not in ALLLIB_LIST.split()">
+            <error>Unknown wxWidgets library given in the wx-lib tag</error>
+        </if>
     </define-tag>
 
 </makefile>