From e602dae828e1f522c3142d15d6449f89dda33340 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Mon, 5 Feb 2007 01:15:02 +0000 Subject: [PATCH] Committing patch #1604462, which improves autoconf support, adds a wxbase template, allows components to have names which match wx lib naming, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- .../wxpresets/libsample/configure.in | 64 +++ .../wxpresets/libsample/libsample.bkl | 50 +++ .../wxpresets/libsample/libsample.cpp | 41 ++ build/bakefiles/wxpresets/presets/wx.bkl | 373 +++++++++++++++++- build/bakefiles/wxpresets/presets/wx_unix.bkl | 230 +++++++++-- .../bakefiles/wxpresets/presets/wx_win32.bkl | 267 +++++-------- build/bakefiles/wxpresets/sample/minimal.bkl | 3 + 7 files changed, 808 insertions(+), 220 deletions(-) create mode 100644 build/bakefiles/wxpresets/libsample/configure.in create mode 100644 build/bakefiles/wxpresets/libsample/libsample.bkl create mode 100644 build/bakefiles/wxpresets/libsample/libsample.cpp diff --git a/build/bakefiles/wxpresets/libsample/configure.in b/build/bakefiles/wxpresets/libsample/configure.in new file mode 100644 index 0000000000..f31309a2ce --- /dev/null +++ b/build/bakefiles/wxpresets/libsample/configure.in @@ -0,0 +1,64 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT([libsample],[1.2.5],[vslavik@fastmail.fm]) +AC_CONFIG_SRCDIR([libsample.cpp]) + + +dnl --------------------------------------------------------------------------- +dnl DEFINE CONFIGURE OPTIONS +dnl --------------------------------------------------------------------------- + +dnl define all the wx-config related options +dnl (i.e. --with-wxdir, --with-wx-config, --with-wx-prefix, --with-wx-exec-prefix) +WX_CONFIG_OPTIONS + +dnl define all the wxpresets related options +WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared]) + + + +dnl --------------------------------------------------------------------------- +dnl CONFIGURE CHECKS +dnl --------------------------------------------------------------------------- + +dnl these checks are required by bakefile: +AC_CANONICAL_SYSTEM +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_RANLIB +AC_PROG_CC +AC_PROG_CXX +AC_PROG_CXXCPP + +dnl we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE +WX_DEBUG=$DEBUG +WX_UNICODE=$UNICODE + +dnl the following macros will search for the best matching wxWidgets build +dnl (taking in count the values of the --enable-debug|unicode|shared and of +dnl the --with-toolkit|wxshared options) and then set appropriately all the +dnl WX_* options +WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS +WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[core,base],[$WXCONFIG_FLAGS]) +WX_DETECT_STANDARD_OPTION_VALUES + +dnl here all WX_* option values are available for your own processing... + + + + +dnl --------------------------------------------------------------------------- +dnl CONFIGURE END +dnl --------------------------------------------------------------------------- + +AC_BAKEFILE([m4_include(autoconf_inc.m4)]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + + +dnl show a nice summary of the chosen build settings to the user +WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN +WX_STANDARD_OPTIONS_SUMMARY_MSG_END + diff --git a/build/bakefiles/wxpresets/libsample/libsample.bkl b/build/bakefiles/wxpresets/libsample/libsample.bkl new file mode 100644 index 0000000000..7bfe891033 --- /dev/null +++ b/build/bakefiles/wxpresets/libsample/libsample.bkl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + test + + + + + test + WXMAKINGDLL_LIBSAMPLE + + core + base + + + diff --git a/build/bakefiles/wxpresets/libsample/libsample.cpp b/build/bakefiles/wxpresets/libsample/libsample.cpp new file mode 100644 index 0000000000..79b7f85708 --- /dev/null +++ b/build/bakefiles/wxpresets/libsample/libsample.cpp @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: libsample.cpp +// Purpose: The source of a dummy sample wx-based library +// Author: Francesco Montorsi +// Modified by: +// Created: 26/11/06 +// RCS-ID: $Id$ +// Copyright: (c) Francesco Montorsi +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers) +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +// ============================================================================ +// implementation +// ============================================================================ + +void MyUtilityFunction() +{ + wxPrintf(wxT("Hello world!\n")); + fflush(stdout); +} diff --git a/build/bakefiles/wxpresets/presets/wx.bkl b/build/bakefiles/wxpresets/presets/wx.bkl index 0b75822c9d..2eef873e0b 100644 --- a/build/bakefiles/wxpresets/presets/wx.bkl +++ b/build/bakefiles/wxpresets/presets/wx.bkl @@ -4,7 +4,94 @@ @@ -12,16 +99,22 @@ - 3 + 4 - + base core net xml odbc xrc html adv media gl dbgrid qa aui richtext - animate applet deprecated fl foldbar gizmos mmedia netutils ogl plot stc svg + (which is already in LIB_LIST) + --> + + applet deprecated fl foldbar gizmos mmedia netutils ogl plot stc svg + $(LIB_LIST) $(CONTRIBLIB_LIST) @@ -33,6 +126,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 0 + + + + + + + + + + + + + + + + + 0 + + + + + + + 0 + + + + + 1 + + + + + 28 + + + + + 0 + + + $(DOLLAR)($(ENV_VAR)WXWIN) @@ -46,6 +242,21 @@ + + + + + + + + ud + d + u + + + + + 0 @@ -64,4 +275,156 @@ This format is not (yet) supported by wx preset. + + + + + + + + + + + + + + + + + + + + + + $(attributes['prefix'])_$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) + + + $(attributes['prefix'])_$(WX_PORT)$(WXLIBPOSTFIX)_$(value)-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR) + + + + + + + <__setlibname prefix="$(attributes['prefix'])">$(value) + $(__temp) + + + + + <__setlibname prefix="$(attributes['prefix'])">$(value) + $(__temp) + $(__temp) + + + + + <__setlibname prefix="$(attributes['prefix'])">$(value) + $(__temp) + + + + + + + lib + dll + + + lib/$(COMPILER)_$(_DIRNAME_SHARED_SUFFIX) + + + $(_DIRNAME) + + + + + @mkdir -p $(_DIRNAME) + + + if not exist $(_DIRNAME) mkdir $(_DIRNAME) + + $(id) + + + + + lib + + + + + + + + $(value)$(WXLIBPATH) + + + $(value)/include + + + + + + + + + + + + _dll + + + + $(COMPILER)$(WX_PORT)$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX) + + + + diff --git a/build/bakefiles/wxpresets/presets/wx_unix.bkl b/build/bakefiles/wxpresets/presets/wx_unix.bkl index fca2c126c6..324c24a5fa 100644 --- a/build/bakefiles/wxpresets/presets/wx_unix.bkl +++ b/build/bakefiles/wxpresets/presets/wx_unix.bkl @@ -5,64 +5,233 @@ Presents for building wxWidgets applications using Autoconf or GNU toosets. See wx.bkl for platform-independent notes. -Usage: - Options WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS are defined. - - Format-specific notes: * autoconf: Beware that you have to use AM_OPTIONS_WXCONFIG and - AM_PATH_WXCONFIG in your configure.in! + AM_PATH_WXCONFIG in your configure.in to get at least the + WX_CPPFLAGS, WX_CFLAGS, WX_CXXFLAGS, WX_LIBS option values defined. + To detect the WX_* option values typically you also want to use + the AM_WXPRESETS_OPTIONS and AM_WXPRESETS_CHECKS macros + (see wxpresets.m4 for more info). --> + + + + + + + auto + + + + + - + + + + + + + + + wx-config - + + + $(DOLLAR)(shell if test -z `$(WX_CONFIG) --selected-config | cut -d '-' -f 5`; then echo 1; else echo 0; fi) + + - - - + + + $(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c1,1) + + + $(DOLLAR)(shell echo $(DOLLAR)(WX_VERSION) | cut -c2,2) + + + + + + --debug=no + --debug=yes + + + --unicode=no + --unicode=yes + + + --static=yes + --static=no + + + --toolkit=$(WX_PORT) + + + --version=$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR) + + + + $(WX_CONFIG_DEBUG_FLAG) $(WX_CONFIG_UNICODE_FLAG) $(WX_CONFIG_SHARED_FLAG) + $(WX_CONFIG_PORT_FLAG) $(WX_CONFIG_VERSION_FLAG) + + + `$(DOLLAR)(WX_CONFIG) --cflags $(WX_CONFIG_FLAGS)` + `$(DOLLAR)(WX_CONFIG) --cxxflags $(WX_CONFIG_FLAGS)` + `$(DOLLAR)(WX_CONFIG) --cppflags $(WX_CONFIG_FLAGS)` + `$(DOLLAR)(WX_CONFIG) --rescomp $(WX_CONFIG_FLAGS)` + + + + all + + + @$(DOLLAR)(WX_CONFIG) $(WX_CONFIG_FLAGS) + + + - WX_CONFIG + WX_CONFIG WX_VERSION + + + + + + + base + `$(WX_CONFIG) $(WX_CONFIG_FLAGS) --libs $(','.join(__liblist.split()))` + + + $(value) + + + Unknown wxWidgets library given in the wx-lib tag + + @@ -110,27 +279,4 @@ Format-specific notes: --> - - - - - $(WX_LIBS) - - - - base - `$(WX_CONFIG) --libs $(','.join(__liblist.split()))` - - - $(value) - - - Unknown wxWidgets library given in the wx-lib tag - - - diff --git a/build/bakefiles/wxpresets/presets/wx_win32.bkl b/build/bakefiles/wxpresets/presets/wx_win32.bkl index 0f41ec84b3..5f295c6293 100644 --- a/build/bakefiles/wxpresets/presets/wx_win32.bkl +++ b/build/bakefiles/wxpresets/presets/wx_win32.bkl @@ -10,21 +10,9 @@ - - - - + @@ -41,77 +29,12 @@ FIXME: this template has (at least) the following bugs: + + + + + - - - 0 - 1 - 0 - - - - - - - - 0 - - - - - - - 0 - - - - - 1 - - - - - 28 - - - - - 0 - - @@ -135,11 +58,6 @@ FIXME: this template has (at least) the following bugs: - - ud - d - u - d @@ -153,11 +71,14 @@ FIXME: this template has (at least) the following bugs: $(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll - + + wince msw - $(WXLIBPATH)$(DIRSEP)$(WXPORT)$(WXLIBPOSTFIX) + + $(WXLIBPATH)$(DIRSEP)$(WX_PORT)$(WXLIBPOSTFIX) @@ -173,95 +94,65 @@ FIXME: this template has (at least) the following bugs: WX_MONOLITHIC=1, then the base library is translated to the monolithic library --> - wx$(WXPORT)$(WX_VERSION) - wx$(WXPORT)$(WX_VERSION)d - wx$(WXPORT)$(WX_VERSION)u - wx$(WXPORT)$(WX_VERSION)ud + wx$(WX_PORT)$(WX_VERSION) + wx$(WX_PORT)$(WX_VERSION)d + wx$(WX_PORT)$(WX_VERSION)u + wx$(WX_PORT)$(WX_VERSION)ud + - - wxbase$(WX_VERSION)_net - wxbase$(WX_VERSION)d_net - wxbase$(WX_VERSION)u_net - wxbase$(WX_VERSION)ud_net - - - wxbase$(WX_VERSION)_xml - wxbase$(WX_VERSION)d_xml - wxbase$(WX_VERSION)u_xml - wxbase$(WX_VERSION)ud_xml - - - wxbase$(WX_VERSION)_odbc - wxbase$(WX_VERSION)d_odbc - wxbase$(WX_VERSION)u_odbc - wxbase$(WX_VERSION)ud_odbc + + + + wxbase$(WX_VERSION)_$(value) + + + wxbase$(WX_VERSION)d_$(value) + + + wxbase$(WX_VERSION)u_$(value) + + + wxbase$(WX_VERSION)ud_$(value) + + - - - wx$(WXPORT)$(WX_VERSION)_core - wx$(WXPORT)$(WX_VERSION)d_core - wx$(WXPORT)$(WX_VERSION)u_core - wx$(WXPORT)$(WX_VERSION)ud_core - - - wx$(WXPORT)$(WX_VERSION)_media - wx$(WXPORT)$(WX_VERSION)d_media - wx$(WXPORT)$(WX_VERSION)u_media - wx$(WXPORT)$(WX_VERSION)ud_media - - - wx$(WXPORT)$(WX_VERSION)_xrc - wx$(WXPORT)$(WX_VERSION)d_xrc - wx$(WXPORT)$(WX_VERSION)u_xrc - wx$(WXPORT)$(WX_VERSION)ud_xrc - - - wx$(WXPORT)$(WX_VERSION)_html - wx$(WXPORT)$(WX_VERSION)d_html - wx$(WXPORT)$(WX_VERSION)u_html - wx$(WXPORT)$(WX_VERSION)ud_html - - - wx$(WXPORT)$(WX_VERSION)_adv - wx$(WXPORT)$(WX_VERSION)d_adv - wx$(WXPORT)$(WX_VERSION)u_adv - wx$(WXPORT)$(WX_VERSION)ud_adv - - - wx$(WXPORT)$(WX_VERSION)_qa - wx$(WXPORT)$(WX_VERSION)d_qa - wx$(WXPORT)$(WX_VERSION)u_qa - wx$(WXPORT)$(WX_VERSION)ud_qa - - - wx$(WXPORT)$(WX_VERSION)_dbgrid - wx$(WXPORT)$(WX_VERSION)d_dbgrid - wx$(WXPORT)$(WX_VERSION)u_dbgrid - wx$(WXPORT)$(WX_VERSION)ud_dbgrid - - - wx$(WXPORT)$(WX_VERSION)_gl - wx$(WXPORT)$(WX_VERSION)d_gl - wx$(WXPORT)$(WX_VERSION)u_gl - wx$(WXPORT)$(WX_VERSION)ud_gl - - - wx$(WXPORT)$(WX_VERSION)_aui - wx$(WXPORT)$(WX_VERSION)d_aui - wx$(WXPORT)$(WX_VERSION)u_aui - wx$(WXPORT)$(WX_VERSION)ud_aui - - - wx$(WXPORT)$(WX_VERSION)_richtext - wx$(WXPORT)$(WX_VERSION)d_richtext - wx$(WXPORT)$(WX_VERSION)u_richtext - wx$(WXPORT)$(WX_VERSION)ud_richtext - + net + xml + odbc + + + + + wx$(WX_PORT)$(WX_VERSION)_$(value) + + + wx$(WX_PORT)$(WX_VERSION)d_$(value) + + + wx$(WX_PORT)$(WX_VERSION)u_$(value) + + + wx$(WX_PORT)$(WX_VERSION)ud_$(value) + + + + + core + media + xrc + html + adv + qa + dbgrid + gl + aui + richtext + @@ -306,7 +197,7 @@ FIXME: this template has (at least) the following bugs: - wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) + wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) @@ -331,6 +222,8 @@ FIXME: this template has (at least) the following bugs: -mthreads + $(substituteFromDict(WX_SHARED,{'1':'WXUSINGDLL','0':''})) + $(WXUNICODE_DEFINE) $(WXDEBUG_DEFINE) __WXMSW__ @@ -397,4 +290,32 @@ FIXME: this template has (at least) the following bugs: <__wx-syslibs/> + + + + + all + + + + @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ + echo ---------------------------------------------------------------------------- + @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ + echo Selected wxWidgets build is not available! + @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ + echo Please use the options prefixed with WX_ to select another wxWidgets build. + @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ + echo ---------------------------------------------------------------------------- + @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ + exit 1 + + + + diff --git a/build/bakefiles/wxpresets/sample/minimal.bkl b/build/bakefiles/wxpresets/sample/minimal.bkl index a21f271a72..2a0152b6b4 100644 --- a/build/bakefiles/wxpresets/sample/minimal.bkl +++ b/build/bakefiles/wxpresets/sample/minimal.bkl @@ -7,6 +7,9 @@ gui + + on dynamic -- 2.45.2