]>
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:
22 exec_prefix
="@exec_prefix@"
23 includedir
="@includedir@"
30 builddir
="@top_builddir_wxconfig@"
31 basename_nogui
="@WX_LIBRARY_BASENAME_NOGUI@"
32 basename_gui
="@WX_LIBRARY_BASENAME_GUI@"
34 TOOLCHAIN_NAME
="@TOOLCHAIN_NAME@"
36 WXCONFIG_RPATH
="@WXCONFIG_RPATH@"
37 DMALLOC_LIBS
="@DMALLOC_LIBS@"
38 WXCONFIG_LIBS
="@WXCONFIG_LIBS@"
39 WXCONFIG_LIBS_STATIC
="@WXCONFIG_LIBS_STATIC@"
40 WXDEBUG_DEFINE
="@WXDEBUG_DEFINE@"
41 TOOLCHAIN_DEFS
="@TOOLCHAIN_DEFS@"
42 TOOLCHAIN_DLL_DEFS
="@TOOLCHAIN_DLL_DEFS@"
43 WXCONFIG_INCLUDE
="@WXCONFIG_INCLUDE@"
44 WX_LARGEFILE_FLAGS
="@WX_LARGEFILE_FLAGS@"
45 CODE_GEN_FLAGS
="@CODE_GEN_FLAGS@"
46 CODE_GEN_FLAGS_CXX
="@CODE_GEN_FLAGS_CXX@"
47 LDFLAGS_EXE
="@LDFLAGS_EXE@"
48 MACRESWXCONFIG
="@MACRESWXCONFIG@"
49 EXTRALIBS_GUI
="@EXTRALIBS_GUI@"
53 # Linker flags for sublibraries:
55 CORE_BASE_LIBS
="xml net base"
56 CORE_GUI_LIBS
="html core"
58 ldlibs_base
="@WXCONFIG_EXTRALIBS@"
59 ldlibs_core
="@EXTRALIBS_GUI@"
60 ldlibs_xml
="@EXTRALIBS_XML@"
62 ldflags_gl
="@LDFLAGS_GL@"
63 ldlibs_gl
="@OPENGL_LIBS@"
67 # -------------------------------------------------------------------------
69 # -------------------------------------------------------------------------
73 # is $1 among the rest of arguments?
80 if test $iii = $value ; then isin
=yes ; fi
85 # output linker commands needed to link against libraries passed as arguments
86 # (does not handle monolithic/multilib):
89 if test "$cross_compiling" = "yes" ; then
90 target_tag
="-${target}"
98 eval xlibs
=\
$ldlibs_$lib
99 eval xflags
=\
$ldflags_$lib
100 if isinlist
$lib $CORE_BASE_LIBS ; then
101 basename=$basename_nogui
103 basename=$basename_gui
105 if test $lib = "base" ; then
108 libname
="${basename}_${lib}"
111 all_ldflags
="$all_ldflags $xflags"
112 if test $static_flag = yes ; then
113 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
114 all_libs
="$all_libs $xlibs"
116 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
120 echo $all_ldflags $wxlibs $all_libs
123 # return the absolute path prepending builddir to it if needed
127 # TODO: this only works under Unix and even there it could be
128 # enhanced to remove ".." and "."
129 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
130 if [ $path = "." ]; then
133 path
="$builddir/$path"
143 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
144 [--basename] [--static] [--libs[=LIBS]] [--gl-libs]
145 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
146 [--cc] [--cxx] [--ld]
148 wx-config returns configuration information about the installed
149 version of wxWindows. It may be used to query its version and
150 installation directories and also retrieve the C and C++ compilers
151 and linker which were used for its building and the corresponding
154 Ordinarily it should be installed to the appropriate system location
155 along with the headers and library files, but it is also possible to
156 use it to enable builds with an uninstalled wxWindows version for
157 package building and bleeding edge developers. To do so, use it like
160 \${wx_builddir}/wx-config --prefix=\${wx_srcdir} --exec-prefix=\${wx_builddir}
162 Note that any other options supplied must come *after* the prefix
163 specification for it to take effect.
165 --static must come before --libs and --gl-libs.
167 --libs can take optional argument that contains comma-separated list of
168 wxWindows libraries to link against. This list can include both core
169 and contrib libraries.
171 --gl-libs option is deprecated, used --libs=gl instead.
180 # we should never specify -I/usr/include on the compiler command line: this
181 # is at best useless and at worst breaks compilation on the systems where
182 # the system headers are non-ANSI because gcc works around this by storing
183 # the ANSI-fied versions of them in its private directory which is searched
184 # after all the directories on the cmd line.
186 # the situation is a bit more complicated with -I/usr/local/include: again,
187 # it shouldn't be specified with gcc which looks there by default anyhow
188 # and gives warnings (at least 3.1 does) if it is specified explicitly --
189 # but this -I switch *is* needed for the other compilers
191 # note that we assume that if we use GNU cc we also use GNU c++ and vice
192 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
193 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
194 # this when/if anybody complains about it
195 if test "${includedir}" != "/usr/include" \
196 -a "${includedir}" != "/usr/include/c++" \
197 -a \
( "${GCC}" != "yes" \
198 -o "${includedir}" != "/usr/local/include" \
) \
199 -a \
( "${cross_compiling}" != "yes" \
200 -o "${includedir}" != "/usr/${target}/include" \
) ;
202 includes
=" -I${includedir}"
205 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
207 if test $static_flag = yes ; then
208 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
210 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${TOOLCHAIN_DLL_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
214 if test $# -eq 0; then
218 while test $# -gt 0; do
220 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
226 prefix
=`makeabs $srcdir`
227 exec_prefix
=`makeabs $builddir`
232 if test $exec_prefix_set = no
; then
247 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
262 echo `cppflags` ${CODE_GEN_FLAGS}
265 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
271 echo ${MACRESWXCONFIG}
275 # find if the argument was --libs=list,of,libs or --libs:
276 if test "x$optarg" = "x" ; then
277 if test "$is_monolithic" = "0" ; then
278 # link against all libs if none given explicitly:
279 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
282 libs_list
=`echo "$optarg" | tr ',' ' '`
283 # always add wxBase, any wxApp needs it:
284 libs_list
="$libs_list base"
287 # include install directory only if it is not default:
288 if test "${libdir}" != "/usr/lib" \
289 -a \
( "${cross_compiling}" != "yes" \
290 -o "${libdir}" != "/usr/${target}/lib" \
) ;
295 # in monolithic build, link against the main library:
296 if test "$is_monolithic" = "1" ; then
297 # filter out core libs, leave only contrib in libs_list:
299 for i
in $libs_list ; do
300 if isinlist
$i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
301 libs_list
="" # do nothing
303 newlist
="$newlist $i"
309 contrib_libs
=`output_libs $libs_list`
310 if test $static_flag = yes ; then
311 echo "$libs ${LDFLAGS} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
313 echo $libs ${LDFLAGS} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
316 # in multilib mode, link against all sublibraries:
317 wxlibs
=`output_libs $libs_list`
318 echo $libs ${LDFLAGS} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}