4 exec_prefix="@exec_prefix@"
6 datarootdir="@datarootdir@"
15 builtins="@BUILTINS@ "
24 cflags_tuning="@CFLAGS_TUNING@"
25 cflags_optim_size="@CFLAGS_OPTIM_SIZE@"
26 cflags_optim_speed="@CFLAGS_OPTIM_SPEED@"
27 cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
28 cflags_nooptim="@CFLAGS_NOOPTIM@"
30 cflags_werror="@CFLAGS_WERROR@"
33 # Do not touch below this place unless you really know what you are doing
38 Usage: vlc-config OPTIONS MODULES
40 [--prefix[=DIR]] set prefix
41 [--exec-prefix[=DIR]] set exec prefix
42 [--version] print version and exit
43 [--linkage] print linkage mode (c, c++, objc)
44 [--list] print modules names and exit
45 [--libs] output linking flags
46 [--cflags] output C compilation flags
47 [--cxxflags] output C++ compilation flags
48 [--objcflags] output Objective C compilation flags
50 vlc the main VLC object
51 plugin flags for plugin modules
52 builtin flags for built-in modules
53 pic flags for PIC code
54 MODULE any available module (dummy, gtk, avi, etc.)
55 libs flags for external libs
69 if test $# -eq 0; then
74 # No need to include the default @*FLAGS@ values here because they are
75 # automatically added when using $(COMPILE), $(CXXCOMPILE) or $(OBJCCOMPILE)
77 if test "@includedir@" != "/usr/include"; then
78 includes="-I@includedir@"
80 if test "${top_builddir}" != ""; then
81 top_builddir="${top_builddir}/"
82 elif test "${TOP_BUILDDIR}" != ""; then
83 top_builddir="${TOP_BUILDDIR}/"
85 includes="${includes}"
86 cppflags="${includes}"
91 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
93 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE"
96 # Various additional defines
98 if [ "${debug}" = yes ]; then
99 cppflags="${cppflags} -DDEBUG"
100 cflags="${cflags} -g"
101 cxxflags="${cxxflags} -g"
102 objcflags="${objcflags} -g"
103 ldflags="${ldflags} -g"
105 if [ "${cprof}" = yes ]; then
106 cppflags="${cppflags} -DCPROF"
107 cflags="${cflags} -finstrument-functions"
108 cxxflags="${cxxflags} -finstrument-functions"
109 objcflags="${objcflags} -finstrument-functions"
111 if [ "${gprof}" = yes ]; then
112 cppflags="${cppflags} -DGPROF"
113 cflags="${cflags} -pg"
114 cxxflags="${cxxflags} -pg"
115 objcflags="${objcflags} -pg"
116 ldflags="${ldflags} -pg"
118 if [ "${release}" = yes ]; then
119 cppflags="${cppflags} -DHAVE_RELEASE"
121 if [ "${optim}" = size ]; then
122 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
123 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
124 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
125 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
126 cflags="${cflags} ${cflags_optim_nodebug}"
127 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
128 objcflags="${objcflags} ${cflags_optim_nodebug}"
130 elif [ "${optim}" = speed ]; then
131 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
132 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
133 objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
134 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
135 cflags="${cflags} ${cflags_optim_nodebug}"
136 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
137 objcflags="${objcflags} ${cflags_optim_nodebug}"
140 cflags="${cflags} ${cflags_nooptim}"
141 cxxflags="${cxxflags} ${cflags_nooptim}"
142 objcflags="${objcflags} ${cflags_nooptim}"
146 # The main argument loop
148 while test $# -gt 0; do
150 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
154 # Mangle plugin name, if applicable
155 # This is just a convenience hack for modules/common.am
161 tgt="${tgt%_plugin_la-*.lo}"
165 tgt="${tgt%_plugin.la}"
174 if test "${exec_prefix_set}" = no ; then
175 exec_prefix="${optarg}"
182 exec_prefix="${optarg}"
220 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
224 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
228 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
231 # Avoid to use werror on what is not vlc's code.
243 # Register per-module *FLAGS
244 register_flags "$tgt"
250 # If a module was requested, use its name
252 if test -n "${module}"; then
253 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
257 # Set the Werror flags.
260 cflags="${cflags} ${cflags_werror}"
263 # Output what we were asked
265 if test "${echo_linkage}" = yes; then
270 if test "${echo_list}" = yes; then
271 if test "${echo_plugin}" = yes; then
275 if test "${echo_builtin}" = yes; then
282 if test "${echo_prefix}" = yes; then
285 if test "${echo_exec_prefix}" = yes; then
286 echo "${exec_prefix}"
288 if test "${echo_cppflags}" = yes; then
291 if test "${echo_cflags}" = yes; then
292 echo "${cppflags} ${cflags}"
294 if test "${echo_cxxflags}" = yes; then
295 echo "${cppflags} ${cxxflags}"
297 if test "${echo_objcflags}" = yes; then
298 echo "${cppflags} ${objcflags}"
300 if test "${echo_ldflags}" = yes; then
305 # There are 4 possibilities
306 # - We are a plugin or a builtin
307 # - We are building something from the inside (builtin)
308 # - Link with builtins in place
309 # If you want something shared from the inside (binding),
310 # you need "builtin vlc"
311 if test "${echo_libs}" = yes; then