]> git.saurik.com Git - wxWidgets.git/blame - wx-config.in
Applied and merged patch 486364, which enables wxPython to be built in
[wxWidgets.git] / wx-config.in
CommitLineData
9a98a854
VZ
1#!/bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5exec_prefix_set=no
6ce73557
VZ
6CC="@CC@"
7CXX="@CXX@"
8LD="@SHARED_LD@"
3a922bb4 9cross_compiling=@cross_compiling@
77e13408 10target=@host_alias@
3d63bc3a 11static_flag=no
9a98a854 12
75f4be8a
VZ
13usage()
14{
15 cat <<EOF
3d63bc3a 16Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--static]
2baaf735 17 [--libs] [--gl-libs] [--cppflags] [--cflags] [--cxxflags] [--rezflags]
75f4be8a
VZ
18 [--cc] [--cxx] [--ld]
19
20wx-config returns configuration information about the installed
21version of wxWindows. It may be used to query its version and
22installation directories and also retrieve the C and C++ compilers
23and linker which were used for its building and the corresponding
24flags.
25EOF
26
27 exit $1
28}
29
30cppflags()
31{
77e13408
RL
32 if test "@includedir@" != "/usr/include" \
33 -a "@includedir@" != "/usr/include/c++" \
34 -a \( "${cross_compiling}" != "yes" \
35 -o "@includedir@" != "/usr/${target}/include" \) ;
3a922bb4
RL
36 then
37 includes=-I@includedir@
75f4be8a 38 fi
00c81359 39
3a922bb4 40 includes="-I@libdir@/wx/include/@TOOLCHAIN_NAME@ $includes"
00c81359
RL
41
42 if test $static_flag = yes ; then
43 echo $includes @WXDEBUG_DEFINE@ @TOOLCHAIN_DEFS@ @WXCONFIG_INCLUDE@
44 else
45 echo $includes @WXDEBUG_DEFINE@ @TOOLCHAIN_DEFS@ @TOOLCHAIN_DLL_DEFS@ @WXCONFIG_INCLUDE@
46 fi
75f4be8a 47}
9a98a854
VZ
48
49if test $# -eq 0; then
3a922bb4 50 usage 1 1>&2
9a98a854
VZ
51fi
52
53while test $# -gt 0; do
54 case "$1" in
55 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
56 *) optarg= ;;
57 esac
58
59 case $1 in
60 --prefix=*)
61 prefix=$optarg
62 if test $exec_prefix_set = no ; then
63 exec_prefix=$optarg
64 fi
65 ;;
66 --prefix)
67 echo $prefix
68 ;;
69 --exec-prefix=*)
70 exec_prefix=$optarg
71 exec_prefix_set=yes
72 ;;
73 --exec-prefix)
74 echo $exec_prefix
75 ;;
76 --version)
79144b8a 77 echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
9a98a854 78 ;;
3d63bc3a
RL
79 --static)
80 static_flag=yes
81 ;;
75f4be8a
VZ
82 --cppflags)
83 cppflags
84 ;;
9a98a854 85 --cflags)
75f4be8a
VZ
86 echo `cppflags` @CODE_GEN_FLAGS@
87 ;;
88 --cxxflags)
89 echo `cppflags` @CODE_GEN_FLAGS@ @CODE_GEN_FLAGS_CXX@
9a98a854 90 ;;
2baaf735
RR
91 --rezflags)
92 echo @LIBWXMACRESWXCONFIG@
93 ;;
9a98a854 94 --libs)
77e13408
RL
95 if test "@libdir@" != "/usr/lib" \
96 -a \( "${cross_compiling}" != "yes" \
97 -o "@libdir@" != "/usr/${target}/lib" \) ;
3a922bb4
RL
98 then
99 libs="-L@libdir@"
9a98a854 100 fi
3d63bc3a
RL
101
102 if test $static_flag = yes ; then
885d4bf5 103 echo "$libs @LDFLAGS@ @libdir@/@WXCONFIG_LIBS_STATIC@ @LIBS@ @DMALLOC_LIBS@"
3d63bc3a
RL
104 else
105 echo $libs @LDFLAGS@ @WXCONFIG_LIBS@ @DMALLOC_LIBS@
106 fi
107
3a922bb4
RL
108 ;;
109 --gl-libs)
885d4bf5
VS
110 if test $static_flag = yes -a "x" != "x@WXCONFIG_LIBS_STATIC_GL@" ; then
111 gllibs="@libdir@/@WXCONFIG_LIBS_STATIC_GL@"
112 else
113 gllibs="@WXCONFIG_LIBS_GL@"
114 fi
115 echo @LDFLAGS_GL@ "$gllibs"
9a98a854 116 ;;
6ce73557
VZ
117 --cc)
118 echo $CC
119 ;;
120 --cxx)
121 echo $CXX
122 ;;
123 --ld)
124 echo $LD
125 ;;
9a98a854 126 *)
75f4be8a 127 usage 1 1>&2
9a98a854
VZ
128 ;;
129 esac
130 shift
131done
132