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