4 exec_prefix="@exec_prefix@"
6 datarootdir="@datarootdir@"
14 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@"
29 cflags_werror="@CFLAGS_WERROR@"
32 # Do not touch below this place unless you really know what you are doing
37 Usage: vlc-config OPTIONS MODULES
39 [--prefix[=DIR]] set prefix
40 [--exec-prefix[=DIR]] set exec prefix
41 [--version] print version and exit
42 [--linkage] print linkage mode (c, c++, objc)
43 [--list] print modules names and exit
44 [--libs] output linking flags
45 [--cflags] output C compilation flags
46 [--cxxflags] output C++ compilation flags
47 [--objcflags] output Objective C compilation flags
49 vlc the main VLC object
50 plugin flags for plugin modules
51 builtin flags for built-in modules
52 pic flags for PIC code
53 MODULE any available module (dummy, gtk, avi, etc.)
54 libs flags for external libs
68 if test $# -eq 0; then
73 # No need to include the default @*FLAGS@ values here because they are
74 # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE)
76 if test "@includedir@" != "/usr/include"; then
77 includes="-I@includedir@"
79 if test "${top_builddir}" != ""; then
80 top_builddir="${top_builddir}/"
81 elif test "${TOP_BUILDDIR}" != ""; then
82 top_builddir="${TOP_BUILDDIR}/"
84 includes="${includes}"
85 cppflags="${includes}"
90 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
92 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE"
95 # Various additional defines
97 if [ "${debug}" = yes ]; then
99 cxxflags="${cxxflags} -g"
100 objcflags="${objcflags} -g"
101 ldflags="${ldflags} -g"
103 if [ "${cprof}" = yes ]; then
104 cflags="${cflags} -finstrument-functions"
105 cxxflags="${cxxflags} -finstrument-functions"
106 objcflags="${objcflags} -finstrument-functions"
108 if [ "${gprof}" = yes ]; then
109 cflags="${cflags} -pg"
110 cxxflags="${cxxflags} -pg"
111 objcflags="${objcflags} -pg"
112 ldflags="${ldflags} -pg"
114 if [ "${optim}" = size ]; then
115 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
116 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
117 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
118 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
119 cflags="${cflags} ${cflags_optim_nodebug}"
120 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
121 objcflags="${objcflags} ${cflags_optim_nodebug}"
123 elif [ "${optim}" = speed ]; then
124 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
125 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
126 objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
127 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
128 cflags="${cflags} ${cflags_optim_nodebug}"
129 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
130 objcflags="${objcflags} ${cflags_optim_nodebug}"
133 cflags="${cflags} ${cflags_nooptim}"
134 cxxflags="${cxxflags} ${cflags_nooptim}"
135 objcflags="${objcflags} ${cflags_nooptim}"
139 # The main argument loop
141 while test $# -gt 0; do
143 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
147 # Mangle plugin name, if applicable
148 # This is just a convenience hack for modules/common.am
154 tgt="${tgt%_plugin_la-*.lo}"
158 tgt="${tgt%_plugin.la}"
167 if test "${exec_prefix_set}" = no ; then
168 exec_prefix="${optarg}"
175 exec_prefix="${optarg}"
213 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
217 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
221 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
224 # Avoid to use werror on what is not vlc's code.
236 # Register per-module *FLAGS
237 register_flags "$tgt"
243 # If a module was requested, use its name
245 if test -n "${module}"; then
246 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
250 # Set the Werror flags.
253 cflags="${cflags} ${cflags_werror}"
256 # Output what we were asked
258 if test "${echo_linkage}" = yes; then
263 if test "${echo_list}" = yes; then
264 if test "${echo_plugin}" = yes; then
268 if test "${echo_builtin}" = yes; then
275 if test "${echo_prefix}" = yes; then
278 if test "${echo_exec_prefix}" = yes; then
279 echo "${exec_prefix}"
281 if test "${echo_cppflags}" = yes; then
284 if test "${echo_cflags}" = yes; then
285 echo "${cppflags} ${cflags}"
287 if test "${echo_cxxflags}" = yes; then
288 echo "${cppflags} ${cxxflags}"
290 if test "${echo_objcflags}" = yes; then
291 echo "${cppflags} ${objcflags}"
293 if test "${echo_ldflags}" = yes; then
298 # There are 4 possibilities
299 # - We are a plugin or a builtin
300 # - We are building something from the inside (builtin)
301 # - Link with builtins in place
302 # If you want something shared from the inside (binding),
303 # you need "builtin vlc"
304 if test "${echo_libs}" = yes; then