]>
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_html
="@EXTRALIBS_HTML@"
68 ldlibs_odbc
="@EXTRALIBS_ODBC@"
70 ldflags_gl
="@LDFLAGS_GL@"
71 ldlibs_gl
="@OPENGL_LIBS@"
75 # -------------------------------------------------------------------------
77 # -------------------------------------------------------------------------
81 # is $1 among the rest of arguments?
88 if test $iii = $value ; then isin
=yes ; fi
93 # output linker commands needed to link against libraries passed as arguments
94 # (does not handle monolithic/multilib):
97 if test "$cross_compiling" = "yes" ; then
98 target_tag
="-${target}"
106 eval xlibs
=\
$ldlibs_$lib
107 eval xflags
=\
$ldflags_$lib
108 if isinlist
$lib $CORE_BASE_LIBS ; then
109 basename=$basename_nogui
111 basename=$basename_gui
113 if test $lib = "base" ; then
116 libname
="${basename}_${lib}"
119 all_ldflags
="$all_ldflags $xflags"
120 if test $static_flag = yes ; then
121 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
122 all_libs
="$all_libs $xlibs"
124 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
128 echo $all_ldflags $wxlibs $all_libs
131 # output $(WXCONFIG_LDFLAGS_GUI) if any of libs passed as arguments is GUI
132 # library, nothing otherwise:
137 if isinlist
$lib $CORE_GUI_LIBS ; then
138 flags_to_ret
="$WXCONFIG_LDFLAGS_GUI"
144 # return the absolute path prepending builddir to it if needed
148 # TODO: this only works under Unix and even there it could be
149 # enhanced to remove ".." and "."
150 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
151 if [ $path = "." ]; then
154 path
="$builddir/$path"
164 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
165 [--basename] [--static] [--libs[=LIBS]] [--gl-libs]
166 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
167 [--cc] [--cxx] [--ld]
169 wx-config returns configuration information about the installed
170 version of wxWindows. It may be used to query its version and
171 installation directories and also retrieve the C and C++ compilers
172 and linker which were used for its building and the corresponding
175 Ordinarily it should be installed to the appropriate system location
176 along with the headers and library files, but it is also possible to
177 use it to enable builds with an uninstalled wxWindows version for
178 package building and bleeding edge developers. To do so, use it like
181 \${wx_builddir}/wx-config --prefix=\${wx_srcdir} --exec-prefix=\${wx_builddir}
183 Note that any other options supplied must come *after* the prefix
184 specification for it to take effect.
186 --static must come before --libs and --gl-libs.
188 --libs can take optional argument that contains comma-separated list of
189 wxWindows libraries to link against. This list can include both core
190 and contrib libraries.
192 --gl-libs option is deprecated, used --libs=gl instead.
201 # we should never specify -I/usr/include on the compiler command line: this
202 # is at best useless and at worst breaks compilation on the systems where
203 # the system headers are non-ANSI because gcc works around this by storing
204 # the ANSI-fied versions of them in its private directory which is searched
205 # after all the directories on the cmd line.
207 # the situation is a bit more complicated with -I/usr/local/include: again,
208 # it shouldn't be specified with gcc which looks there by default anyhow
209 # and gives warnings (at least 3.1 does) if it is specified explicitly --
210 # but this -I switch *is* needed for the other compilers
212 # note that we assume that if we use GNU cc we also use GNU c++ and vice
213 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
214 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
215 # this when/if anybody complains about it
216 if test "${includedir}" != "/usr/include" \
217 -a "${includedir}" != "/usr/include/c++" \
218 -a \
( "${GCC}" != "yes" \
219 -o "${includedir}" != "/usr/local/include" \
) \
220 -a \
( "${cross_compiling}" != "yes" \
221 -o "${includedir}" != "/usr/${target}/include" \
) ;
223 includes
=" -I${includedir}"
226 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
228 if test $static_flag = yes ; then
229 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
231 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${TOOLCHAIN_DLL_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
235 if test $# -eq 0; then
239 while test $# -gt 0; do
241 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
247 prefix
=`makeabs $srcdir`
248 exec_prefix
=`makeabs $builddir`
254 if test $exec_prefix_set = no
; then
271 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
286 echo `cppflags` ${CODE_GEN_FLAGS}
289 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
295 echo `eval echo ${MACRESWXCONFIG}`
299 # find if the argument was --libs=list,of,libs or --libs:
300 if test "x$optarg" = "x" ; then
301 if test "$is_monolithic" = "0" ; then
302 # link against all libs if none given explicitly:
303 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
306 libs_list
=`echo "$optarg" | tr ',' ' '`
307 # always add wxBase, any wxApp needs it:
308 libs_list
="$libs_list base"
311 # include install directory only if it is not default:
312 if test "${libdir}" != "/usr/lib" \
313 -a \
( "${cross_compiling}" != "yes" \
314 -o "${libdir}" != "/usr/${target}/lib" \
) ;
319 # in monolithic build, link against the main library:
320 if test "$is_monolithic" = "1" ; then
321 # filter out core libs, leave only contrib in libs_list:
323 for i
in $libs_list ; do
324 if isinlist
$i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
325 libs_list
="" # do nothing
327 newlist
="$newlist $i"
333 contrib_libs
=`output_libs $libs_list`
334 if test $static_flag = yes ; then
335 echo "$libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
337 echo $libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
340 # in multilib mode, link against all sublibraries:
341 wxlibs
=`output_libs $libs_list`
342 guildflags
=`get_ldflags_gui $libs_list`
343 echo $libs ${LDFLAGS} ${guildflags} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}