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