adapted wx-config to work in multilib mode

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-07-29 22:42:16 +00:00
parent 1dbd57590d
commit cf615ebbb1
5 changed files with 199 additions and 22 deletions
Vendored
+8 -3
View File
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -2741,6 +2741,9 @@ equivalent variable and GTK+ is version 1.2.3 or above.
TOOLKIT=MAC
dnl we can't call this MAC_DIST or autoconf thinks its a macro
GUIDIST=MACX_DIST
dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
dnl are different, so they need different names:
WXBASEPORT="_carbon"
fi
if test "$wxUSE_COCOA" = 1; then
@@ -3012,7 +3015,8 @@ fi
dnl library link name
WX_LIBRARY="wx_${TOOLCHAIN_NAME}"
WX_LIBRARY_GL="wx_${TOOLCHAIN_NAME_GL}"
WX_LIBRARY_BASENAME="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}"
WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}"
WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}"
dnl the name of the shared library
WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
@@ -5541,6 +5545,7 @@ AC_SUBST(OFFICIAL_BUILD)
AC_SUBST(WXUNIV)
AC_SUBST(MONOLITHIC)
AC_SUBST(LIBS)
AC_SUBST(EXTRALIBS)
AC_SUBST(EXTRALIBS_XML)
AC_SUBST(EXTRALIBS_GUI)
@@ -5578,7 +5583,8 @@ AC_SUBST(WX_MINOR_VERSION_NUMBER)
AC_SUBST(WX_RELEASE_NUMBER)
AC_SUBST(WX_LIBRARY_NAME_STATIC)
AC_SUBST(WX_LIBRARY_NAME_SHARED)
AC_SUBST(WX_LIBRARY_BASENAME)
AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
AC_SUBST(WX_LIBRARY_BASENAME_GUI)
AC_SUBST(WX_LIBRARY_IMPORTLIB)
AC_SUBST(WX_TARGET_LIBRARY)
AC_SUBST(WX_LIBRARY_LINK1)
+3 -2
View File
@@ -13,9 +13,10 @@ tn0009.htm Creating and converting icons
tn0010.htm Compiling wxWindows applications in the VC++ IDE
tn0011.txt All about version numbers
tn0012.txt wxWindows platform, toolkit and library names
tn0013.txt how to make a wxGTK distribution
tn0013.txt How to make a wxGTK distribution
tn0014.txt XRC resources format specification
tn0015.txt how to add new bitmaps to wxWindows UI elements
tn0015.txt How to add new bitmaps to wxWindows UI elements
tn0016.txt How to add new files and libraries to wxWindows build system
Version: $Id$
+75
View File
@@ -0,0 +1,75 @@
How to add new files and libraries to wxWindows build system
============================================================
1. Regenerating makefiles
-------------------------
2. Bakefile files organization
------------------------------
3. Adding files to existing library
-----------------------------------
4. Adding sample or contrib library
-----------------------------------
5. Adding new core library
--------------------------
When adding new library to the core set of libraries, the files must be
added to both a newly added library in multilib build and into the single
library built in monolithic mode. We will assume that the new library is
called wxFoo.
a) Add files to files.bkl FIXME
b) Modify bakefile system in build/bakefiles/ to recognize wxFoo:
* Add 'foo'to MAIN_LIBS and LIBS_NOGUI or LIBS_GUI (depending on whether
the library depends on wxCore or not) to wxwin.py file.
* Add WXLIB_FOO definition to common.bkl (into the "Names of component
libraries" section). It looks like this:
<set var="WXLIB_FOO">
<if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('foo')))</if>
</set>
c) Add files to monolithic build FIXME
d) Add files to multilib build FIXME
e) Regenerate all makefiles (don't forget to run autoconf)
f) Update wx-config.in to contain information about the library and needed
linker flags:
* Add "foo" to either CORE_BASE_LIBS or CORE_GUI_LIBS so that wxFoo is
not treated as contrib library in monolithic build.
* If wxFoo links against additional libraries, add neccessary linker
flags and libraries to ldflags_foo and ldlibs_foo variables (both are
optional).
g) Update defs.h to define WXMAKINGDLL_FOO if WXMAKINGDLL is defined (add
#define WXMAKINGDLL_FOO inside first "#ifdef WXMAKINGDLL" block in defs.h)
and to define WXDLLIMPEXP_FOO and WXDLLIMPEXP_DATA_FOO. You can copy
e.g. WXDLLIMPEXP_NET definition, it is something like this:
#ifdef WXMAKINGDLL_NET
#define WXDLLIMPEXP_NET WXEXPORT
#define WXDLLIMPEXP_DATA_NET(type) WXEXPORT type
#elif defined(WXUSINGDLL)
#define WXDLLIMPEXP_NET WXIMPORT
#define WXDLLIMPEXP_DATA_NET(type) WXIMPORT type
#else // not making nor using DLL
#define WXDLLIMPEXP_NET
#define WXDLLIMPEXP_DATA_NET(type) type
#endif
h) Add information about wxFoo to the manual
FIXME - where exactly
=== EOF ===
Version: $Id$
+105 -15
View File
@@ -1,5 +1,6 @@
#!/bin/sh
# Generic configuration variables:
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
@@ -12,6 +13,64 @@ builddir=@top_builddir_wxconfig@
cross_compiling=@cross_compiling@
target=@host_alias@
static_flag=@STATIC_FLAG@
basename_nogui=@WX_LIBRARY_BASENAME_NOGUI@
basename_gui=@WX_LIBRARY_BASENAME_GUI@
release=@WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@
is_monolithic=@MONOLITHIC@
# Linker flags for sublibraries:
CORE_BASE_LIBS="xml net base"
CORE_GUI_LIBS="html core"
ldlibs_base="@LIBS@"
ldlibs_core="@EXTRALIBS_GUI@"
ldlibs_xml="@EXTRALIBS_XML@"
ldflags_gl="@LDFLAGS_GL@"
ldlibs_gl="@OPENGL_LIBS@"
# is $1 among the rest of arguments?
isinlist()
{
value=$1
shift
isin=no
for iii in $* ; do
if test $iii = $value ; then isin=yes ; fi
done
test $isin = yes
}
# output linker commands needed to link against libraries passed as arguments
# (does not handle monolithic/multilib):
output_libs()
{
all_libs=""
all_ldflags=""
wxlibs=""
for lib in $* ; do
eval xlibs=\$ldlibs_$lib
eval xflags=\$ldflags_$lib
if isinlist $lib $CORE_BASE_LIBS ; then
basename=$basename_nogui
else
basename=$basename_gui
fi
all_ldflags="$all_ldflags $xflags"
if test $static_flag = yes ; then
wxlibs="$wxlibs @libdir@/lib${basename}_${lib}-${release}.a"
all_libs="$all_libs $xlibs"
else
wxlibs="$wxlibs -l${basename}_${lib}-${release}"
fi
done
echo $all_ldflags $wxlibs $all_libs
}
# return the absolute path prepending builddir to it if needed
makeabs()
@@ -34,7 +93,7 @@ usage()
{
cat <<EOF
Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
[--basename] [--static] [--libs] [--gl-libs]
[--basename] [--static] [--libs[=LIBS]] [--gl-libs]
[--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
[--cc] [--cxx] [--ld]
@@ -55,6 +114,12 @@ this:
Note that any other options supplied must come *after* the prefix
specification for it to take effect.
--static must come before --libs and --gl-libs.
--libs can take optional argument that contains comma-separated list of
wxWindows libraries to link against. This list can include both core
and contrib libraries.
EOF
exit $1
@@ -132,12 +197,10 @@ while test $# -gt 0; do
echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
;;
--release)
# Should echo @WX_RELEASE@ instead, but that doesn't seem to be replaced after
# configure has run on this file.
echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@
echo $release
;;
--basename)
echo @WX_LIBRARY_BASENAME@
echo $basename
;;
--static)
static_flag=yes
@@ -157,7 +220,19 @@ while test $# -gt 0; do
--rezflags)
echo @MACRESWXCONFIG@
;;
--libs)
--libs*)
# find if the argument was --libs=list,of,libs or --libs:
if test "x$optarg" = "x" ; then
if test "$is_monolithic" = "0" ; then
# link against all libs if none given explicitly:
libs_list="$CORE_GUI_LIBS $CORE_BASE_LIBS"
fi
else
libs_list=`echo "$optarg" | tr ',' ' '`
fi
# include install directory only if it is not default:
if test "@libdir@" != "/usr/lib" \
-a \( "${cross_compiling}" != "yes" \
-o "@libdir@" != "/usr/${target}/lib" \) ;
@@ -165,20 +240,35 @@ while test $# -gt 0; do
libs="-L@libdir@"
fi
if test $static_flag = yes ; then
echo "$libs @LDFLAGS@ @WXCONFIG_RPATH@ @libdir@/@WXCONFIG_LIBS_STATIC@ @EXTRALIBS_GUI@ @LIBS@ @DMALLOC_LIBS@"
# in monolithic build, link against the main library:
if test "$is_monolithic" = "1" ; then
# filter out core libs, leave only contrib in libs_list:
newlist=
for i in $libs_list ; do
if isinlist $i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
libs_list="" # do nothing
else
newlist="$newlist $i"
fi
done
libs_list="$newlist"
# output link flags:
contrib_libs=`output_libs $libs_list`
if test $static_flag = yes ; then
echo "$libs @LDFLAGS@ @WXCONFIG_RPATH@ $contrib_libs @libdir@/@WXCONFIG_LIBS_STATIC@ @EXTRALIBS_GUI@ @LIBS@ @DMALLOC_LIBS@"
else
echo $libs @LDFLAGS@ @WXCONFIG_RPATH@ $contrib_libs @WXCONFIG_LIBS@ @DMALLOC_LIBS@
fi
else
echo $libs @LDFLAGS@ @WXCONFIG_RPATH@ @WXCONFIG_LIBS@ @DMALLOC_LIBS@
# in multilib mode, link against all sublibraries:
wxlibs=`output_libs $libs_list`
echo $libs @WXCONFIG_RPATH@ $wxlibs @DMALLOC_LIBS@
fi
;;
--gl-libs)
if test $static_flag = yes -a "x" != "x@WXCONFIG_LIBS_STATIC_GL@" ; then
gllibs="@libdir@/@WXCONFIG_LIBS_STATIC_GL@"
else
gllibs="@WXCONFIG_LIBS_GL@"
fi
echo @LDFLAGS_GL@ $gllibs
output_libs gl
;;
--cc)
echo $CC