Don't translate empty strings
[vlc.git] / vlc-config.in.in
blob4649ed31fa793149bf4e296268efbd1f8ce00d55
1 #!/bin/sh
3 prefix="@prefix@"
4 exec_prefix="@exec_prefix@"
5 exec_prefix_set=no
6 datarootdir="@datarootdir@"
8 release="@release@"
9 debug="@debug@"
10 gprof="@gprof@"
11 cprof="@cprof@"
12 optim="@optim@"
14 plugins="@PLUGINS@ "
15 builtins="@BUILTINS@ "
17 cppflags=""
18 cflags=""
19 cxxflags=""
20 objcflags=""
21 ldflags=""
23 cflags_tuning="@CFLAGS_TUNING@"
24 cflags_optim_size="@CFLAGS_OPTIM_SIZE@"
25 cflags_optim_speed="@CFLAGS_OPTIM_SPEED@"
26 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
27 cflags_nooptim="@CFLAGS_NOOPTIM@"
30 # Do not touch below this place unless you really know what you are doing
32 usage()
34 cat << BLAH
35 Usage: vlc-config OPTIONS MODULES
36 Options:
37 [--prefix[=DIR]] set prefix
38 [--exec-prefix[=DIR]] set exec prefix
39 [--version] print version and exit
40 [--linkage] print linkage mode (c, c++, objc)
41 [--target] print targets and exit
42 [--list] print modules names and exit
43 [--libs] output linking flags
44 [--cflags] output C compilation flags
45 [--cxxflags] output C++ compilation flags
46 [--objcflags] output Objective C compilation flags
47 Modules:
48 vlc the main VLC object
49 plugin flags for plugin modules
50 builtin flags for built-in modules
51 pic flags for PIC code
52 MODULE any available module (dummy, gtk, avi, etc.)
53 BLAH
54 exit $1
57 register_flags()
59 case "$1" in
60 #@1@#
63 esac
66 register_targets()
68 case "$1" in
69 #@2@#
72 esac
75 if test $# -eq 0; then
76 usage 1 1>&2
80 # No need to include the default @*FLAGS@ values here because they are
81 # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE)
83 if test "@includedir@" != "/usr/include"; then
84 includes="-I@includedir@"
86 if test "${top_builddir}" != ""; then
87 top_builddir="${top_builddir}/"
88 elif test "${TOP_BUILDDIR}" != ""; then
89 top_builddir="${TOP_BUILDDIR}/"
91 includes="${includes}"
92 cppflags="${includes}"
93 module=""
94 linkage="c"
97 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
99 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE"
102 # Gettext, data and plugin location
104 cppflags="${cppflags} -DLOCALEDIR=\"@datadir@/locale\""
105 cppflags="${cppflags} -DDATA_PATH=\"@datadir@/vlc\""
106 cppflags="${cppflags} -DPLUGIN_PATH=\"@libdir@/vlc\""
109 # Various additional defines
111 if [ "${debug}" = yes ]; then
112 cppflags="${cppflags} -DDEBUG"
113 cflags="${cflags} -g"
114 cxxflags="${cxxflags} -g"
115 objcflags="${objcflags} -g"
116 ldflags="${ldflags} -g"
118 if [ "${cprof}" = yes ]; then
119 cppflags="${cppflags} -DCPROF"
120 cflags="${cflags} -finstrument-functions"
121 cxxflags="${cxxflags} -finstrument-functions"
122 objcflags="${objcflags} -finstrument-functions"
124 if [ "${gprof}" = yes ]; then
125 cppflags="${cppflags} -DGPROF"
126 cflags="${cflags} -pg"
127 cxxflags="${cxxflags} -pg"
128 objcflags="${objcflags} -pg"
129 ldflags="${ldflags} -pg"
131 if [ "${release}" = yes ]; then
132 cppflags="${cppflags} -DHAVE_RELEASE"
134 if [ "${optim}" = size ]; then
135 cppflags="${cppflags} ${cflags_optim_size} ${cflags_tuning}"
136 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
137 cppflags="${cppflags} ${cflags_optim_nodebug}"
139 elif [ "${optim}" = speed ]; then
140 cppflags="${cppflags} ${cflags_optim_speed} ${cflags_tuning}"
141 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
142 cppflags="${cppflags} ${cflags_optim_nodebug}"
144 else
145 cppflags="${cppflags} ${cflags_nooptim}"
149 # The main argument loop
151 while test $# -gt 0; do
152 case "$1" in
153 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
154 *) optarg= ;;
155 esac
157 case "$1" in
158 --prefix=*)
159 prefix="${optarg}"
160 if test "${exec_prefix_set}" = no ; then
161 exec_prefix="${optarg}"
164 --prefix)
165 echo_prefix=yes
167 --exec-prefix=*)
168 exec_prefix="${optarg}"
169 exec_prefix_set=yes
171 --exec-prefix)
172 echo_exec_prefix=yes
174 --version)
175 echo "@VERSION@"
176 exit 0
178 --linkage)
179 echo_linkage=yes
181 --target)
182 echo_target=yes
184 --list)
185 echo_list=yes
187 --cflags)
188 echo_cflags=yes
190 --cxxflags)
191 echo_cxxflags=yes
193 --objcflags)
194 echo_objcflags=yes
196 --libs)
197 echo_libs=yes
200 usage 1 1>&1
202 libvlc)
203 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
205 plugin)
206 echo_plugin=yes
207 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
209 builtin)
210 echo_builtin=yes
211 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
213 pic)
215 mozilla)
217 external)
218 echo_external=yes
219 ldflags="${ldflags} -lvlc -lvlc-control"
222 module="$1"
224 esac
226 # Register per-module *FLAGS
227 register_flags "$1"
229 # Register module targets
230 register_targets "$1"
232 shift
233 done
235 libs="-L@libdir@"
238 # If a module was requested, use its name
240 if test -n "${module}"; then
241 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module}"
245 # Output what we were asked
247 if test "${echo_linkage}" = yes; then
248 if test "${echo_plugin}" = yes; then
249 for module in `echo "${plugins}"`; do
250 register_flags "${module}"
251 done
253 if test "${echo_builtin}" = yes; then
254 for module in `echo "${builtins}"`; do
255 register_flags "${module}"
256 done
258 echo "${linkage}"
259 exit 0
262 if test "${echo_target}" = yes; then
263 if test "${echo_plugin}" = yes; then
264 for module in `echo "${plugins}"`; do
265 register_targets "${module}"
266 done
267 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}_plugin "; done
268 printf '\n'
270 if test "${echo_builtin}" = yes; then
271 for module in `echo "${builtins}"`; do
272 register_targets "${module}"
273 done
274 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}.a "; done
275 printf '\n'
277 exit 0
280 if test "${echo_list}" = yes; then
281 if test "${echo_plugin}" = yes; then
282 echo "${plugins}"
283 printf '\n'
285 if test "${echo_builtin}" = yes; then
286 echo "${builtins}"
287 printf '\n'
289 exit 0
292 if test "${echo_prefix}" = yes; then
293 echo "${prefix}"
295 if test "${echo_exec_prefix}" = yes; then
296 echo "${exec_prefix}"
298 if test "${echo_cppflags}" = yes; then
299 echo "${cppflags}"
301 if test "${echo_cflags}" = yes; then
302 echo "${cppflags} ${cflags}"
304 if test "${echo_cxxflags}" = yes; then
305 echo "${cppflags} ${cxxflags}"
307 if test "${echo_objcflags}" = yes; then
308 echo "${cppflags} ${objcflags}"
311 # Libs
312 # There are 4 possibilities
313 # - We are a plugin or a builtin
314 # - We are building from the outside (external):
315 # - Give full libvlc linkflags + -lvlc (in libdir)
316 # - Link with builtins in libdir
317 # - We are building something from the inside (builtin)
318 # - Link with builtins in place
319 # If you want something shared from the inside (binding),
320 # you need "builtin vlc"
321 if test "${echo_libs}" = yes; then
322 if test "${echo_builtin}" = yes; then
323 for module in `echo "${builtins}"`; do
324 register_targets "${module}"
325 register_flags "${module}"
326 done
327 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}.a "; done
329 if test "${echo_external}" = yes; then
330 for module in `echo "${builtins}"`; do
331 ldflags="${ldflags} @libdir@/vlc/lib${module}.a"
332 done
333 for module in `echo "${builtins}"`; do
334 register_flags "${module}"
335 done
336 register_flags "vlc"
338 echo "${libs} ${ldflags}"