]> git.saurik.com Git - wxWidgets.git/blob - wx-config.in
toplevel code transferred to wxTopLevelWindow
[wxWidgets.git] / wx-config.in
1 #!/bin/sh
2
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 exec_prefix_set=no
6 CC="@CC@"
7 CXX="@CXX@"
8 LD="@SHARED_LD@"
9 cross_compiling=@cross_compiling@
10 target=@host_alias@
11 static_flag=no
12
13 usage()
14 {
15 cat <<EOF
16 Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--static]
17 [--libs] [--gl-libs] [--cppflags] [--cflags] [--cxxflags] [--rezflags]
18 [--cc] [--cxx] [--ld]
19
20 wx-config returns configuration information about the installed
21 version of wxWindows. It may be used to query its version and
22 installation directories and also retrieve the C and C++ compilers
23 and linker which were used for its building and the corresponding
24 flags.
25 EOF
26
27 exit $1
28 }
29
30 cppflags()
31 {
32 if test "@includedir@" != "/usr/include" \
33 -a "@includedir@" != "/usr/include/c++" \
34 -a \( "${cross_compiling}" != "yes" \
35 -o "@includedir@" != "/usr/${target}/include" \) ;
36 then
37 includes=-I@includedir@
38 fi
39
40 includes="-I@libdir@/wx/include/@TOOLCHAIN_NAME@ $includes"
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
47 }
48
49 if test $# -eq 0; then
50 usage 1 1>&2
51 fi
52
53 while 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)
77 echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
78 ;;
79 --static)
80 static_flag=yes
81 ;;
82 --cppflags)
83 cppflags
84 ;;
85 --cflags)
86 echo `cppflags` @CODE_GEN_FLAGS@
87 ;;
88 --cxxflags)
89 echo `cppflags` @CODE_GEN_FLAGS@ @CODE_GEN_FLAGS_CXX@
90 ;;
91 --rezflags)
92 echo @LIBWXMACRESWXCONFIG@
93 ;;
94 --libs)
95 if test "@libdir@" != "/usr/lib" \
96 -a \( "${cross_compiling}" != "yes" \
97 -o "@libdir@" != "/usr/${target}/lib" \) ;
98 then
99 libs="-L@libdir@"
100 fi
101
102 if test $static_flag = yes ; then
103 echo "$libs @LDFLAGS@ @libdir@/@WXCONFIG_LIBS_STATIC@ @LIBS@ @DMALLOC_LIBS@"
104 else
105 echo $libs @LDFLAGS@ @WXCONFIG_LIBS@ @DMALLOC_LIBS@
106 fi
107
108 ;;
109 --gl-libs)
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"
116 ;;
117 --cc)
118 echo $CC
119 ;;
120 --cxx)
121 echo $CXX
122 ;;
123 --ld)
124 echo $LD
125 ;;
126 *)
127 usage 1 1>&2
128 ;;
129 esac
130 shift
131 done
132