]>
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 CODE_GEN_FLAGS
="@CODE_GEN_FLAGS@"
51 CODE_GEN_FLAGS_CXX
="@CODE_GEN_FLAGS_CXX@"
52 LDFLAGS_EXE
="@LDFLAGS_EXE@"
53 MACRESWXCONFIG
="@MACRESWXCONFIG@"
54 EXTRALIBS_GUI
="@EXTRALIBS_GUI@"
56 WXCONFIG_LDFLAGS_GUI
="@WXCONFIG_LDFLAGS_GUI@"
59 # Linker flags for sublibraries:
61 CORE_BASE_LIBS
="@CORE_BASE_LIBS@"
62 CORE_GUI_LIBS
="@CORE_GUI_LIBS@"
64 ldlibs_base
="@WXCONFIG_EXTRALIBS@"
65 ldlibs_core
="@EXTRALIBS_GUI@"
66 ldlibs_xml
="@EXTRALIBS_XML@"
67 ldlibs_odbc
="@EXTRALIBS_ODBC@"
69 ldflags_gl
="@LDFLAGS_GL@"
70 ldlibs_gl
="@OPENGL_LIBS@"
74 # -------------------------------------------------------------------------
76 # -------------------------------------------------------------------------
80 # is $1 among the rest of arguments?
87 if test $iii = $value ; then isin
=yes ; fi
92 # output linker commands needed to link against libraries passed as arguments
93 # (does not handle monolithic/multilib):
96 if test "$cross_compiling" = "yes" ; then
97 target_tag
="-${target}"
105 eval xlibs
=\
$ldlibs_$lib
106 eval xflags
=\
$ldflags_$lib
107 if isinlist
$lib $CORE_BASE_LIBS ; then
108 basename=$basename_nogui
110 basename=$basename_gui
112 if test $lib = "base" ; then
115 libname
="${basename}_${lib}"
118 all_ldflags
="$all_ldflags $xflags"
119 if test $static_flag = yes ; then
120 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
121 all_libs
="$all_libs $xlibs"
123 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
127 echo $all_ldflags $wxlibs $all_libs
130 # output $(WXCONFIG_LDFLAGS_GUI) if any of libs passed as arguments is GUI
131 # library, nothing otherwise:
136 if isinlist
$lib $CORE_GUI_LIBS ; then
137 flags_to_ret
="$WXCONFIG_LDFLAGS_GUI"
143 # return the absolute path prepending builddir to it if needed
147 # TODO: this only works under Unix and even there it could be
148 # enhanced to remove ".." and "."
149 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
150 if [ $path = "." ]; then
153 path
="$builddir/$path"
163 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
164 [--basename] [--static] [--libs[=LIBS]] [--gl-libs]
165 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
166 [--cc] [--cxx] [--ld]
168 wx-config returns configuration information about the installed
169 version of wxWindows. It may be used to query its version and
170 installation directories and also retrieve the C and C++ compilers
171 and linker which were used for its building and the corresponding
174 Ordinarily it should be installed to the appropriate system location
175 along with the headers and library files, but it is also possible to
176 use it to enable builds with an uninstalled wxWindows version for
177 package building and bleeding edge developers. To do so, use it like
180 \${wx_builddir}/wx-config --prefix=\${wx_srcdir} --exec-prefix=\${wx_builddir}
182 Note that any other options supplied must come *after* the prefix
183 specification for it to take effect.
185 --static must come before --libs and --gl-libs.
187 --libs can take optional argument that contains comma-separated list of
188 wxWindows libraries to link against. This list can include both core
189 and contrib libraries.
191 --gl-libs option is deprecated, used --libs=gl instead.
200 # we should never specify -I/usr/include on the compiler command line: this
201 # is at best useless and at worst breaks compilation on the systems where
202 # the system headers are non-ANSI because gcc works around this by storing
203 # the ANSI-fied versions of them in its private directory which is searched
204 # after all the directories on the cmd line.
206 # the situation is a bit more complicated with -I/usr/local/include: again,
207 # it shouldn't be specified with gcc which looks there by default anyhow
208 # and gives warnings (at least 3.1 does) if it is specified explicitly --
209 # but this -I switch *is* needed for the other compilers
211 # note that we assume that if we use GNU cc we also use GNU c++ and vice
212 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
213 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
214 # this when/if anybody complains about it
215 if test "${includedir}" != "/usr/include" \
216 -a "${includedir}" != "/usr/include/c++" \
217 -a \
( "${GCC}" != "yes" \
218 -o "${includedir}" != "/usr/local/include" \
) \
219 -a \
( "${cross_compiling}" != "yes" \
220 -o "${includedir}" != "/usr/${target}/include" \
) ;
222 includes
=" -I${includedir}"
225 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
227 if test $static_flag = yes ; then
228 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
230 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${TOOLCHAIN_DLL_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
234 if test $# -eq 0; then
238 while test $# -gt 0; do
240 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
246 prefix
=`makeabs $srcdir`
247 exec_prefix
=`makeabs $builddir`
253 if test $exec_prefix_set = no
; then
270 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
285 echo `cppflags` ${CODE_GEN_FLAGS}
288 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
294 echo ${MACRESWXCONFIG}
298 # find if the argument was --libs=list,of,libs or --libs:
299 if test "x$optarg" = "x" ; then
300 if test "$is_monolithic" = "0" ; then
301 # link against all libs if none given explicitly:
302 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
305 libs_list
=`echo "$optarg" | tr ',' ' '`
306 # always add wxBase, any wxApp needs it:
307 libs_list
="$libs_list base"
310 # include install directory only if it is not default:
311 if test "${libdir}" != "/usr/lib" \
312 -a \
( "${cross_compiling}" != "yes" \
313 -o "${libdir}" != "/usr/${target}/lib" \
) ;
318 # in monolithic build, link against the main library:
319 if test "$is_monolithic" = "1" ; then
320 # filter out core libs, leave only contrib in libs_list:
322 for i
in $libs_list ; do
323 if isinlist
$i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
324 libs_list
="" # do nothing
326 newlist
="$newlist $i"
332 contrib_libs
=`output_libs $libs_list`
333 if test $static_flag = yes ; then
334 echo "$libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
336 echo $libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
339 # in multilib mode, link against all sublibraries:
340 wxlibs
=`output_libs $libs_list`
341 guildflags
=`get_ldflags_gui $libs_list`
342 echo $libs ${LDFLAGS} ${guildflags} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}