5 Presents for building wxWidgets applications using Autoconf or GNU toosets.
6 See wx.bkl for platform-independent notes.
9 Options WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS are defined.
12 Format-specific notes:
15 Beware that you have to use AM_OPTIONS_WXCONFIG and
16 AM_PATH_WXCONFIG in your configure.in!
23 <!-- ============================================================== -->
25 <!-- ============================================================== -->
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"/>
36 <!-- ============================================================== -->
37 <!-- GNU makefiles for Unix -->
38 <!-- ============================================================== -->
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>
46 <option name=
"WX_CFLAGS">
47 <default-value>`$(DOLLAR)(WX_CONFIG) --cflags`
</default-value>
48 <description>C flags to use with wxWidgets code
</description>
50 <option name=
"WX_CXXFLAGS">
51 <default-value>`$(DOLLAR)(WX_CONFIG) --cxxflags`
</default-value>
52 <description>C++ flags to use with wxWidgets code
</description>
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>
58 <option name=
"WX_RESCOMP">
59 <default-value>`$(DOLLAR)(WX_CONFIG) --rescomp`
</default-value>
60 <description>wxWidgets resource compiler and flags
</description>
63 <!-- we need this but the trick used in default-values above
64 prevents bakefile from detecting it: -->
65 <set var=
"FORMAT_OUTPUT_VARIABLES" append=
"1">WX_CONFIG
</set>
68 <!-- ============================================================== -->
70 <!-- ============================================================== -->
72 <if cond=
"FORMAT not in ['gnu','autoconf']">
74 Don't include presets/wx_unix.bkl directly, use presets/wx.bkl.
79 We need to re-define the resource compiler, used by bakefile when compiling
80 resources, to the resource compiler returned by 'wx-config --rescomp' since
81 'wx-config --rescomp' returns both the name of the resource compiler to use
82 and the flags required for that compiler (rcflags are rccompiler-specific
83 and thus it would be wrong to use them with other resource compilers).
85 This line typically does something *only* when the Makefile.in generated
86 using this bakefile, is used on Windows with MSYS (when using Cygwin, resources
87 are not compiled at all).
89 NOTE: overwriting the RESCOMP variable we modify the entire Bakefile behaviour
90 for resource compilation; this could be a problem if the bakefile which
91 includes this file needs the standard Bakefile resource compiler to
92 build a non wx-based application.
94 <set var=
"RESCOMP">$(WX_RESCOMP)
</set>
96 <template id=
"wx-lib">
97 <cxxflags>$(WX_CXXFLAGS)
</cxxflags>
98 <cflags>$(WX_CFLAGS)
</cflags>
101 <template id=
"wx" template=
"wx-lib">
103 Don't include the $(WX_LIBS) variable in linker options here since
104 it would make impossible for the user to obtain the right library
105 order when he needs to specify, *before* WX_LIBS, its own libraries
106 that depend on wxWidgets libraries; to avoid this, we include
107 $(WX_LIBS) as soon as we found the <wx-lib>base</wx-lib> tag which
108 the user should always put *after* all other wx-dependent libraries
112 <!-- VERY IMPORTANT: <wx-lib>base</wx-lib> must be the last wx-lib tag
113 in all your bakefiles !!
115 <define-tag name=
"wx-lib" rules=
"exe,dll,module">
116 <if cond=
"FORMAT=='autoconf' and value=='base'">
117 <!-- all wx-dependent libraries should have been already listed
118 thus we can now add WX_LIBS to the linker line -->
119 <ldlibs>$(WX_LIBS)
</ldlibs>
121 <if cond=
"FORMAT=='gnu' and value=='base'">
122 <!-- all wx libraries should have been already specified, thus
123 $(__liblist) should contain the full list... -->
124 <set var=
"__liblist" append=
"1">base
</set>
125 <ldlibs>`$(WX_CONFIG) --libs $(','.join(__liblist.split()))`
</ldlibs>
127 <if cond=
"FORMAT=='gnu' and value!='base'">
128 <set var=
"__liblist" append=
"1">$(value)
</set>
130 <if cond=
"value not in ALLLIB_LIST.split()">
131 <error>Unknown wxWidgets library given in the wx-lib tag
</error>