]>
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 odbc adv core"
58 ldlibs_base
="@WXCONFIG_EXTRALIBS@"
59 ldlibs_core
="@EXTRALIBS_GUI@"
60 ldlibs_xml
="@EXTRALIBS_XML@"
61 ldlibs_odbc
="@EXTRALIBS_ODBC@"
63 ldflags_gl
="@LDFLAGS_GL@"
64 ldlibs_gl
="@OPENGL_LIBS@"
68 # -------------------------------------------------------------------------
70 # -------------------------------------------------------------------------
74 # is $1 among the rest of arguments?
81 if test $iii = $value ; then isin
=yes ; fi
86 # output linker commands needed to link against libraries passed as arguments
87 # (does not handle monolithic/multilib):
90 if test "$cross_compiling" = "yes" ; then
91 target_tag
="-${target}"
99 eval xlibs
=\
$ldlibs_$lib
100 eval xflags
=\
$ldflags_$lib
101 if isinlist
$lib $CORE_BASE_LIBS ; then
102 basename=$basename_nogui
104 basename=$basename_gui
106 if test $lib = "base" ; then
109 libname
="${basename}_${lib}"
112 all_ldflags
="$all_ldflags $xflags"
113 if test $static_flag = yes ; then
114 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
115 all_libs
="$all_libs $xlibs"
117 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
121 echo $all_ldflags $wxlibs $all_libs
124 # return the absolute path prepending builddir to it if needed
128 # TODO: this only works under Unix and even there it could be
129 # enhanced to remove ".." and "."
130 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
131 if [ $path = "." ]; then
134 path
="$builddir/$path"
144 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
145 [--basename] [--static] [--libs[=LIBS]] [--gl-libs]
146 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
147 [--cc] [--cxx] [--ld]
149 wx-config returns configuration information about the installed
150 version of wxWindows. It may be used to query its version and
151 installation directories and also retrieve the C and C++ compilers
152 and linker which were used for its building and the corresponding
155 Ordinarily it should be installed to the appropriate system location
156 along with the headers and library files, but it is also possible to
157 use it to enable builds with an uninstalled wxWindows version for
158 package building and bleeding edge developers. To do so, use it like
161 \${wx_builddir}/wx-config --prefix=\${wx_srcdir} --exec-prefix=\${wx_builddir}
163 Note that any other options supplied must come *after* the prefix
164 specification for it to take effect.
166 --static must come before --libs and --gl-libs.
168 --libs can take optional argument that contains comma-separated list of
169 wxWindows libraries to link against. This list can include both core
170 and contrib libraries.
172 --gl-libs option is deprecated, used --libs=gl instead.
181 # we should never specify -I/usr/include on the compiler command line: this
182 # is at best useless and at worst breaks compilation on the systems where
183 # the system headers are non-ANSI because gcc works around this by storing
184 # the ANSI-fied versions of them in its private directory which is searched
185 # after all the directories on the cmd line.
187 # the situation is a bit more complicated with -I/usr/local/include: again,
188 # it shouldn't be specified with gcc which looks there by default anyhow
189 # and gives warnings (at least 3.1 does) if it is specified explicitly --
190 # but this -I switch *is* needed for the other compilers
192 # note that we assume that if we use GNU cc we also use GNU c++ and vice
193 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
194 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
195 # this when/if anybody complains about it
196 if test "${includedir}" != "/usr/include" \
197 -a "${includedir}" != "/usr/include/c++" \
198 -a \
( "${GCC}" != "yes" \
199 -o "${includedir}" != "/usr/local/include" \
) \
200 -a \
( "${cross_compiling}" != "yes" \
201 -o "${includedir}" != "/usr/${target}/include" \
) ;
203 includes
=" -I${includedir}"
206 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
208 if test $static_flag = yes ; then
209 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
211 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${TOOLCHAIN_DLL_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
215 if test $# -eq 0; then
219 while test $# -gt 0; do
221 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
227 prefix
=`makeabs $srcdir`
228 exec_prefix
=`makeabs $builddir`
233 if test $exec_prefix_set = no
; then
248 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
263 echo `cppflags` ${CODE_GEN_FLAGS}
266 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
272 echo ${MACRESWXCONFIG}
276 # find if the argument was --libs=list,of,libs or --libs:
277 if test "x$optarg" = "x" ; then
278 if test "$is_monolithic" = "0" ; then
279 # link against all libs if none given explicitly:
280 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
283 libs_list
=`echo "$optarg" | tr ',' ' '`
284 # always add wxBase, any wxApp needs it:
285 libs_list
="$libs_list base"
288 # include install directory only if it is not default:
289 if test "${libdir}" != "/usr/lib" \
290 -a \
( "${cross_compiling}" != "yes" \
291 -o "${libdir}" != "/usr/${target}/lib" \
) ;
296 # in monolithic build, link against the main library:
297 if test "$is_monolithic" = "1" ; then
298 # filter out core libs, leave only contrib in libs_list:
300 for i
in $libs_list ; do
301 if isinlist
$i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
302 libs_list
="" # do nothing
304 newlist
="$newlist $i"
310 contrib_libs
=`output_libs $libs_list`
311 if test $static_flag = yes ; then
312 echo "$libs ${LDFLAGS} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
314 echo $libs ${LDFLAGS} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
317 # in multilib mode, link against all sublibraries:
318 wxlibs
=`output_libs $libs_list`
319 echo $libs ${LDFLAGS} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}