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