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@"
32 GCC_SEARCHES_USR_LOCAL_INCLUDE
="@GCC_SEARCHES_USR_LOCAL_INCLUDE@"
36 builddir
="@top_builddir_wxconfig@"
37 basename_nogui
="@WX_LIBRARY_BASENAME_NOGUI@"
38 basename_gui
="@WX_LIBRARY_BASENAME_GUI@"
40 TOOLCHAIN_NAME
="@TOOLCHAIN_NAME@"
42 WXCONFIG_RPATH
="@WXCONFIG_RPATH@"
43 DMALLOC_LIBS
="@DMALLOC_LIBS@"
44 WXCONFIG_LIBS
="@WXCONFIG_LIBS@"
45 WXCONFIG_LIBS_STATIC
="@WXCONFIG_LIBS_STATIC@"
46 WXDEBUG_DEFINE
="@WXDEBUG_DEFINE@"
47 TOOLCHAIN_DEFS
="@TOOLCHAIN_DEFS@"
48 TOOLCHAIN_DLL_DEFS
="@TOOLCHAIN_DLL_DEFS@"
49 WXCONFIG_INCLUDE
="@WXCONFIG_INCLUDE@"
50 WX_LARGEFILE_FLAGS
="@WX_LARGEFILE_FLAGS@"
51 GCC_PRAGMA_FLAGS
="@GCC_PRAGMA_FLAGS@"
52 CODE_GEN_FLAGS
="@CODE_GEN_FLAGS@"
53 CODE_GEN_FLAGS_CXX
="@CODE_GEN_FLAGS_CXX@"
54 LDFLAGS_EXE
="@LDFLAGS_EXE@"
55 MACRESWXCONFIG
="@MACRESWXCONFIG@"
56 EXTRALIBS_GUI
="@EXTRALIBS_GUI@"
58 WXCONFIG_LDFLAGS_GUI
="@WXCONFIG_LDFLAGS_GUI@"
61 # Linker flags for sublibraries:
63 CORE_BASE_LIBS
="@CORE_BASE_LIBS@"
64 CORE_GUI_LIBS
="@CORE_GUI_LIBS@"
66 ldlibs_base
="@WXCONFIG_EXTRALIBS@"
67 ldlibs_core
="@EXTRALIBS_GUI@"
68 ldlibs_xml
="@EXTRALIBS_XML@"
69 ldlibs_html
="@EXTRALIBS_HTML@"
70 ldlibs_odbc
="@EXTRALIBS_ODBC@"
71 ldlibs_adv
="@EXTRALIBS_SDL@"
73 ldflags_gl
="@LDFLAGS_GL@"
74 ldlibs_gl
="@OPENGL_LIBS@"
78 # -------------------------------------------------------------------------
80 # -------------------------------------------------------------------------
84 # is $1 among the rest of arguments?
91 if test $iii = $value ; then isin
=yes ; fi
96 # output linker commands needed to link against libraries passed as arguments
97 # (does not handle monolithic/multilib):
100 if test "$cross_compiling" = "yes" ; then
101 target_tag
="-${target}"
109 eval xlibs
=\
$ldlibs_$lib
110 eval xflags
=\
$ldflags_$lib
111 if isinlist
$lib $CORE_BASE_LIBS ; then
112 basename=$basename_nogui
114 basename=$basename_gui
116 if test $lib = "base" ; then
119 libname
="${basename}_${lib}"
122 all_ldflags
="$all_ldflags $xflags"
123 if test $static_flag = yes ; then
124 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
125 all_libs
="$all_libs $xlibs"
127 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
131 echo $all_ldflags $wxlibs $all_libs
134 # output $(WXCONFIG_LDFLAGS_GUI) if any of libs passed as arguments is GUI
135 # library, nothing otherwise:
140 if isinlist
$lib $CORE_GUI_LIBS ; then
141 flags_to_ret
="$WXCONFIG_LDFLAGS_GUI"
150 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--inplace]
151 [--toolkit=TOOLKIT] [--unicode[=yes|no]] [--debug[=yes|no]]
152 [--universal[=yes|no]] [--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 --libs can take optional argument that contains comma-separated list of
178 wxWidgets libraries to link against. This list can include both core
179 and contrib libraries. Special value "std" stands for all libraries linked
182 --gl-libs option is deprecated, use "--libs gl" instead.
184 If there are several different builds of wxWidgets installed in same prefix,
185 you can use --toolkit, --unicode, --debug, --universal and --version options
186 to select one of them. Use --list option to show all available builds that
187 match given criteria.
196 # we should never specify -I/usr/include on the compiler command line: this
197 # is at best useless and at worst breaks compilation on the systems where
198 # the system headers are non-ANSI because gcc works around this by storing
199 # the ANSI-fied versions of them in its private directory which is searched
200 # after all the directories on the cmd line.
202 # the situation is a bit more complicated with -I/usr/local/include:
203 # it shouldn't be specified with some gcc installations which look there
204 # by default anyhow and give warnings (at least 3.1 does) if it is
205 # specified explicitly --
206 # but this -I switch *is* needed for other gcc installation and for
207 # the other compilers.
208 # So I put a suitable test into configure.in and reuse the result here.
210 # note that we assume that if we use GNU cc we also use GNU c++ and vice
211 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
212 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
213 # this when/if anybody complains about it
214 if test "${includedir}" != "/usr/include" \
215 -a "${includedir}" != "/usr/include/c++" \
216 -a \
( "${GCC_SEARCHES_USR_LOCAL_INCLUDE}" != "yes" \
217 -o "${includedir}" != "/usr/local/include" \
) \
218 -a \
( "${cross_compiling}" != "yes" \
219 -o "${includedir}" != "/usr/${target}/include" \
) ;
221 includes
=" -I${includedir}"
224 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
226 # in inplace case we need to also add path to contrib headers -- do it
227 # unconditionally as they might be used and we have no way of knowing if
229 if test $inplace_flag = yes ; then
230 includes
="$includes -I${prefix}/contrib/include"
233 flags
="$includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS}"
234 if test $static_flag != yes ; then
235 flags
="$flags ${TOOLCHAIN_DLL_DEFS}"
238 if test $nogui_flag = "yes" ; then
239 flags
="$flags -DwxUSE_GUI=0"
242 echo "$flags${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS} ${GCC_PRAGMA_FLAGS}"
245 if test $# -eq 0; then
250 # handle libraries list:
259 libs_list
="$libs_list `echo "$arg" | tr ',' ' '`"
264 if test "x$libs_list" = "x" ; then
265 if test "$is_monolithic" = "0" ; then
266 # link against all libs if none given explicitly:
267 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
270 # always add wxBase, any wxApp needs it:
271 libs_list
="$libs_list base"
274 # determine if at least one gui lib was used:
276 for i
in $libs_list; do
289 while test $# -gt 0; do
291 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
301 if test $exec_prefix_set = no
; then
318 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
333 echo `cppflags` ${CODE_GEN_FLAGS}
336 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
342 echo `eval echo ${MACRESWXCONFIG}`
346 # include install directory only if it is not default:
347 if test "${libdir}" != "/usr/lib" \
348 -a \
( "${cross_compiling}" != "yes" \
349 -o "${libdir}" != "/usr/${target}/lib" \
) ;
354 # it's simpler to avoid handling "base" itself at all as we add it in the
355 # end to the list of libraries anyhow
356 # in monolithic build, link against the main library:
357 if test "$is_monolithic" = "1" ; then
358 # filter out core libs, leave only contrib in libs_list:
360 for i
in $libs_list ; do
361 if isinlist
$i $CORE_GUI_LIBS $CORE_BASE_LIBS; then
362 libs_list
="" # do nothing
364 newlist
="$newlist $i"
370 contrib_libs
=`output_libs $libs_list`
371 if test $static_flag = yes ; then
372 echo "$libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
374 echo $libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
377 # we may need to replace "std" alias with its expansion
380 for i
in $libs_list; do
387 # if we have std, we're going to add base anyhow, avoid
388 # having it twice in the end
389 if [ $hadstd = 0 ]; then
390 newlist
="$newlist $i"
395 newlist
="$newlist $i"
400 if [ $hadstd = 1 ]; then
401 libs_list
="$libs_list $CORE_GUI_LIBS $CORE_BASE_LIBS"
404 # in multilib mode, link against all sublibraries:
405 wxlibs
=`output_libs $libs_list`
406 guildflags
=`get_ldflags_gui $libs_list`
407 echo $libs ${LDFLAGS} ${guildflags} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}
427 # unrecognized flag is error