]>
Commit | Line | Data |
---|---|---|
9a98a854 VZ |
1 | #!/bin/sh |
2 | ||
3 | prefix=@prefix@ | |
4 | exec_prefix=@exec_prefix@ | |
5 | exec_prefix_set=no | |
6ce73557 VZ |
6 | CC="@CC@" |
7 | CXX="@CXX@" | |
8 | LD="@SHARED_LD@" | |
3a922bb4 | 9 | cross_compiling=@cross_compiling@ |
9a98a854 | 10 | |
75f4be8a VZ |
11 | usage() |
12 | { | |
13 | cat <<EOF | |
14 | Usage: wx-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] | |
3a922bb4 | 15 | [--libs] [--gl-libs] [--cppflags] [--cflags] [--cxxflags] |
75f4be8a VZ |
16 | [--cc] [--cxx] [--ld] |
17 | ||
18 | wx-config returns configuration information about the installed | |
19 | version of wxWindows. It may be used to query its version and | |
20 | installation directories and also retrieve the C and C++ compilers | |
21 | and linker which were used for its building and the corresponding | |
22 | flags. | |
23 | EOF | |
24 | ||
25 | exit $1 | |
26 | } | |
27 | ||
28 | cppflags() | |
29 | { | |
3a922bb4 RL |
30 | if test "${cross_compiling}" != "yes" \ |
31 | -a @includedir@ != /usr/include \ | |
32 | -a @includedir@ != /usr/include/c++ ; | |
33 | then | |
34 | includes=-I@includedir@ | |
75f4be8a | 35 | fi |
3a922bb4 RL |
36 | includes="-I@libdir@/wx/include/@TOOLCHAIN_NAME@ $includes" |
37 | echo $includes @WXDEBUG_DEFINE@ @TOOLCHAIN_DEFS@ @WXCONFIG_INCLUDE@ | |
75f4be8a | 38 | } |
9a98a854 VZ |
39 | |
40 | if test $# -eq 0; then | |
3a922bb4 | 41 | usage 1 1>&2 |
9a98a854 VZ |
42 | fi |
43 | ||
44 | while test $# -gt 0; do | |
45 | case "$1" in | |
46 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
47 | *) optarg= ;; | |
48 | esac | |
49 | ||
50 | case $1 in | |
51 | --prefix=*) | |
52 | prefix=$optarg | |
53 | if test $exec_prefix_set = no ; then | |
54 | exec_prefix=$optarg | |
55 | fi | |
56 | ;; | |
57 | --prefix) | |
58 | echo $prefix | |
59 | ;; | |
60 | --exec-prefix=*) | |
61 | exec_prefix=$optarg | |
62 | exec_prefix_set=yes | |
63 | ;; | |
64 | --exec-prefix) | |
65 | echo $exec_prefix | |
66 | ;; | |
67 | --version) | |
79144b8a | 68 | echo @WX_MAJOR_VERSION_NUMBER@.@WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@ |
9a98a854 | 69 | ;; |
75f4be8a VZ |
70 | --cppflags) |
71 | cppflags | |
72 | ;; | |
9a98a854 | 73 | --cflags) |
75f4be8a VZ |
74 | echo `cppflags` @CODE_GEN_FLAGS@ |
75 | ;; | |
76 | --cxxflags) | |
77 | echo `cppflags` @CODE_GEN_FLAGS@ @CODE_GEN_FLAGS_CXX@ | |
9a98a854 VZ |
78 | ;; |
79 | --libs) | |
3a922bb4 RL |
80 | if test "${cross_compiling}" != "yes" \ |
81 | -a @libdir@ != /usr/lib ; | |
82 | then | |
83 | libs="-L@libdir@" | |
9a98a854 | 84 | fi |
3a922bb4 RL |
85 | echo $libs @WXCONFIG_LIBS@ @EXTRA_LIBS@ |
86 | ;; | |
87 | --gl-libs) | |
88 | echo @WXCONFIG_LIBS_GL@ | |
9a98a854 | 89 | ;; |
6ce73557 VZ |
90 | --cc) |
91 | echo $CC | |
92 | ;; | |
93 | --cxx) | |
94 | echo $CXX | |
95 | ;; | |
96 | --ld) | |
97 | echo $LD | |
98 | ;; | |
9a98a854 | 99 | *) |
75f4be8a | 100 | usage 1 1>&2 |
9a98a854 VZ |
101 | ;; |
102 | esac | |
103 | shift | |
104 | done | |
105 |