4 exec_prefix="@exec_prefix@"
16 cflags_tuning="@CFLAGS_TUNING@"
17 cflags_optim="@CFLAGS_OPTIM@"
18 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
19 cflags_nooptim="@CFLAGS_NOOPTIM@"
22 # Do not touch below this place unless you really know what you are doing
27 Usage: vlc-config OPTIONS MODULES
29 [--prefix[=DIR]] set prefix
30 [--exec-prefix[=DIR]] set exec prefix
31 [--version] print version and exit
32 [--linkage] print linkage mode (c, c++, objc)
33 [--target] print targets and exit
34 [--libs] output linking flags
35 [--cflags] output C compilation flags
36 [--cxxflags] output C++ compilation flags
37 [--objcflags] output Objective C compilation flags
39 vlc the main VLC object
40 plugin flags for plugin modules
41 builtin flags for built-in modules
42 pic flags for PIC code
43 MODULE any available module (dummy, gtk, avi, etc.)
66 if test $# -eq 0; then
71 # No need to include the default @*FLAGS@ values here because they are
72 # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE)
74 if test "@includedir@" != /usr/include ; then
75 includes="-I@includedir@"
77 cppflags="${includes}"
83 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
85 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE"
88 # Gettext, data and plugin location
90 cppflags="${cppflags} -DLOCALEDIR=\"@datadir@/locale\""
91 cppflags="${cppflags} -DDATA_PATH=\"${prefix}/share/vlc\""
92 cppflags="${cppflags} -DPLUGIN_PATH=\"${prefix}/lib/vlc\""
95 # Various additional defines
97 if [ "${debug}" = yes ]; then
98 cppflags="${cppflags} -DDEBUG"
100 cxxflags="${cxxflags} -g"
101 objcflags="${objcflags} -g"
102 ldflags="${objcflags} -g"
104 if [ "${cprof}" = yes ]; then
105 cppflags="${cppflags} -DCPROF"
106 cflags="${cflags} -finstrument-functions"
107 cxxflags="${cxxflags} -finstrument-functions"
108 objcflags="${objcflags} -finstrument-functions"
110 if [ "${gprof}" = yes ]; then
111 cppflags="${cppflags} -DGPROF"
112 cflags="${cflags} -pg"
113 cxxflags="${cxxflags} -pg"
114 objcflags="${objcflags} -pg"
115 ldflags="${ldflags} -pg"
117 if [ "${release}" = yes ]; then
118 cppflags="${cppflags} -DHAVE_RELEASE"
120 if [ "${optim}" = yes ]; then
121 cppflags="${cppflags} ${cflags_optim} ${cflags_tuning}"
122 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
123 cppflags="${cppflags} ${cflags_optim_nodebug}"
126 cppflags="${cppflags} ${cflags_nooptim}"
130 # The main argument loop
132 while test $# -gt 0; do
134 -*=*) optarg=`echo "$1" | sed 's/-_a-zA-Z0-9*=//'` ;;
141 if test "${exec_prefix_set}" = no ; then
142 exec_prefix="${optarg}"
149 exec_prefix="${optarg}"
181 cppflags="${cppflags} -D__VLC__"
185 cppflags="${cppflags} -D__VLC__ -D__PLUGIN__"
192 cppflags="${cppflags} -D__VLC__ -D__BUILTIN__"
201 # Register per-module *FLAGS
204 # Register module targets
205 register_targets "$1"
211 # If a module was requested, use its name
213 if test "${module}" != ""; then
214 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module}"
218 # Output what we were asked
220 if test "${echo_linkage}" = yes; then
221 if test "${echo_plugin}"; then
222 for module in `echo "${plugins}"`; do
223 register_flags "${module}"
226 if test "${echo_builtin}"; then
227 for module in `echo "${builtins}"`; do
228 register_flags "${module}"
235 if test "${echo_target}" = yes; then
236 if test "${echo_plugin}"; then
237 for module in `echo "${plugins}"`; do
238 register_targets "${module}"
240 echo "${list}" | sed -e 's/[^ ][^ ]*/&_plugin/g'
242 if test "${echo_builtin}"; then
243 for module in `echo "${builtins}"`; do
244 register_targets "${module}"
246 if test "${echo_pic}"; then
247 echo "${list}" | sed -e 's/[^ ][^ ]*/&_pic.a/g'
249 echo "${list}" | sed -e 's/[^ ][^ ]*/&.a/g'
255 if test "${echo_prefix}" = yes; then
258 if test "${echo_exec_prefix}" = yes; then
259 echo "${exec_prefix}"
261 if test "${echo_cppflags}" = yes; then
264 if test "${echo_cflags}" = yes; then
265 echo "${cppflags} ${cflags}"
267 if test "${echo_cxxflags}" = yes; then
268 echo "${cppflags} ${cxxflags}"
270 if test "${echo_objcflags}" = yes; then
271 echo "${cppflags} ${objcflags}"
273 if test "${echo_libs}" = yes; then
274 if test "${echo_builtin}"; then
275 for module in `echo "${builtins}"`; do
276 register_targets "${module}"
277 register_flags "${module}"
279 if test "${echo_pic}"; then
280 libs="`echo "${list}" | sed -e 's/[^ ][^ ]*/&_pic.a/g'` ${libs}"
282 libs="`echo "${list}" | sed -e 's/[^ ][^ ]*/&.a/g'` ${libs}"
285 echo "${libs} ${ldflags}"