]>
git.saurik.com Git - wxWidgets.git/blob - wx-config.in
3 # -------------------------------------------------------------------------
5 # -------------------------------------------------------------------------
7 # Version and build type information:
9 WX_MAJOR_VERSION_NUMBER
="@WX_MAJOR_VERSION_NUMBER@"
10 WX_MINOR_VERSION_NUMBER
="@WX_MINOR_VERSION_NUMBER@"
11 WX_RELEASE_NUMBER
="@WX_RELEASE_NUMBER@"
12 release
="@WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@"
13 is_monolithic
="@MONOLITHIC@"
14 cross_compiling
="@cross_compiling@"
16 static_flag
="@STATIC_FLAG@"
19 # Misc configuration variables:
23 includedir
="@includedir@"
27 exec_prefix
="@exec_prefix@"
35 builddir
="@top_builddir_wxconfig@"
36 basename_nogui
="@WX_LIBRARY_BASENAME_NOGUI@"
37 basename_gui
="@WX_LIBRARY_BASENAME_GUI@"
39 TOOLCHAIN_NAME
="@TOOLCHAIN_NAME@"
41 WXCONFIG_RPATH
="@WXCONFIG_RPATH@"
42 DMALLOC_LIBS
="@DMALLOC_LIBS@"
43 WXCONFIG_LIBS
="@WXCONFIG_LIBS@"
44 WXCONFIG_LIBS_STATIC
="@WXCONFIG_LIBS_STATIC@"
45 WXDEBUG_DEFINE
="@WXDEBUG_DEFINE@"
46 TOOLCHAIN_DEFS
="@TOOLCHAIN_DEFS@"
47 TOOLCHAIN_DLL_DEFS
="@TOOLCHAIN_DLL_DEFS@"
48 WXCONFIG_INCLUDE
="@WXCONFIG_INCLUDE@"
49 WX_LARGEFILE_FLAGS
="@WX_LARGEFILE_FLAGS@"
50 GCC_PRAGMA_FLAGS
="@GCC_PRAGMA_FLAGS@"
51 CODE_GEN_FLAGS
="@CODE_GEN_FLAGS@"
52 CODE_GEN_FLAGS_CXX
="@CODE_GEN_FLAGS_CXX@"
53 LDFLAGS_EXE
="@LDFLAGS_EXE@"
54 MACRESWXCONFIG
="@MACRESWXCONFIG@"
55 EXTRALIBS_GUI
="@EXTRALIBS_GUI@"
57 WXCONFIG_LDFLAGS_GUI
="@WXCONFIG_LDFLAGS_GUI@"
60 # Linker flags for sublibraries:
62 CORE_BASE_LIBS
="@CORE_BASE_LIBS@"
63 CORE_GUI_LIBS
="@CORE_GUI_LIBS@"
65 ldlibs_base
="@WXCONFIG_EXTRALIBS@"
66 ldlibs_core
="@EXTRALIBS_GUI@"
67 ldlibs_xml
="@EXTRALIBS_XML@"
68 ldlibs_html
="@EXTRALIBS_HTML@"
69 ldlibs_odbc
="@EXTRALIBS_ODBC@"
70 ldlibs_adv
="@EXTRALIBS_SDL@"
72 ldflags_gl
="@LDFLAGS_GL@"
73 ldlibs_gl
="@OPENGL_LIBS@"
77 # -------------------------------------------------------------------------
79 # -------------------------------------------------------------------------
83 # is $1 among the rest of arguments?
90 if test $iii = $value ; then isin
=yes ; fi
95 # output linker commands needed to link against libraries passed as arguments
96 # (does not handle monolithic/multilib):
99 if test "$cross_compiling" = "yes" ; then
100 target_tag
="-${target}"
108 eval xlibs
=\
$ldlibs_$lib
109 eval xflags
=\
$ldflags_$lib
110 if isinlist
$lib $CORE_BASE_LIBS ; then
111 basename=$basename_nogui
113 basename=$basename_gui
115 if test $lib = "base" ; then
118 libname
="${basename}_${lib}"
121 all_ldflags
="$all_ldflags $xflags"
122 if test $static_flag = yes ; then
123 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
124 all_libs
="$all_libs $xlibs"
126 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
130 echo $all_ldflags $wxlibs $all_libs
133 # output $(WXCONFIG_LDFLAGS_GUI) if any of libs passed as arguments is GUI
134 # library, nothing otherwise:
139 if isinlist
$lib $CORE_GUI_LIBS ; then
140 flags_to_ret
="$WXCONFIG_LDFLAGS_GUI"
149 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--inplace]
150 [--toolkit=TOOLKIT] [--unicode[=yes|no]] [--debug[=yes|no]]
151 [--universal[=yes|no]] [--host=HOST]
152 [--version[=VERSION]] [--release]
153 [--list] [--basename] [--static] [--libs] [--gl-libs]
154 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
155 [--cc] [--cxx] [--ld] [LIBRARIES]
157 wx-config returns configuration information about the installed
158 version of wxWidgets. It may be used to query its version and
159 installation directories and also retrieve the C and C++ compilers
160 and linker which were used for its building and the corresponding
163 Ordinarily it should be installed to the appropriate system location
164 along with the headers and library files, but it is also possible to
165 use it to enable builds with an uninstalled wxWidgets version for
166 package building and bleeding edge developers. To do so, use it like
169 \${wx_builddir}/wx-config --inplace
171 Note that any other options supplied must come *after* --inplace
172 for it to take effect.
174 --static must come before --cppflags, --cflags, --cxxflags,
175 --libs and --gl-libs and --libs must come before the other ones.
177 wx-config can take optional argument that contains comma- or space-separated
178 list of wxWidgets libraries to compile and link against. This list can
179 include both core and contrib libraries. Special value "std" stands for all
180 libraries linked in by default. Examples: "wx-config --libs core,base"
181 or "wx-config --cxxflags core,base".
183 --gl-libs option is deprecated, use "--libs gl" instead.
185 If there are several different builds of wxWidgets installed in same prefix,
186 you can use --host, --toolkit, --unicode, --debug, --universal and --version
187 options to select one of them. Use --list option to show all available builds
188 that match given criteria.
197 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}"
199 # in inplace case we need to also add path to contrib headers -- do it
200 # unconditionally as they might be used and we have no way of knowing if
202 if test $inplace_flag = yes ; then
203 includes
="$includes -I${prefix}/include -I${prefix}/contrib/include"
205 includes
="$includes -I${includedir}/wx-${WX_MAJOR_VERSION_NUMBER}.${WX_MINOR_VERSION_NUMBER}"
208 flags
="$includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS}"
209 if test $static_flag != yes ; then
210 flags
="$flags ${TOOLCHAIN_DLL_DEFS}"
213 if test $nogui_flag = "yes" ; then
214 flags
="$flags -DwxUSE_GUI=0"
217 echo "$flags${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS} ${GCC_PRAGMA_FLAGS}"
220 if test $# -eq 0; then
225 # handle libraries list:
234 libs_list
="$libs_list `echo "$arg" | tr ',' ' '`"
239 if test "x$libs_list" = "x" ; then
240 if test "$is_monolithic" = "0" ; then
241 # link against all libs if none given explicitly:
242 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
245 # always add wxBase, any wxApp needs it:
246 libs_list
="$libs_list base"
249 # determine if at least one gui lib was used:
251 for i
in $libs_list; do
264 while test $# -gt 0; do
266 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
276 if test $exec_prefix_set = no
; then
293 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
308 echo `cppflags` ${CODE_GEN_FLAGS}
311 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
317 echo `eval echo ${MACRESWXCONFIG}`
321 # include install directory only if it is not default:
322 if test "${libdir}" != "/usr/lib" \
323 -a \
( "${cross_compiling}" != "yes" \
324 -o "${libdir}" != "/usr/${target}/lib" \
) ;
329 # it's simpler to avoid handling "base" itself at all as we add it in the
330 # end to the list of libraries anyhow
331 # in monolithic build, link against the main library:
332 if test "$is_monolithic" = "1" ; then
333 # filter out core libs, leave only contrib in libs_list:
335 for i
in $libs_list ; do
336 if isinlist
$i $CORE_GUI_LIBS $CORE_BASE_LIBS; then
337 libs_list
="" # do nothing
339 newlist
="$newlist $i"
345 contrib_libs
=`output_libs $libs_list`
346 if test $static_flag = yes ; then
347 echo "$libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
349 echo $libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
352 # we may need to replace "std" alias with its expansion
355 for i
in $libs_list; do
362 # if we have std, we're going to add base anyhow, avoid
363 # having it twice in the end
364 if [ $hadstd = 0 ]; then
365 newlist
="$newlist $i"
370 newlist
="$newlist $i"
375 if [ $hadstd = 1 ]; then
376 libs_list
="$libs_list $CORE_GUI_LIBS $CORE_BASE_LIBS"
379 # in multilib mode, link against all sublibraries:
380 wxlibs
=`output_libs $libs_list`
381 guildflags
=`get_ldflags_gui $libs_list`
382 echo $libs ${LDFLAGS} ${guildflags} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}
402 # unrecognized flag is error