2005-01-27 17:47:37 -05:00
|
|
|
<?xml version="1.0" ?>
|
|
|
|
<!-- $Id$ -->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Presents for building wxWidgets applications using Autoconf or GNU toosets.
|
|
|
|
See wx.bkl for platform-independent notes.
|
|
|
|
|
|
|
|
Format-specific notes:
|
|
|
|
|
|
|
|
* autoconf:
|
2007-11-13 16:10:26 -05:00
|
|
|
Beware that you have to use WX_CONFIG_OPTIONS and
|
|
|
|
WX_CONFIG_CHECK in your configure.in to get at least the
|
2007-02-04 20:15:02 -05:00
|
|
|
WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS option values defined.
|
2007-11-13 16:10:26 -05:00
|
|
|
|
2007-02-04 20:15:02 -05:00
|
|
|
To detect the WX_* option values typically you also want to use
|
2007-11-13 16:10:26 -05:00
|
|
|
the WX_STANDARD_OPTIONS, WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS,
|
|
|
|
WX_CONFIG_CHECK and finally WX_DETECT_STANDARD_OPTION_VALUES macros
|
|
|
|
(see wxwin.m4 for more info).
|
2005-01-27 17:47:37 -05:00
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
|
|
<makefile>
|
|
|
|
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
|
2005-01-27 17:47:37 -05:00
|
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- Autoconf -->
|
|
|
|
<!-- ============================================================== -->
|
2005-09-25 07:21:48 -04:00
|
|
|
|
2005-01-27 17:47:37 -05:00
|
|
|
<if cond="FORMAT=='autoconf'">
|
|
|
|
<option name="WX_CFLAGS"/>
|
|
|
|
<option name="WX_CXXFLAGS"/>
|
|
|
|
<option name="WX_CPPFLAGS"/>
|
|
|
|
<option name="WX_LIBS"/>
|
2006-03-11 09:51:45 -05:00
|
|
|
<option name="WX_RESCOMP"/>
|
2007-02-04 20:15:02 -05:00
|
|
|
<option name="WX_VERSION_MAJOR"/>
|
|
|
|
<option name="WX_VERSION_MINOR"/>
|
2007-03-10 12:30:31 -05:00
|
|
|
<option name="WX_PORT"/>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
2007-03-10 12:30:31 -05:00
|
|
|
<!-- wxwin.m4 macros will detect all WX_* options defined above -->
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!-- 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'">
|
|
|
|
<!-- all wx-dependent libraries should have been already listed
|
|
|
|
thus we can now add WX_LIBS to the linker line -->
|
|
|
|
<ldlibs>$(WX_LIBS)</ldlibs>
|
2007-03-10 12:30:31 -05:00
|
|
|
</if>
|
2007-04-05 14:26:59 -04:00
|
|
|
<if cond="value not in WX_LIB_LIST.split()">
|
2007-02-04 20:15:02 -05:00
|
|
|
<error>Unknown wxWidgets library given in the wx-lib tag</error>
|
|
|
|
</if>
|
|
|
|
</define-tag>
|
|
|
|
</if>
|
|
|
|
|
2005-09-25 07:21:48 -04:00
|
|
|
|
2005-01-27 17:47:37 -05:00
|
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- GNU makefiles for Unix -->
|
|
|
|
<!-- ============================================================== -->
|
|
|
|
|
|
|
|
<if cond="FORMAT=='gnu'">
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
<!-- remove those WX_* vars which were created just to avoid the definition
|
|
|
|
of the WX_* options in wx.bkl -->
|
|
|
|
<unset var="WX_SHARED"/>
|
|
|
|
<unset var="WX_UNICODE"/>
|
|
|
|
<unset var="WX_DEBUG"/>
|
|
|
|
<unset var="WX_PORT"/>
|
|
|
|
<unset var="WX_VERSION"/>
|
|
|
|
|
2006-03-29 11:48:46 -05:00
|
|
|
<set var="WX_CONFIG_DEFAULT" overwrite="0">wx-config</set>
|
2005-01-27 17:47:37 -05:00
|
|
|
<option name="WX_CONFIG">
|
2006-03-29 11:48:46 -05:00
|
|
|
<default-value>$(WX_CONFIG_DEFAULT)</default-value>
|
2005-01-27 17:47:37 -05:00
|
|
|
<description>Location and arguments of wx-config script</description>
|
|
|
|
</option>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
<set var="WX_PORT_DEFAULT" overwrite="0">
|
|
|
|
$(DOLLAR)(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 1)
|
|
|
|
</set>
|
|
|
|
<option name="WX_PORT">
|
2007-03-10 12:30:31 -05:00
|
|
|
<values>gtk1,gtk2,msw,x11,motif,mgl,mac,dfb</values>
|
|
|
|
<default-value force="1">$(WX_PORT_DEFAULT)</default-value>
|
2007-02-04 20:15:02 -05:00
|
|
|
<description>
|
|
|
|
Port of the wx library to build against
|
|
|
|
</description>
|
|
|
|
</option>
|
|
|
|
|
|
|
|
<set var="WX_SHARED_DEFAULT" overwrite="0">
|
|
|
|
$(DOLLAR)(shell if test -z `$(WX_CONFIG) --selected-config | cut -d '-' -f 5`; then echo 1; else echo 0; fi)
|
|
|
|
</set>
|
|
|
|
<option name="WX_SHARED">
|
2007-03-10 12:30:31 -05:00
|
|
|
<values>0,1</values>
|
|
|
|
<values-description>Static,DLL</values-description>
|
|
|
|
<default-value force="1">$(WX_SHARED_DEFAULT)</default-value>
|
2007-02-04 20:15:02 -05:00
|
|
|
<description>
|
|
|
|
Use DLL build of wx library to use?
|
|
|
|
</description>
|
2005-01-27 17:47:37 -05:00
|
|
|
</option>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
<set var="WX_UNICODE_DEFAULT" overwrite="0">
|
|
|
|
$(DOLLAR)(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 2 | sed 's/unicode/1/;s/ansi/0/')
|
|
|
|
</set>
|
|
|
|
<option name="WX_UNICODE">
|
2007-03-10 12:30:31 -05:00
|
|
|
<values>0,1</values>
|
|
|
|
<values-description>ANSI,Unicode</values-description>
|
|
|
|
<default-value force="1">$(WX_UNICODE_DEFAULT)</default-value>
|
2007-02-04 20:15:02 -05:00
|
|
|
<description>
|
|
|
|
Compile Unicode build of wxWidgets?
|
|
|
|
</description>
|
2005-01-27 17:47:37 -05:00
|
|
|
</option>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
<set var="WX_DEBUG_DEFAULT" overwrite="0">
|
|
|
|
$(DOLLAR)(shell $(WX_CONFIG) --selected-config | cut -d '-' -f 3 | sed 's/debug/1/;s/release/0/')
|
|
|
|
</set>
|
|
|
|
<option name="WX_DEBUG">
|
2007-03-10 12:30:31 -05:00
|
|
|
<values>0,1</values>
|
|
|
|
<values-description>Release,Debug</values-description>
|
|
|
|
<default-value force="1">$(WX_DEBUG_DEFAULT)</default-value>
|
2007-02-04 20:15:02 -05:00
|
|
|
<description>
|
|
|
|
Use debug build of wxWidgets (define __WXDEBUG__)?
|
|
|
|
</description>
|
2005-01-27 17:47:37 -05:00
|
|
|
</option>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
|
|
|
<set var="WX_VERSION_DEFAULT" overwrite="0">
|
|
|
|
$(DOLLAR)(shell $(WX_CONFIG) --selected-config | sed -e 's/.*-\([0-9]*\)\.\([0-9]*\)$$/\1\2/')
|
|
|
|
</set>
|
|
|
|
<option name="WX_VERSION">
|
|
|
|
<default-value>$(WX_VERSION_DEFAULT)</default-value>
|
|
|
|
<description>
|
|
|
|
Version of the wx library to build against.
|
|
|
|
</description>
|
2006-03-11 09:51:45 -05:00
|
|
|
</option>
|
2005-01-27 17:47:37 -05:00
|
|
|
|
2007-02-04 20:15:02 -05:00
|
|
|
<!-- Get MAJOR and MINOR version numbers -->
|
|
|
|
<set var="WX_VERSION_MAJOR" make_var="1">
|
|
|
|
$(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c1,1)
|
|
|
|
</set>
|
|
|
|
<set var="WX_VERSION_MINOR" make_var="1">
|
|
|
|
$(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c2,2)
|
|
|
|
</set>
|
|
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Using the GNU format creates a configurable makefile just like
|
|
|
|
a win32 makefile: i.e. a makefile where you can select the wanted
|
|
|
|
wxWidgets build using the WX_* options.
|
|
|
|
|
|
|
|
The difference with win32 makefiles is that WX_DEBUG, WX_UNICODE and
|
|
|
|
WX_SHARED options have a smart default value which is created using
|
|
|
|
the installed wx-config or the wx-config given using WX_CONFIG option
|
|
|
|
-->
|
|
|
|
<set var="WX_CONFIG_DEBUG_FLAG">
|
|
|
|
<if cond="WX_DEBUG=='0'">--debug=no</if>
|
|
|
|
<if cond="WX_DEBUG=='1'">--debug=yes</if>
|
|
|
|
</set>
|
|
|
|
<set var="WX_CONFIG_UNICODE_FLAG">
|
|
|
|
<if cond="WX_UNICODE=='0'">--unicode=no</if>
|
|
|
|
<if cond="WX_UNICODE=='1'">--unicode=yes</if>
|
|
|
|
</set>
|
|
|
|
<set var="WX_CONFIG_SHARED_FLAG">
|
|
|
|
<if cond="WX_SHARED=='0'">--static=yes</if>
|
|
|
|
<if cond="WX_SHARED=='1'">--static=no</if>
|
|
|
|
</set>
|
|
|
|
<set var="WX_CONFIG_PORT_FLAG">
|
|
|
|
--toolkit=$(WX_PORT)
|
|
|
|
</set>
|
|
|
|
<set var="WX_CONFIG_VERSION_FLAG">
|
|
|
|
--version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)
|
|
|
|
</set>
|
|
|
|
|
|
|
|
<set var="WX_CONFIG_FLAGS" make_var="1">
|
|
|
|
$(WX_CONFIG_DEBUG_FLAG) $(WX_CONFIG_UNICODE_FLAG) $(WX_CONFIG_SHARED_FLAG)
|
|
|
|
$(WX_CONFIG_PORT_FLAG) $(WX_CONFIG_VERSION_FLAG)
|
|
|
|
</set>
|
|
|
|
|
|
|
|
<set var="WX_CFLAGS">`$(DOLLAR)(WX_CONFIG) --cflags $(WX_CONFIG_FLAGS)`</set>
|
|
|
|
<set var="WX_CXXFLAGS">`$(DOLLAR)(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)`</set>
|
|
|
|
<set var="WX_CPPFLAGS">`$(DOLLAR)(WX_CONFIG) --cppflags $(WX_CONFIG_FLAGS)`</set>
|
|
|
|
<set var="WX_RESCOMP">`$(DOLLAR)(WX_CONFIG) --rescomp $(WX_CONFIG_FLAGS)`</set>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
VERY IMPORTANT: before starting to build all targets of the generated makefile,
|
|
|
|
we need to check if the selected wxWidgets build exists; we do
|
|
|
|
that simply creating the following target; if it fails the make
|
|
|
|
program will halt with the wx-config error message...
|
|
|
|
-->
|
2007-04-08 17:45:11 -04:00
|
|
|
<if cond="WX_TEST_FOR_SELECTED_WXBUILD=='1'">
|
|
|
|
<action id="test_for_selected_wxbuild">
|
|
|
|
<dependency-of>all</dependency-of>
|
|
|
|
|
|
|
|
<!-- Use @ to hide to the user that we're running wx-config... -->
|
|
|
|
<command>@$(DOLLAR)(WX_CONFIG) $(WX_CONFIG_FLAGS)</command>
|
|
|
|
</action>
|
|
|
|
</if>
|
2007-02-04 20:15:02 -05:00
|
|
|
|
2007-11-13 16:10:26 -05:00
|
|
|
<!-- we need these vars but the trick used in the default values above
|
2005-01-27 17:47:37 -05:00
|
|
|
prevents bakefile from detecting it: -->
|
2007-02-04 20:15:02 -05:00
|
|
|
<set var="FORMAT_OUTPUT_VARIABLES" append="1">WX_CONFIG WX_VERSION</set>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 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'">
|
|
|
|
<!-- all wx libraries should have been already specified, thus
|
2007-11-13 16:10:26 -05:00
|
|
|
$(__liblist) should contain the full list of required wxlibs... -->
|
2007-02-04 20:15:02 -05:00
|
|
|
<set var="__liblist" append="1">base</set>
|
2007-11-10 14:33:10 -05:00
|
|
|
<ldflags>`$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs $(','.join(__liblist.split()))`</ldflags>
|
2007-02-04 20:15:02 -05:00
|
|
|
</if>
|
|
|
|
<if cond="value!='base'">
|
|
|
|
<set var="__liblist" append="1">$(value)</set>
|
|
|
|
</if>
|
2007-04-05 14:26:59 -04:00
|
|
|
<if cond="value not in WX_LIB_LIST.split()">
|
2007-02-04 20:15:02 -05:00
|
|
|
<error>Unknown wxWidgets library given in the wx-lib tag</error>
|
|
|
|
</if>
|
|
|
|
</define-tag>
|
2005-01-27 17:47:37 -05:00
|
|
|
</if>
|
2005-09-25 07:21:48 -04:00
|
|
|
|
2005-01-27 17:47:37 -05:00
|
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- Common code -->
|
|
|
|
<!-- ============================================================== -->
|
2005-09-25 07:21:48 -04:00
|
|
|
|
2005-01-27 17:47:37 -05:00
|
|
|
<if cond="FORMAT not in ['gnu','autoconf']">
|
|
|
|
<error>
|
|
|
|
Don't include presets/wx_unix.bkl directly, use presets/wx.bkl.
|
|
|
|
</error>
|
|
|
|
</if>
|
2005-09-25 07:21:48 -04:00
|
|
|
|
2006-03-11 09:51:45 -05:00
|
|
|
<!--
|
2006-04-26 08:12:18 -04:00
|
|
|
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.
|
2006-03-11 09:51:45 -05:00
|
|
|
|
|
|
|
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).
|
2006-04-26 08:12:18 -04:00
|
|
|
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.
|
2006-03-11 09:51:45 -05:00
|
|
|
-->
|
2006-04-26 08:12:18 -04:00
|
|
|
<set var="WINDRES">$(WX_RESCOMP)</set>
|
2006-03-11 09:51:45 -05:00
|
|
|
|
2005-01-28 17:25:08 -05:00
|
|
|
<template id="wx-lib">
|
2005-01-27 17:47:37 -05:00
|
|
|
<cxxflags>$(WX_CXXFLAGS)</cxxflags>
|
|
|
|
<cflags>$(WX_CFLAGS)</cflags>
|
2005-01-28 17:25:08 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<template id="wx" template="wx-lib">
|
2005-09-25 07:21:48 -04:00
|
|
|
<!--
|
|
|
|
Don't include the $(WX_LIBS) variable in linker options here since
|
|
|
|
it would make impossible for the user to obtain the right library
|
|
|
|
order when he needs to specify, *before* WX_LIBS, its own libraries
|
|
|
|
that depend on wxWidgets libraries; to avoid this, we include
|
|
|
|
$(WX_LIBS) as soon as we found the <wx-lib>base</wx-lib> tag which
|
|
|
|
the user should always put *after* all other wx-dependent libraries
|
|
|
|
-->
|
2005-01-27 17:47:37 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
</makefile>
|