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