]> git.sesse.net Git - vlc/blob - vlc-config.in.in
Remove unused prefix stuff from vlc-config
[vlc] / vlc-config.in.in
1 #!@SHELL@
2
3 optim="@optim@"
4
5 cppflags=""
6 cflags=""
7 cxxflags=""
8 objcflags=""
9 ldflags=""
10 libs=""
11
12 cflags_tuning="@CFLAGS_TUNING@"
13
14 #
15 #  Do not touch below this place unless you really know what you are doing
16 #
17 usage()
18 {
19         cat << BLAH
20 Usage: vlc-config OPTIONS MODULES
21 Options:
22         [--version]               print version and exit
23         [--libs]                  output linking flags
24         [--cflags]                output C compilation flags
25         [--cxxflags]              output C++ compilation flags
26         [--objcflags]             output Objective C compilation flags
27 Modules:
28         vlc                       the main VLC object
29         MODULE                    any available module (dummy, gtk, avi, etc.)
30         libs                      flags for external libs
31 BLAH
32         exit $1
33 }
34
35 register_flags()
36 {
37   case "$1" in
38     #@1@#
39     *)
40       ;;
41   esac
42 }
43
44 if test $# -eq 0; then
45         usage 1 1>&2
46 fi
47
48 if test "${top_builddir}" != ""; then
49   top_builddir="${top_builddir}/"
50 elif test "${TOP_BUILDDIR}" != ""; then
51   top_builddir="${TOP_BUILDDIR}/"
52 fi
53 includes="${includes}"
54 cppflags="${includes}"
55 module=""
56
57 #
58 #  Various additional defines
59 #
60 if [ "${optim}" = speed ]; then
61   cflags="${cflags} ${cflags_tuning}"
62   cxxflags="${cxxflags} ${cflags_tuning}"
63   objcflags="${objcflags} ${cflags_tuning}"
64 fi
65
66 #
67 #  The main argument loop
68 #
69 while test $# -gt 0; do
70   case "$1" in
71   -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
72   *) optarg= ;;
73   esac
74
75   # Mangle plugin name, if applicable
76   # This is just a convenience hack for modules/common.am
77   tgt="$1"
78   tgt="${tgt##*/}"
79   case "$tgt" in
80     lib*_plugin_la-*.lo)
81       tgt="${tgt#*lib}"
82       tgt="${tgt%_plugin_la-*.lo}"
83       ;;
84     lib*_plugin.la)
85       tgt="${tgt#lib}"
86       tgt="${tgt%_plugin.la}"
87       ;;
88     *)
89       ;;
90   esac
91
92   case "$tgt" in
93     --version)
94       echo "@VERSION@"
95       exit 0
96       ;;
97     --cflags)
98       echo_cflags=yes
99       ;;
100     --cppflags)
101       echo_cppflags=yes
102       ;;
103     --cxxflags)
104       echo_cxxflags=yes
105       ;;
106     --objcflags)
107       echo_objcflags=yes
108       ;;
109     --ldflags)
110       echo_ldflags=yes
111       ;;
112     --libs|-libs)
113       echo_libs=yes
114       ;;
115     -*)
116       usage 1 1>&1
117       ;;
118     libvlccore)
119       ;;
120     *)
121       module="$tgt"
122       ;;
123   esac
124
125   # Register per-module *FLAGS
126   register_flags "$tgt"
127
128   shift
129 done
130
131 #
132 #  If a module was requested, use its name
133 #
134 if test -n "${module}"; then
135   cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
136 fi
137
138 #
139 #  Output what we were asked
140 #
141 if test "${echo_cppflags}" = yes; then
142   echo "${cppflags}"
143 fi
144 if test "${echo_cflags}" = yes; then
145   echo "${cppflags} ${cflags}"
146 fi
147 if test "${echo_cxxflags}" = yes; then
148   echo "${cppflags} ${cxxflags}"
149 fi
150 if test "${echo_objcflags}" = yes; then
151   echo "${cppflags} ${objcflags}"
152 fi
153 if test "${echo_ldflags}" = yes; then
154   echo "${ldflags}"
155 fi
156
157 # Libs
158 # There are 4 possibilities
159 #  - We are a plugin or a builtin
160 #  - We are building something from the inside (builtin)
161 #       - Link with builtins in place
162 #  If you want something shared from the inside (binding),
163 #  you need "builtin vlc"
164 if test "${echo_libs}" = yes; then
165   echo "${libs}"
166 fi