|
From: Emilien K. <cur...@us...> - 2005-02-28 17:52:05
|
Update of /cvsroot/wxdevcenter/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16449 Modified Files: wx.bkl wxDevCenter.bkl Log Message: Nouveau mécanisme bakefile basé sur le wxbase.bkl du wxWiki. Index: wx.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/wx.bkl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wx.bkl 3 Dec 2004 16:47:40 -0000 1.1 --- wx.bkl 28 Feb 2005 17:51:48 -0000 1.2 *************** *** 1,73 **** <?xml version="1.0" ?> <makefile> ! <!-- Options --> ! <!-- Static or shared library compilation. --> <option name="SHARED"> ! <values>0,1</values> ! <values-description>LIB,DLL</values-description> ! <default-value>0</default-value> ! <description> ! What type of library to build ? ! </description> ! </option> ! <!-- Unicode strings or not (unicode or ansi). --> ! <option name="UNICODE"> ! <values>0,1</values> ! <values-description>ANSI,Unicode</values-description> ! <default-value>0</default-value> ! <description> ! Compile Unicode build of wxWidgets ? ! </description> ! </option> ! <!-- Build mode. --> <option name="BUILD"> <values>debug,release</values> <values-description>Debug,Release</values-description> ! <default-value>debug</default-value> ! <description> ! Type of compiled binaries. ! </description> </option> ! <!-- wxWidgets version. --> ! <option name="WXVER"> ! <values>25, 26</values> ! <values-description>wx2.5.x, wx2.6.x</values-description> ! <default-value>25</default-value> ! <description> ! Version of wxWidgets. ! </description> ! </option> ! ! <!-- wxWidgets port. --> ! <option name="WXPORTNAME"> ! <values>msw,gtk,x11,mac,os2</values> ! <default-value>msw</default-value> ! <description>Port to use for wxWidgets library.</description> </option> - <!-- Variables declarations. --> - <!-- ISDLL : 1 if choose to compile library for dynamic use. --> - <set var="ISDLL" cond="SHARED=='1'">1</set> - <set var="ISDLL" cond="SHARED=='0'">0</set> ! ! <!-- UNICODE_DEFINE : Preprocessor definition for unicode use. --> <set var="UNICODE_DEFINE"> <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if> </set> ! <!-- DEBUGINFO : is debug mode actived ? --> ! <set var="DEBUGINFO"> <if cond="BUILD=='debug'">on</if> <if cond="BUILD=='release'">off</if> </set> ! <!-- DEBUGRUNTIME : is runtime debug library used ? --> <set var="DEBUGRUNTIME"> <if cond="BUILD=='debug'">on</if> --- 1,280 ---- <?xml version="1.0" ?> + <!-- Generic bakefile for wxWidgets projects. --> + <!-- Based on the wxWiki generic bakefile : http://wiki.wxwidgets.org/wiki.pl?Bakefile_Wxbase . --> + + <!-- GENERIC WXWIDGETS BAKEFILE --> + <!-- --> + <!-- This is a generic bakefile, heavily commented for --> + <!-- explanatory reasons. --> + <!-- This bakefile provides: --> + <!-- --> + <!-- 1) SHARED=1/0, UNICODE=0/1, BUILD=debug/release, --> + <!-- WXVER=2_4/2_5 options --> + <!-- --> + <!-- 2) ISDLL, UNICODE_DEFINE, DEBUGINFO, DEBUGRUNTIME, --> + <!-- OPTIMIZEFLAG, WXLIBPOSTFIX, WXLIBSUBPOSTFIX, --> + <!-- WARNINGS, WX25, WXLIBPATH, WXDLLPATH, WXLIBINCLUDE, --> + <!-- WXDLLINCLUDE variables --> + <!-- --> + <!-- 3) the WXLIBS and SYSLIBS tags --> + <!-- --> + <!-- 4) the WXBASE template --> + <!-- --> + + <!-- --> + <!-- A TYPICAL BAKEFILE & CONFIGURE.AC USING WXBASE --> + <!-- --> + <!-- + + <?xml version="1.0" ?> + <makefile> + + <include file="wxbase.bkl"/> + + <option name="WXWIN" category="path"> + <default-value>c:\wxWidgets</default-value> + <description>The wxWidgets library main folder</description> + </option> + + <exe id="myprog" template="wxbase"> + + <if cond="FORMAT!='autoconf'"> + <include>$(WXWIN)\include</include> + <include>$(WXWIN)$(WXLIBINCLUDE)</include> + <lib-path>$(WXWIN)$(WXLIBPATH)</lib-path> + </if> + + <app-type>gui</app-type> + <sources>mysources.cpp</sources> + <win32-res>myresources.rc</win32-res> + + <sys-lib>mylib_which_requires_wx</sys-lib> + <wxlibs/> + <syslibs/> + </exe> + </makefile> + + + + # ====================================================== + # A basic "configure.ac" using a WXBASE-based bakefile + # ====================================================== + + AC_PREREQ(2.57) + AC_INIT(myprog, 1.2.3, [my...@my...]) + + # This allows us to use Bakefile, recognizing the system type + # (and sets the AC_CANONICAL_BUILD, AC_CANONICAL_HOST and + # AC_CANONICAL_TARGET variables) + AC_CANONICAL_SYSTEM + + # This adds some standard wxWidgets options to the configure script + AM_OPTIONS_WXCONFIG + + # Two little custom macros which define the ENABLE/WITH configure arguments. + # Macro arguments: + # $1 = the name of the - -enable- feature + # $2 = the description of that feature + # $3 = the default value for that feature + # + # NOTE: the space between the two hyphens (-) are required since in XML + # they are forbidden... remove them before using this file + # + AC_DEFUN([MY_ARG_ENABLE], [AC_ARG_ENABLE($1, + AC_HELP_STRING([- -enable-$1], # Remove the space between the two hyphens + [$2 (default is $3)]),, [enable_$1=$3])]) + AC_DEFUN([MY_ARG_WITH], [AC_ARG_WITH($1, + AC_HELP_STRING([- -with-$1], # Remove the space between the two hyphens + [$2 (default is $3)]),, [with_$1=$3])]) + + MY_ARG_ENABLE([shared], [Builds shared libraries instead of static libraries], [no]) + MY_ARG_ENABLE([debug], [Builds in debug mode], [yes]) + MY_ARG_ENABLE([unicode], [Builds in UNICODE mode], [no]) + + if test "$enable_shared" = "yes"; then + SHARED=1 + AC_MSG_RESULT([Checking for the SHARED option... yes]) + else + SHARED=0 + AC_MSG_RESULT([Checking for the SHARED option... no]) + fi + + if test "$enable_debug" = "yes"; then + BUILD=debug + AC_MSG_RESULT([Checking for the DEBUG option... yes]) + else + BUILD=release + AC_MSG_RESULT([Checking for the DEBUG option... no]) + fi + + if test "$enable_unicode" = "yes"; then + UNICODE=1 + AC_MSG_RESULT([Checking for the UNICODE option... yes]) + else + UNICODE=0 + AC_MSG_RESULT([Checking for the UNICODE option... no]) + fi + + # check for wxWin version & presence + AM_PATH_WXCONFIG([2.4.2], [wxWin=1], [wxWin=0]) + if test "$wxWin" != 1; then + AC_MSG_ERROR([ + wxWindows must be installed on your system + but wx-config script couldn't be found. + Please check that wx-config is in path, the directory + where wxWindows libraries are installed (returned by + 'wx-config - -libs' command) is in LD_LIBRARY_PATH or + equivalent variable and wxWindows version is 2.3.4 or above. + ]) + fi + + # The final lines of the configure script + AC_BAKEFILE + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT + + --> + + + <!-- makefile tag signifies the beginning of the bakefile --> <makefile> ! <requires version="0.1.5"/> ! <!-- these variables are used to make default values customizable ! from an external bakefile without touching this one: if you ! want a different default setting for one of the wxbase options, ! you just should write: ! <set var="DEFBUILD_VALUE">release</set> ! *before* including wxbase.bkl ! --> ! <set var="DEFSHARED_VALUE" overwrite="0">0</set> ! <set var="DEFUNICODE_VALUE" overwrite="0">0</set> ! <set var="DEFBUILD_VALUE" overwrite="0">debug</set> ! <set var="DEFWXVER_VALUE" overwrite="0">2_5</set> ! ! <!-- OPTIONS --> ! <!-- --> ! <!-- These are essentially the configurations you --> ! <!-- want in bakefile. --> ! <!-- --> ! <!-- In MSVC these are the different build --> ! <!-- configurations you can have (in the build menu), --> ! <!-- and in autoconf is enabled with enable-xxx=xx. --> ! <!-- For other compilers a seperate configuration --> ! <!-- file is created (such as config.gcc on gcc) --> ! <!-- which has several options a user can modify. --> ! <!-- --> ! <!-- Note that the above only happens if an option --> ! <!-- is not constant, i.e. if it cannot be determined --> ! <!-- by bakefile itself. --> ! ! <!-- This is a standard option that determines --> ! <!-- whether the user wants to build this library as --> ! <!-- a dll or as a static library. --> <option name="SHARED"> ! <values>0,1</values> ! <values-description>,DLL</values-description> ! <default-value>$(DEFSHARED_VALUE)</default-value> ! <description>What type of library to build ?</description> ! </option> ! <!-- Configuration for building the bakefile with --> ! <!-- unicode strings or not (unicode or ansi). --> ! <option name="UNICODE"> ! <values>0,1</values> ! <values-description>,Unicode</values-description> ! <default-value>$(DEFUNICODE_VALUE)</default-value> ! <description>Should UNICODE be enabled ?</description> ! </option> ! <!-- There are several options that deal with build --> ! <!-- types. First, there's this one, BUILD. --> ! <!-- --> ! <!-- BUILD determines whether or not we want to build --> ! <!-- in release or debug mode. Note that in practice --> ! <!-- this means modifying the optimize tag, which by --> ! <!-- default is set to off. In this case debug means --> ! <!-- off (no optimizations), and release means speed --> ! <!-- (fast with inlining). There is also a size option --> ! <!-- that is not addressed in this example bakefile. --> <option name="BUILD"> <values>debug,release</values> <values-description>Debug,Release</values-description> ! <default-value>$(DEFBUILD_VALUE)</default-value> ! <description>Type of compiled binaries</description> </option> ! <!-- Determines which version of wxWindows we want. --> ! <!-- This option has big effects on the WXLIBS tag --> ! <!-- (the wxWidgets library names are version-dependent). --> ! <option name="WXVER"> ! <values>2_4,2_5</values> ! <values-description>2.4.x, 2.5.x</values-description> ! <default-value>$(DEFWXVER_VALUE)</default-value> ! <description>The version of wxWidgets to use</description> </option> ! <!-- --> ! <!-- VARIABLES --> ! <!-- --> ! <!-- These are variables, the same way global --> ! <!-- variables are in c/c++. --> ! <!-- --> ! <!-- To "use" a variable you use the form $(VAR) --> ! <!-- where VAR is the name of the variable, and the --> ! <!-- contants of the variable will be expanded, much --> ! <!-- like a #define in c/c++. --> ! <!-- --> ! <!-- Variables in bakefile have their hitches though. --> ! <!-- --> ! <!-- The real thing to watch out for is when using --> ! <!-- variables in if expressions - these variables --> ! <!-- must be a constant value, usually 1 or 0. In --> ! <!-- practice this means declaring the variable --> ! <!-- with the cond statement INSIDE the tag, rather --> ! <!-- then having an if statement inside the variable. --> ! ! <!-- A simple variable used to understand if we are --> ! <!-- creating a makefile for a Win32 target or a more --> ! <!-- generic linux/GNU-based system. --> ! <set var="TARGETING_WIN32"> ! <if cond="FORMAT=='autoconf' or FORMAT=='gnu'">0</if> ! <if cond="FORMAT!='autoconf' and FORMAT!='gnu'">1</if> ! </set> ! ! <!-- Set the ISDLL variable, so that we can use it --> ! <!-- inside an if statement later on (options not --> ! <!-- allowed in if statements). --> ! <set var="ISDLL" cond="SHARED=='1'">1</set> ! <set var="ISDLL" cond="SHARED=='0'">0</set> ! ! <!-- The unicode define we want. By default bakefile --> ! <!-- makes variables an empty string, so if unicode --> ! <!-- is not defined $(UNICODE_DEFINE) would expand --> ! <!-- to nothing (literally). --> <set var="UNICODE_DEFINE"> <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if> + </set> + + <!-- The debug define we need with win32 compilers --> + <!-- (on Linux, the wx-config program is used). --> + <set var="DEBUG_DEFINE"> + <if cond="FORMAT!='autoconf' and BUILD=='debug'"> + __WXDEBUG__ + </if> </set> ! <!-- Value we will use later on for the debug-info --> ! <!-- tag inside our templates. --> ! <set var="DEBUGINFO"> <if cond="BUILD=='debug'">on</if> <if cond="BUILD=='release'">off</if> </set> ! <!-- Value we will use later on for the debug-runtime --> ! <!-- tag inside our templates. --> <set var="DEBUGRUNTIME"> <if cond="BUILD=='debug'">on</if> *************** *** 75,189 **** </set> ! <!-- OPTIMIZEFLAG : type of optimization. --> <set var="OPTIMIZEFLAG"> <if cond="BUILD=='debug'">off</if> <if cond="BUILD=='release'">speed</if> </set> ! <!-- WARNINGS : level of compilation warning to show. --> ! <set var="WARNINGS"> ! <if cond="BUILD=='debug'">max</if> ! <if cond="BUILD=='release'">no</if> ! </set> ! <!-- wxWidgets libraries string flags. --> ! <set var="WXLIBPOSTFIX"> ! <if cond="BUILD=='debug' and UNICODE=='1'">ud</if> ! <if cond="BUILD=='debug' and UNICODE=='0'">d</if> ! <if cond="BUILD=='release' and UNICODE=='1'">u</if> ! </set> ! <!-- wxWidgets library name definitions. --> ! <if cond="FORMAT=='autoconf' or FORMAT=='gnu'"> ! <set var="WXNAMEPREFIX">wx_base</set> ! <set var="WXNAMEPREFIXGUI">wx_$(WXPORTNAME)</set> ! <set var="WXVERSIONTAG"> ! <if cond="WXVER=='25'">-2.5</if> ! <if cond="WXVER=='26'">-2.6</if> </set> - <set var="wxlib" >lib$(WXNAMEPREFIX)$(WXVERSIONTAG)</set> - <set var="wxlib_net" >lib$(WXNAMEPREFIX)_net$(WXVERSIONTAG)</set> - <set var="wxlib_odbc" >lib$(WXNAMEPREFIX)_odbc$(WXVERSIONTAG)</set> - <set var="wxlib_xml" >lib$(WXNAMEPREFIX)_xml$(WXVERSIONTAG)</set> - - <set var="wxlib_adv" >lib$(WXNAMEPREFIXGUI)_adv$(WXVERSIONTAG)</set> - <set var="wxlib_animate" >lib$(WXNAMEPREFIXGUI)_animate$(WXVERSIONTAG)</set> - <set var="wxlib_core" >lib$(WXNAMEPREFIXGUI)_core$(WXVERSIONTAG)</set> - <set var="wxlib_dbgrid" >lib$(WXNAMEPREFIXGUI)_dbgrid$(WXVERSIONTAG)</set> - <set var="wxlib_deprecated" >lib$(WXNAMEPREFIXGUI)_deprecated$(WXVERSIONTAG)</set> - <set var="wxlib_fl" >lib$(WXNAMEPREFIXGUI)_fl$(WXVERSIONTAG)</set> - <set var="wxlib_gizmos" >lib$(WXNAMEPREFIXGUI)_gizmos$(WXVERSIONTAG)</set> - <set var="wxlib_gl" >lib$(WXNAMEPREFIXGUI)_gl$(WXVERSIONTAG)</set> - <set var="wxlib_html" >lib$(WXNAMEPREFIXGUI)_html$(WXVERSIONTAG)</set> - <set var="wxlib_mmedia" >lib$(WXNAMEPREFIXGUI)_mmedia$(WXVERSIONTAG)</set> - <set var="wxlib_ogl" >lib$(WXNAMEPREFIXGUI)_ogl$(WXVERSIONTAG)</set> - <set var="wxlib_plot" >lib$(WXNAMEPREFIXGUI)_plot$(WXVERSIONTAG)</set> - <set var="wxlib_stc" >lib$(WXNAMEPREFIXGUI)_stc$(WXVERSIONTAG)</set> - <set var="wxlib_svg" >lib$(WXNAMEPREFIXGUI)_svg$(WXVERSIONTAG)</set> - <set var="wxlib_xrc" >lib$(WXNAMEPREFIXGUI)_xrc$(WXVERSIONTAG)</set> ! <set var="wxlib_expat" >$(wxlib)</set> ! <set var="wxlib_jpeg" >$(wxlib)</set> ! <set var="wxlib_png" >$(wxlib)</set> ! <set var="wxlib_regex" >$(wxlib)</set> ! <set var="wxlib_tiff" >$(wxlib)</set> ! <set var="wxlib_zlib" >$(wxlib)</set> </if> - <if cond="FORMAT!='autoconf' and FORMAT!='gnu'"> - <set var="WXVERSIONTAG"> - <if cond="WXVER=='25'">25</if> - <if cond="WXVER=='26'">26</if> - </set> - <set var="WXNAMEPREFIX">wxbase$(WXVERSIONTAG)$(WXLIBPOSTFIX)</set> - <set var="WXNAMEPREFIXGUI">wx$(WXPORTNAME)$(WXVERSIONTAG)$(WXLIBPOSTFIX)</set> - <set var="wxlib" >$(WXNAMEPREFIX)</set> - <set var="wxlib_net" >$(WXNAMEPREFIX)_net</set> - <set var="wxlib_odbc" >$(WXNAMEPREFIX)_odbc</set> - <set var="wxlib_xml" >$(WXNAMEPREFIX)_xml</set> - - <set var="wxlib_adv" >$(WXNAMEPREFIXGUI)_adv</set> - <set var="wxlib_animate" >$(WXNAMEPREFIXGUI)_animate</set> - <set var="wxlib_core" >$(WXNAMEPREFIXGUI)_core</set> - <set var="wxlib_dbgrid" >$(WXNAMEPREFIXGUI)_dbgrid</set> - <set var="wxlib_deprecated" >$(WXNAMEPREFIXGUI)_deprecated</set> - <set var="wxlib_fl" >$(WXNAMEPREFIXGUI)_fl</set> - <set var="wxlib_gizmos" >$(WXNAMEPREFIXGUI)_gizmos</set> - <set var="wxlib_gl" >$(WXNAMEPREFIXGUI)_gl</set> - <set var="wxlib_html" >$(WXNAMEPREFIXGUI)_html</set> - <set var="wxlib_mmedia" >$(WXNAMEPREFIXGUI)_mmedia</set> - <set var="wxlib_ogl" >$(WXNAMEPREFIXGUI)_ogl</set> - <set var="wxlib_plot" >$(WXNAMEPREFIXGUI)_plot</set> - <set var="wxlib_stc" >$(WXNAMEPREFIXGUI)_stc</set> - <set var="wxlib_svg" >$(WXNAMEPREFIXGUI)_svg</set> - <set var="wxlib_xrc" >$(WXNAMEPREFIXGUI)_xrc</set> - - <set var="wxlib_expat" >wxexpat$(WXLIBPOSTFIX)</set> - <set var="wxlib_jpeg" >wxjpeg$(WXLIBPOSTFIX)</set> - <set var="wxlib_png" >wxpng$(WXLIBPOSTFIX)</set> - <set var="wxlib_regex" >wxregex$(WXLIBPOSTFIX)</set> - <set var="wxlib_tiff" >wxtiff$(WXLIBPOSTFIX)</set> - <set var="wxlib_zlib" >wxzlib$(WXLIBPOSTFIX)</set> - </if> ! <!-- Template definitions. --> ! <!-- Base template. --> ! <template id="wxWidgets"> ! <!-- If targeting the Windows OS, link with the libraries manually. --> ! <if cond="FORMAT!='autoconf' and FORMAT!='gnu'"> ! <if cond="FORMAT=='borland'"> <sys-lib>ole2w32</sys-lib> </if> ! <if cond="FORMAT!='borland'"> <sys-lib>kernel32</sys-lib> <sys-lib>user32</sys-lib> --- 282,476 ---- </set> ! <!-- Value for optimize tag. --> <set var="OPTIMIZEFLAG"> <if cond="BUILD=='debug'">off</if> <if cond="BUILD=='release'">speed</if> </set> + + <!-- These are handy ways of dealing with the --> + <!-- extensions in the library names of the --> + <!-- wxWindows library. --> + <set var="WXLIBPOSTFIX"> + <if cond="BUILD=='debug' and UNICODE=='1'">ud</if> + <if cond="BUILD=='debug' and UNICODE=='0'">d</if> + <if cond="BUILD=='release' and UNICODE=='1'">u</if> + </set> + <set var="WXSUBLIBPOSTFIX"> + <if cond="BUILD=='debug' and UNICODE=='0'">d</if> + </set> ! <!-- Level of warnings. Here we max it out in debug --> ! <!-- mode, and turn them off in release mode. --> ! <set var="WARNINGS"> ! <if cond="BUILD=='debug'">max</if> ! <if cond="BUILD=='release'">no</if> ! </set> ! <!-- Set WXCPPFLAGS as empty; maybe it will be filled later... --> ! <set var="WXCPPFLAGS"></set> ! <if cond="FORMAT=='mingw' or FORMAT=='autoconf'"> + <!-- With GCC, settings warnings to MAX would force --> + <!-- Bakefile to call GCC with "-W -Wall" which generates --> + <!-- a *lot* of warnings about wxWidgets headers... --> + <!-- this is why "-W -Wall" is here replaced by "-Wall". --> + <set var="WARNINGS">default</set> + <set var="WXCPPFLAGS">-Wall</set> + </if> ! <!-- wx 2.5? --> ! <set var="WX25" cond="WXVER=='2_4'">0</set> ! <set var="WX25" cond="WXVER=='2_5'">1</set> ! ! <!-- The name of the subfolder containing the wxWidgets lib(s) --> ! <!-- Use in this way: --> ! <!-- <lib-path>$(MYPATHTOWXWIN)$(WXLIBPATH$)</lib-path> --> ! <!-- This variable is useful when the user of the makefile has --> ! <!-- not added to the wxWidgets libpath to the system path or --> ! <!-- for those developers which need to test their program --> ! <!-- with various compilers and thus have a --> ! <!-- - bcc_lib containing OMF wxWidgets libraries --> ! <!-- - vc_lib containing COFF wxWidgets libraries --> ! <!-- - gcc_lib containing GCC wxWidgets libraries --> ! <!-- [...] --> ! <!-- in their wxWidgets/lib folder. --> ! <!-- --> ! <!-- Note (1): this variable will always include only the --> ! <!-- static lib path; see WXDLLPATH --> ! <if cond="TARGETING_WIN32=='1'"> ! <set var="WXLIBPATH" cond="FORMAT!='autoconf'"> ! $(DIRSEP)lib$(DIRSEP)$(COMPILER)_lib </set> + </if> + <!-- Like WXLIBPATH except that this variable will include --> + <!-- the path to the DLL wxWidgets lib(s). --> + <if cond="TARGETING_WIN32=='1'"> + <set var="WXDLLPATH">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_dll</set> + </if> ! <!-- The name of the subfolder of the LIB directory of --> ! <!-- wxWidgets which should be included in the path searched --> ! <!-- for SETUP.H. --> ! <!-- Note (1): this variable should be used with MSW compilers --> ! <!-- only and in this way: --> ! <!-- <include>$(MYPATHTOWXWIN)$(WXLIBINCLUDE) --> ! <!-- Note (2): this variable will always include only the --> ! <!-- static SETUP.H-path; see WXDLLINCLUDE --> ! <if cond="TARGETING_WIN32=='1'"> ! <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set> </if> + <!-- Like WXLIBINCLUDE except that this variable will include --> + <!-- the path to the SETUP.H required for DLL. --> + <if cond="TARGETING_WIN32=='1'"> + <set var="WXDLLINCLUDE">$(WXDLLPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set> + </if> + <!-- --> + <!-- NEW TAGS --> + <!-- --> + <!-- The powerful <define-tag> tag allows the Bakefile --> + <!-- user to extend it, working as a sort of macros. --> + <!-- --> + + <!-- This defines a tag which includes headers on MSVC --> + <!-- Note that $(value) is stuck in there by bakefile, --> + <!-- and is the value between the beginning and end tag. --> + <define-tag name="headers" rules="dll,lib,exe"> + <if cond="FORMAT=='msvc6prj'"> + <msvc-project-files> + $(value) + </msvc-project-files> + </if> + </define-tag> + <!-- Defines the WXLIBS tag which links wxWidgets libraries. --> + <!-- Use this tag _after_ declaring, through the SYS-LIB tag, --> + <!-- all other libraries based upon wxWidgets but _before_ --> + <!-- using the SYSLIBS tag (defined below). --> + <!-- This is required because some compilers (like GCC and --> + <!-- thus also MinGW) require the libraries to be listed in --> + <!-- 'dependency-order': if mylib1 requires mylib2 then mylib1 --> + <!-- must be given to the linker before mylib2. --> + <!-- To tell Bakefile to put mylib1 before mylib2 you must put --> + <!-- the <SYS-LIB>s tags in the right order: --> + <!-- --> + <!-- <lib/exe/dll id="abc"> --> + <!-- <sys-lib>mylib1</sys-lib> --> + <!-- <sys-lib>mylib2</sys-lib> --> + <!-- </lib/exe/dll> --> + <!-- --> + <!-- If you swap the order of the two SYS-LIB tags in the --> + <!-- example above, you'll get linker errors (with GCC). --> + <!-- Thus, instead of just declaring wxWidgets libraries in the --> + <!-- WXBASE template, it's better to define a new tag: WXLIBS --> + <!-- Example: --> + <!-- --> + <!-- <lib/exe/dll id="abc"> --> + <!-- <sys-lib>mylib_requiring_wx</sys-lib> --> + <!-- <wxlibs/> --> + <!-- <syslibs/> --> + <!-- </lib/exe/dll> --> + <!-- --> + <define-tag name="wxlibs" rules="exe,dll,lib"> ! <!-- wxWindows-specific stuff --> ! <!-- Note: these libs must be declared *before* --> ! <!-- system libs if you want MINGW linker to work --> ! <if cond="TARGETING_WIN32=='1'"> ! <if cond="WX25=='1'"> ! <sys-lib>wxmsw25$(WXLIBPOSTFIX)_core</sys-lib> ! <sys-lib>wxmsw25$(WXLIBPOSTFIX)_html</sys-lib> ! <sys-lib>wxbase25$(WXLIBPOSTFIX)</sys-lib> ! </if> ! <if cond="WX25=='0'"> ! <sys-lib>wxmsw$(WXLIBPOSTFIX)</sys-lib> ! </if> ! <sys-lib>wxtiff$(WXSUBLIBPOSTFIX)</sys-lib> ! <sys-lib>wxjpeg$(WXSUBLIBPOSTFIX)</sys-lib> ! <sys-lib>wxpng$(WXSUBLIBPOSTFIX)</sys-lib> ! <sys-lib>wxzlib$(WXSUBLIBPOSTFIX)</sys-lib> ! ! <!-- For regex we won't use the WXSUBLIBPOSTIX postfix: ! unliked tiff, jpeg, png, zlib, expat, when building ! in Unicode mode, the "u" suffix is appended to regex --> ! <sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib> ! ! <sys-lib>wxexpat$(WXSUBLIBPOSTFIX)</sys-lib> ! <!-- <sys-lib>$(UNICOWS_LIB)</sys-lib> --> ! ! <!-- this is defined to __WXDEBUG__ on win32. --> ! <define>$(DEBUG_DEFINE)</define> ! <define>__WXMSW__</define> ! </if> ! ! <!-- If not on windows, we can use wxWindows configuration --> ! <!-- utilities to include the libs and defines for us. --> ! <if cond="TARGETING_WIN32=='0'"> ! <ldflags>`wx-config --libs`</ldflags> ! </if> ! </define-tag> ! <!-- Like the WXLIBS tag defined above, but this one declares --> ! <!-- the standard non-wxWidgets libraries. This tag should be --> ! <!-- used _after_ you declare all other libraries. --> ! <!-- See WXLIBS tag for more info. --> ! <define-tag name="syslibs" rules="exe,dll,lib"> ! <!-- If targeting the Windows OS, link with the --> ! <!-- libraries manually --> ! <if cond="TARGETING_WIN32=='1'"> ! <!-- If on borland, we don't need to do much --> ! <if cond="FORMAT=='borland'"> <sys-lib>ole2w32</sys-lib> </if> ! ! <!-- Non-borland, on the other hand... --> ! <if cond="FORMAT!='borland'"> <sys-lib>kernel32</sys-lib> <sys-lib>user32</sys-lib> *************** *** 194,198 **** <sys-lib>shell32</sys-lib> <sys-lib>comctl32</sys-lib> - <sys-lib>odbc32</sys-lib> <sys-lib>ole32</sys-lib> <sys-lib>oleaut32</sys-lib> --- 481,484 ---- *************** *** 201,224 **** <sys-lib>advapi32</sys-lib> <sys-lib>wsock32</sys-lib> </if> <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> <sys-lib>oleacc</sys-lib> </if> - </if> <!-- end if windows. --> - <cxx-rtti>on</cxx-rtti> - <cxx-exceptions>on</cxx-exceptions> - <threading>multi</threading> - <sys-lib>$(wxlib)</sys-lib> <warnings>$(WARNINGS)</warnings> ! <define>$(UNICODE_DEFINE)</define> ! <optimize>$(OPTIMIZEFLAG)</optimize> ! <debug-info>$(DEBUGINFO)</debug-info> ! <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs> </template> - - </makefile> --- 487,544 ---- <sys-lib>advapi32</sys-lib> <sys-lib>wsock32</sys-lib> + <sys-lib>odbc32</sys-lib> </if> + + <!-- Libs common to both borland and MSVC --> <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> <sys-lib>oleacc</sys-lib> </if> + </if> <!-- end if windows --> + </define-tag> + <!-- --> + <!-- TEMPLATES --> + <!-- --> + <!-- While not required, templates make your --> + <!-- bakefiles much more readable. Templates, in --> + <!-- essence, are abstract classes like c++. --> + <!-- --> + <!-- Your build targets "inherit" the template, --> + <!-- along with the info associated with the template --> + + <!-- --> + <!-- wxWidgets LIBRARY/APP TEMPLATE --> + <!-- --> + <!-- The "base class" of all our build targets --> + <!-- This links with the appropriate native --> + <!-- libraries required by the platform, the libaries --> + <!-- we want for our stuff, and the wxWindows libs. --> + <!-- --> + <!-- HOW TO USE THIS TEMPLATE: see the beginning of this --> + <!-- bakefile for an example: this template misses the --> + <!-- <wxlibs/> and <syslibs/> tags which should be added --> + <!-- in the right order in derived targets. --> + <template id="wxbase"> + + <!-- MISCELLANEOUS --> + <if cond="FORMAT=='mingw'"> + <define>HAVE_W32API_H</define> + <ldflags>-mthreads</ldflags> + </if> + + <if cond="TARGETING_WIN32=='0'"> + <cxxflags>`wx-config --cxxflags`</cxxflags> + </if> + + <cxxflags>$(WXCPPFLAGS)</cxxflags> <warnings>$(WARNINGS)</warnings> ! <define>$(UNICODE_DEFINE)</define> ! <optimize>$(OPTIMIZEFLAG)</optimize> ! <debug-info>$(DEBUGINFO)</debug-info> ! <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs> </template> + </makefile> \ No newline at end of file Index: wxDevCenter.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/wxDevCenter.bkl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxDevCenter.bkl 24 Feb 2005 09:43:12 -0000 1.5 --- wxDevCenter.bkl 28 Feb 2005 17:51:48 -0000 1.6 *************** *** 5,10 **** <using module="datafiles"/> ! ! <set var="DIRSPEC"> <if cond="PLATFORM_WIN32=='1'">msw</if> --- 5,16 ---- <using module="datafiles"/> ! ! <option name="WXWIN" category="path"> ! <default-value>c:\wxWidgets</default-value> ! <description>The wxWidgets library main folder</description> ! </option> ! ! ! <set var="DIRSPEC"> <if cond="PLATFORM_WIN32=='1'">msw</if> *************** *** 17,38 **** ! <!-- wxDevCenter plateform-specific intermediate library. --> ! <lib id="wxdcSpecific"> <include>include</include> <sources> src/$(DIRSPEC)/Config.cpp src/$(DIRSPEC)/FileSystemStandard.cpp </sources> </lib> ! <!-- wxDevCenter executable. --> ! <exe id="wxDevCenter" template="wxWidgets"> <app-type>gui</app-type> <exename>wxDevCenter$(DEBUGFLAG)</exename> - <depends>wxdcSpecific</depends> - <library>wxdcSpecific</library> - <include>include</include> <sources> src/AboutBox.cpp --- 23,68 ---- ! ! <lib id="specific" template="wxbase"> ! <if cond="FORMAT!='autoconf'"> ! <include>$(WXWIN)\include</include> ! <include>$(WXWIN)$(WXLIBINCLUDE)</include> ! <lib-path>$(WXWIN)$(WXLIBPATH)</lib-path> ! </if> ! <include>include</include> + <precomp-headers>on</precomp-headers> + <precomp-headers-header>wxDevCenter.h</precomp-headers-header> + <sources> src/$(DIRSPEC)/Config.cpp src/$(DIRSPEC)/FileSystemStandard.cpp </sources> + + <wxlibs/> + <syslibs/> </lib> + ! ! <exe id="wxDevCenter" template="wxbase"> ! ! <if cond="FORMAT!='autoconf'"> ! <include>$(WXWIN)\include</include> ! <include>$(WXWIN)$(WXLIBINCLUDE)</include> ! <lib-path>$(WXWIN)$(WXLIBPATH)</lib-path> ! </if> ! <app-type>gui</app-type> <exename>wxDevCenter$(DEBUGFLAG)</exename> + <depends>specific</depends> + <library>specific</library> + + <app-type>gui</app-type> <include>include</include> + <precomp-headers>on</precomp-headers> + <precomp-headers-header>wxDevCenter.h</precomp-headers-header> + <sources> src/AboutBox.cpp *************** *** 55,66 **** src/View.cpp </sources> ! <precomp-headers>on</precomp-headers> ! <precomp-headers-header>wxDevCenter.h</precomp-headers-header> ! <sys-lib>$(wxlib_net)</sys-lib> ! <sys-lib>$(wxlib_fl)</sys-lib> <install-to>$(BINDIR)</install-to> </exe> <!-- Install headers. --> <data-files-tree > --- 85,100 ---- src/View.cpp </sources> ! ! <wxlibs/> ! <syslibs/> ! ! <!-- <sys-lib>$(wxlib_net)</sys-lib> ! <sys-lib>$(wxlib_fl)</sys-lib> --> <install-to>$(BINDIR)</install-to> + </exe> + <!-- Install headers. --> <data-files-tree > *************** *** 120,123 **** </data-files-tree> - </makefile> --- 154,156 ---- |