4 exec_prefix="@exec_prefix@"
6 datarootdir="@datarootdir@"
15 builtins="@BUILTINS@ "
23 cflags_tuning="@CFLAGS_TUNING@"
24 cflags_optim="@CFLAGS_OPTIM@"
25 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
26 cflags_nooptim="@CFLAGS_NOOPTIM@"
29 # Do not touch below this place unless you really know what you are doing
34 Usage: vlc-config OPTIONS MODULES
36 [--prefix[=DIR]] set prefix
37 [--exec-prefix[=DIR]] set exec prefix
38 [--version] print version and exit
39 [--linkage] print linkage mode (c, c++, objc)
40 [--target] print targets and exit
41 [--list] print modules names and exit
42 [--libs] output linking flags
43 [--cflags] output C compilation flags
44 [--cxxflags] output C++ compilation flags
45 [--objcflags] output Objective C compilation flags
47 vlc the main VLC object
48 plugin flags for plugin modules
49 builtin flags for built-in modules
50 pic flags for PIC code
51 MODULE any available module (dummy, gtk, avi, etc.)
74 if test $# -eq 0; then
79 # No need to include the default @*FLAGS@ values here because they are
80 # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE)
82 if test "@includedir@" != "/usr/include"; then
83 includes="-I@includedir@"
85 if test "${top_builddir}" != ""; then
86 top_builddir="${top_builddir}/"
87 elif test "${TOP_BUILDDIR}" != ""; then
88 top_builddir="${TOP_BUILDDIR}/"
90 includes="${includes}"
91 cppflags="${includes}"
96 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
98 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE"
101 # Gettext, data and plugin location
103 cppflags="${cppflags} -DLOCALEDIR=\"@datadir@/locale\""
104 cppflags="${cppflags} -DDATA_PATH=\"@datadir@/vlc\""
105 cppflags="${cppflags} -DPLUGIN_PATH=\"@libdir@/vlc\""
108 # Various additional defines
110 if [ "${debug}" = yes ]; then
111 cppflags="${cppflags} -DDEBUG"
112 cflags="${cflags} -g"
113 cxxflags="${cxxflags} -g"
114 objcflags="${objcflags} -g"
115 ldflags="${ldflags} -g"
117 if [ "${cprof}" = yes ]; then
118 cppflags="${cppflags} -DCPROF"
119 cflags="${cflags} -finstrument-functions"
120 cxxflags="${cxxflags} -finstrument-functions"
121 objcflags="${objcflags} -finstrument-functions"
123 if [ "${gprof}" = yes ]; then
124 cppflags="${cppflags} -DGPROF"
125 cflags="${cflags} -pg"
126 cxxflags="${cxxflags} -pg"
127 objcflags="${objcflags} -pg"
128 ldflags="${ldflags} -pg"
130 if [ "${release}" = yes ]; then
131 cppflags="${cppflags} -DHAVE_RELEASE"
133 if [ "${optim}" = yes ]; then
134 cppflags="${cppflags} ${cflags_optim} ${cflags_tuning}"
135 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
136 cppflags="${cppflags} ${cflags_optim_nodebug}"
139 cppflags="${cppflags} ${cflags_nooptim}"
143 # The main argument loop
145 while test $# -gt 0; do
147 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
154 if test "${exec_prefix_set}" = no ; then
155 exec_prefix="${optarg}"
162 exec_prefix="${optarg}"
197 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
201 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
205 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
213 ldflags="${ldflags} -lvlc -lvlc-control"
220 # Register per-module *FLAGS
223 # Register module targets
224 register_targets "$1"
232 # If a module was requested, use its name
234 if test -n "${module}"; then
235 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module}"
239 # Output what we were asked
241 if test "${echo_linkage}" = yes; then
242 if test "${echo_plugin}" = yes; then
243 for module in `echo "${plugins}"`; do
244 register_flags "${module}"
247 if test "${echo_builtin}" = yes; then
248 for module in `echo "${builtins}"`; do
249 register_flags "${module}"
256 if test "${echo_target}" = yes; then
257 if test "${echo_plugin}" = yes; then
258 for module in `echo "${plugins}"`; do
259 register_targets "${module}"
261 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}_plugin "; done
264 if test "${echo_builtin}" = yes; then
265 for module in `echo "${builtins}"`; do
266 register_targets "${module}"
268 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}.a "; done
274 if test "${echo_list}" = yes; then
275 if test "${echo_plugin}" = yes; then
279 if test "${echo_builtin}" = yes; then
286 if test "${echo_prefix}" = yes; then
289 if test "${echo_exec_prefix}" = yes; then
290 echo "${exec_prefix}"
292 if test "${echo_cppflags}" = yes; then
295 if test "${echo_cflags}" = yes; then
296 echo "${cppflags} ${cflags}"
298 if test "${echo_cxxflags}" = yes; then
299 echo "${cppflags} ${cxxflags}"
301 if test "${echo_objcflags}" = yes; then
302 echo "${cppflags} ${objcflags}"
306 # There are 4 possibilities
307 # - We are a plugin or a builtin
308 # - We are building from the outside (external):
309 # - Give full libvlc linkflags + -lvlc (in libdir)
310 # - Link with builtins in libdir
311 # - We are building something from the inside (builtin)
312 # - Link with builtins in place
313 # If you want something shared from the inside (binding),
314 # you need "builtin vlc"
315 if test "${echo_libs}" = yes; then
316 if test "${echo_builtin}" = yes; then
317 for module in `echo "${builtins}"`; do
318 register_targets "${module}"
319 register_flags "${module}"
321 for target in `echo "${list}"`; do printf "${top_builddir}modules/${target}.a "; done
323 if test "${echo_external}" = yes; then
324 for module in `echo "${builtins}"`; do
325 ldflags="${ldflags} @libdir@/vlc/lib${module}.a"
327 for module in `echo "${builtins}"`; do
328 register_flags "${module}"
332 echo "${libs} ${ldflags}"