]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/wxpresets/presets/wx_unix.bkl
d08f13e52d49ad050e692b4aa4dee4231da14849
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx_unix.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <!--
5 Presents for building wxWidgets applications using Autoconf or GNU toosets.
6 See wx.bkl for platform-independent notes.
7
8 Usage:
9 Options WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS are defined.
10
11
12 Format-specific notes:
13
14 * autoconf:
15 Beware that you have to use AM_OPTIONS_WXCONFIG and
16 AM_PATH_WXCONFIG in your configure.in!
17
18 -->
19
20
21 <makefile>
22
23 <!-- ============================================================== -->
24 <!-- Autoconf -->
25 <!-- ============================================================== -->
26
27 <if cond="FORMAT=='autoconf'">
28 <!-- Autoconf backend is simplicity itself thanks to wx-config... -->
29 <option name="WX_CFLAGS"/>
30 <option name="WX_CXXFLAGS"/>
31 <option name="WX_CPPFLAGS"/>
32 <option name="WX_LIBS"/>
33 <option name="WX_RESCOMP"/>
34 </if>
35
36 <!-- ============================================================== -->
37 <!-- GNU makefiles for Unix -->
38 <!-- ============================================================== -->
39
40 <if cond="FORMAT=='gnu'">
41 <set var="WX_CONFIG_DEFAULT" overwrite="0">wx-config</set>
42 <option name="WX_CONFIG">
43 <default-value>$(WX_CONFIG_DEFAULT)</default-value>
44 <description>Location and arguments of wx-config script</description>
45 </option>
46 <option name="WX_CFLAGS">
47 <default-value>`$(DOLLAR)(WX_CONFIG) --cflags`</default-value>
48 <description>C flags to use with wxWidgets code</description>
49 </option>
50 <option name="WX_CXXFLAGS">
51 <default-value>`$(DOLLAR)(WX_CONFIG) --cxxflags`</default-value>
52 <description>C++ flags to use with wxWidgets code</description>
53 </option>
54 <option name="WX_CPPFLAGS">
55 <default-value>`$(DOLLAR)(WX_CONFIG) --cppflags`</default-value>
56 <description>C preprocessor flags to use with wxWidgets code</description>
57 </option>
58 <option name="WX_LIBS">
59 <default-value>`$(DOLLAR)(WX_CONFIG) --libs`</default-value>
60 <description>wxWidgets libraries to link against</description>
61 </option>
62 <option name="WX_RESCOMP">
63 <default-value>`$(DOLLAR)(WX_CONFIG) --rescomp`</default-value>
64 <description>wxWidgets resource compiler and flags</description>
65 </option>
66
67 <!-- we need this but the trick used in default-values above
68 prevents bakefile from detecting it: -->
69 <set var="FORMAT_OUTPUT_VARIABLES" append="1">WX_CONFIG</set>
70 </if>
71
72 <!-- ============================================================== -->
73 <!-- Common code -->
74 <!-- ============================================================== -->
75
76 <if cond="FORMAT not in ['gnu','autoconf']">
77 <error>
78 Don't include presets/wx_unix.bkl directly, use presets/wx.bkl.
79 </error>
80 </if>
81
82 <!--
83 We need to re-define the resource compiler, used by bakefile when compiling
84 resources, to the resource compiler returned by 'wx-config &#45;-rescomp' since
85 'wx-config &#45;-rescomp' returns both the name of the resource compiler to use
86 and the flags required for that compiler (rcflags are rccompiler-specific
87 and thus it would be wrong to use them with other resource compilers).
88
89 This line typically does something *only* when the Makefile.in generated
90 using this bakefile, is used on Windows with MSYS (when using Cygwin, resources
91 are not compiled at all).
92
93 NOTE: overwriting the RESCOMP variable we modify the entire Bakefile behaviour
94 for resource compilation; this could be a problem if the bakefile which
95 includes this file needs the standard Bakefile resource compiler to
96 build a non wx-based application.
97 -->
98 <set var="RESCOMP">$(WX_RESCOMP)</set>
99
100 <template id="wx-lib">
101 <cxxflags>$(WX_CXXFLAGS)</cxxflags>
102 <cflags>$(WX_CFLAGS)</cflags>
103 </template>
104
105 <template id="wx" template="wx-lib">
106 <!--
107 Don't include the $(WX_LIBS) variable in linker options here since
108 it would make impossible for the user to obtain the right library
109 order when he needs to specify, *before* WX_LIBS, its own libraries
110 that depend on wxWidgets libraries; to avoid this, we include
111 $(WX_LIBS) as soon as we found the <wx-lib>base</wx-lib> tag which
112 the user should always put *after* all other wx-dependent libraries
113 -->
114 </template>
115
116 <!-- not used together with wx-config: -->
117 <define-tag name="wx-lib" rules="exe,dll,module">
118 <if cond="value=='base'">
119 <ldlibs>$(WX_LIBS)</ldlibs>
120 </if>
121 </define-tag>
122
123 </makefile>