4 exec_prefix
="@exec_prefix@"
6 datarootdir
="@datarootdir@"
15 builtins
="@BUILTINS@ "
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
35 Usage: vlc-config OPTIONS MODULES
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
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.)
75 if test $# -eq 0; then
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}"
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}"
145 cppflags
="${cppflags} ${cflags_nooptim}"
149 # The main argument loop
151 while test $# -gt 0; do
153 -*=*) optarg
=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
160 if test "${exec_prefix_set}" = no
; then
161 exec_prefix
="${optarg}"
168 exec_prefix
="${optarg}"
203 cppflags
="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
207 cppflags
="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
211 cppflags
="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
219 ldflags
="${ldflags} -lvlc -lvlc-control"
226 # Register per-module *FLAGS
229 # Register module targets
230 register_targets
"$1"
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}"
253 if test "${echo_builtin}" = yes; then
254 for module
in `echo "${builtins}"`; do
255 register_flags
"${module}"
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}"
267 for target
in `echo "${list}"`; do printf "${top_builddir}modules/${target}_plugin "; done
270 if test "${echo_builtin}" = yes; then
271 for module in `echo "${builtins}"`; do
272 register_targets "${module}"
274 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}.a "; done
280 if test "${echo_list}" = yes; then
281 if test "${echo_plugin}" = yes; then
285 if test "${echo_builtin}" = yes; then
292 if test "${echo_prefix}" = yes; then
295 if test "${echo_exec_prefix}" = yes; then
296 echo "${exec_prefix}"
298 if test "${echo_cppflags}" = yes; then
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}"
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}"
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"
333 for module in `echo "${builtins}"`; do
334 register_flags "${module}"
338 echo "${libs} ${ldflags}"