]>
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@"
69 ldlibs_adv
="@EXTRALIBS_SDL@"
71 ldflags_gl
="@LDFLAGS_GL@"
72 ldlibs_gl
="@OPENGL_LIBS@"
76 # -------------------------------------------------------------------------
78 # -------------------------------------------------------------------------
82 # is $1 among the rest of arguments?
89 if test $iii = $value ; then isin
=yes ; fi
94 # output linker commands needed to link against libraries passed as arguments
95 # (does not handle monolithic/multilib):
98 if test "$cross_compiling" = "yes" ; then
99 target_tag
="-${target}"
107 eval xlibs
=\
$ldlibs_$lib
108 eval xflags
=\
$ldflags_$lib
109 if isinlist
$lib $CORE_BASE_LIBS ; then
110 basename=$basename_nogui
112 basename=$basename_gui
114 if test $lib = "base" ; then
117 libname
="${basename}_${lib}"
120 all_ldflags
="$all_ldflags $xflags"
121 if test $static_flag = yes ; then
122 wxlibs
="$wxlibs ${libdir}/lib${libname}-${release}${target_tag}.a"
123 all_libs
="$all_libs $xlibs"
125 wxlibs
="$wxlibs -l${libname}-${release}${target_tag}"
129 echo $all_ldflags $wxlibs $all_libs
132 # output $(WXCONFIG_LDFLAGS_GUI) if any of libs passed as arguments is GUI
133 # library, nothing otherwise:
138 if isinlist
$lib $CORE_GUI_LIBS ; then
139 flags_to_ret
="$WXCONFIG_LDFLAGS_GUI"
145 # return the absolute path prepending builddir to it if needed
149 # TODO: this only works under Unix and even there it could be
150 # enhanced to remove ".." and "."
151 if [ `echo $path | sed 's/^\(.\).*/\1/'` != "/" ]; then
152 if [ $path = "." ]; then
155 path
="$builddir/$path"
165 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--release]
166 [--basename] [--static] [--libs[=LIBS]] [--gl-libs]
167 [--cppflags] [--cflags] [--cxxflags] [--ldflags] [--rezflags]
168 [--cc] [--cxx] [--ld]
170 wx-config returns configuration information about the installed
171 version of wxWindows. It may be used to query its version and
172 installation directories and also retrieve the C and C++ compilers
173 and linker which were used for its building and the corresponding
176 Ordinarily it should be installed to the appropriate system location
177 along with the headers and library files, but it is also possible to
178 use it to enable builds with an uninstalled wxWindows version for
179 package building and bleeding edge developers. To do so, use it like
182 \${wx_builddir}/wx-config --prefix=\${wx_srcdir} --exec-prefix=\${wx_builddir}
184 Note that any other options supplied must come *after* the prefix
185 specification for it to take effect.
187 --static must come before --libs and --gl-libs.
189 --libs can take optional argument that contains comma-separated list of
190 wxWindows libraries to link against. This list can include both core
191 and contrib libraries.
193 --gl-libs option is deprecated, used --libs=gl instead.
202 # we should never specify -I/usr/include on the compiler command line: this
203 # is at best useless and at worst breaks compilation on the systems where
204 # the system headers are non-ANSI because gcc works around this by storing
205 # the ANSI-fied versions of them in its private directory which is searched
206 # after all the directories on the cmd line.
208 # the situation is a bit more complicated with -I/usr/local/include: again,
209 # it shouldn't be specified with gcc which looks there by default anyhow
210 # and gives warnings (at least 3.1 does) if it is specified explicitly --
211 # but this -I switch *is* needed for the other compilers
213 # note that we assume that if we use GNU cc we also use GNU c++ and vice
214 # versa, i.e. this won't work (either for --cflags or --cxxflags) if GNU C
215 # compiler and non-GNU C++ compiler are used or vice versa -- we'll fix
216 # this when/if anybody complains about it
217 if test "${includedir}" != "/usr/include" \
218 -a "${includedir}" != "/usr/include/c++" \
219 -a \
( "${GCC}" != "yes" \
220 -o "${includedir}" != "/usr/local/include" \
) \
221 -a \
( "${cross_compiling}" != "yes" \
222 -o "${includedir}" != "/usr/${target}/include" \
) ;
224 includes
=" -I${includedir}"
227 includes
="-I${libdir}/wx/include/${TOOLCHAIN_NAME}$includes"
229 if test $static_flag = yes ; then
230 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
232 echo $includes ${WXDEBUG_DEFINE} ${TOOLCHAIN_DEFS} ${TOOLCHAIN_DLL_DEFS} ${WXCONFIG_INCLUDE} ${WX_LARGEFILE_FLAGS}
236 if test $# -eq 0; then
240 while test $# -gt 0; do
242 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
248 prefix
=`makeabs $srcdir`
249 exec_prefix
=`makeabs $builddir`
255 if test $exec_prefix_set = no
; then
272 echo ${WX_MAJOR_VERSION_NUMBER}.
${WX_MINOR_VERSION_NUMBER}.
${WX_RELEASE_NUMBER}
287 echo `cppflags` ${CODE_GEN_FLAGS}
290 echo `cppflags` ${CODE_GEN_FLAGS} ${CODE_GEN_FLAGS_CXX}
296 echo `eval echo ${MACRESWXCONFIG}`
300 # find if the argument was --libs=list,of,libs or --libs:
301 if test "x$optarg" = "x" ; then
302 if test "$is_monolithic" = "0" ; then
303 # link against all libs if none given explicitly:
304 libs_list
="$CORE_GUI_LIBS $CORE_BASE_LIBS"
307 libs_list
=`echo "$optarg" | tr ',' ' '`
308 # always add wxBase, any wxApp needs it:
309 libs_list
="$libs_list base"
312 # include install directory only if it is not default:
313 if test "${libdir}" != "/usr/lib" \
314 -a \
( "${cross_compiling}" != "yes" \
315 -o "${libdir}" != "/usr/${target}/lib" \
) ;
320 # in monolithic build, link against the main library:
321 if test "$is_monolithic" = "1" ; then
322 # filter out core libs, leave only contrib in libs_list:
324 for i
in $libs_list ; do
325 if isinlist
$i $CORE_BASE_LIBS $CORE_GUI_LIBS ; then
326 libs_list
="" # do nothing
328 newlist
="$newlist $i"
334 contrib_libs
=`output_libs $libs_list`
335 if test $static_flag = yes ; then
336 echo "$libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${libdir}/${WXCONFIG_LIBS_STATIC} ${EXTRALIBS_GUI} ${LIBS} ${DMALLOC_LIBS}"
338 echo $libs ${LDFLAGS} ${WXCONFIG_LDFLAGS_GUI} ${WXCONFIG_RPATH} $contrib_libs ${WXCONFIG_LIBS} ${DMALLOC_LIBS}
341 # in multilib mode, link against all sublibraries:
342 wxlibs
=`output_libs $libs_list`
343 guildflags
=`get_ldflags_gui $libs_list`
344 echo $libs ${LDFLAGS} ${guildflags} ${WXCONFIG_RPATH} $wxlibs ${DMALLOC_LIBS}