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
72 if test "${top_builddir}" != ""; then
73 top_builddir="${top_builddir}/"
74 elif test "${TOP_BUILDDIR}" != ""; then
75 top_builddir="${TOP_BUILDDIR}/"
77 includes="${includes}"
78 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_REENTRANT -D_THREAD_SAFE"
88 # Various additional defines
90 if [ "${debug}" = yes ]; then
92 cxxflags="${cxxflags} -g"
93 objcflags="${objcflags} -g"
94 ldflags="${ldflags} -g"
96 if [ "${cprof}" = yes ]; then
97 cflags="${cflags} -finstrument-functions"
98 cxxflags="${cxxflags} -finstrument-functions"
99 objcflags="${objcflags} -finstrument-functions"
101 if [ "${gprof}" = yes ]; then
102 cflags="${cflags} -pg"
103 cxxflags="${cxxflags} -pg"
104 objcflags="${objcflags} -pg"
105 ldflags="${ldflags} -pg"
107 if [ "${optim}" = size ]; then
108 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
109 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
110 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
111 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
112 cflags="${cflags} ${cflags_optim_nodebug}"
113 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
114 objcflags="${objcflags} ${cflags_optim_nodebug}"
116 elif [ "${optim}" = speed ]; then
117 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
118 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
119 objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
120 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
121 cflags="${cflags} ${cflags_optim_nodebug}"
122 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
123 objcflags="${objcflags} ${cflags_optim_nodebug}"
126 cflags="${cflags} ${cflags_nooptim}"
127 cxxflags="${cxxflags} ${cflags_nooptim}"
128 objcflags="${objcflags} ${cflags_nooptim}"
132 # The main argument loop
134 while test $# -gt 0; do
136 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
140 # Mangle plugin name, if applicable
141 # This is just a convenience hack for modules/common.am
147 tgt="${tgt%_plugin_la-*.lo}"
151 tgt="${tgt%_plugin.la}"
160 if test "${exec_prefix_set}" = no ; then
161 exec_prefix="${optarg}"
168 exec_prefix="${optarg}"
206 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
210 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
214 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
217 # Avoid to use werror on what is not vlc's code.
229 # Register per-module *FLAGS
230 register_flags "$tgt"
236 # If a module was requested, use its name
238 if test -n "${module}"; then
239 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
243 # Set the Werror flags.
246 cflags="${cflags} ${cflags_werror}"
249 # Output what we were asked
251 if test "${echo_linkage}" = yes; then
256 if test "${echo_list}" = yes; then
257 if test "${echo_plugin}" = yes; then
261 if test "${echo_builtin}" = yes; then
268 if test "${echo_prefix}" = yes; then
271 if test "${echo_exec_prefix}" = yes; then
272 echo "${exec_prefix}"
274 if test "${echo_cppflags}" = yes; then
277 if test "${echo_cflags}" = yes; then
278 echo "${cppflags} ${cflags}"
280 if test "${echo_cxxflags}" = yes; then
281 echo "${cppflags} ${cxxflags}"
283 if test "${echo_objcflags}" = yes; then
284 echo "${cppflags} ${objcflags}"
286 if test "${echo_ldflags}" = yes; then
291 # There are 4 possibilities
292 # - We are a plugin or a builtin
293 # - We are building something from the inside (builtin)
294 # - Link with builtins in place
295 # If you want something shared from the inside (binding),
296 # you need "builtin vlc"
297 if test "${echo_libs}" = yes; then