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
100 cxxflags="${cxxflags} -g"
101 objcflags="${objcflags} -g"
102 ldflags="${ldflags} -g"
104 if [ "${cprof}" = yes ]; then
105 cflags="${cflags} -finstrument-functions"
106 cxxflags="${cxxflags} -finstrument-functions"
107 objcflags="${objcflags} -finstrument-functions"
109 if [ "${gprof}" = yes ]; then
110 cflags="${cflags} -pg"
111 cxxflags="${cxxflags} -pg"
112 objcflags="${objcflags} -pg"
113 ldflags="${ldflags} -pg"
115 if [ "${optim}" = size ]; then
116 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
117 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
118 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
119 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
120 cflags="${cflags} ${cflags_optim_nodebug}"
121 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
122 objcflags="${objcflags} ${cflags_optim_nodebug}"
124 elif [ "${optim}" = speed ]; then
125 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
126 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
127 objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
128 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
129 cflags="${cflags} ${cflags_optim_nodebug}"
130 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
131 objcflags="${objcflags} ${cflags_optim_nodebug}"
134 cflags="${cflags} ${cflags_nooptim}"
135 cxxflags="${cxxflags} ${cflags_nooptim}"
136 objcflags="${objcflags} ${cflags_nooptim}"
140 # The main argument loop
142 while test $# -gt 0; do
144 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
148 # Mangle plugin name, if applicable
149 # This is just a convenience hack for modules/common.am
155 tgt="${tgt%_plugin_la-*.lo}"
159 tgt="${tgt%_plugin.la}"
168 if test "${exec_prefix_set}" = no ; then
169 exec_prefix="${optarg}"
176 exec_prefix="${optarg}"
214 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
218 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
222 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
225 # Avoid to use werror on what is not vlc's code.
237 # Register per-module *FLAGS
238 register_flags "$tgt"
244 # If a module was requested, use its name
246 if test -n "${module}"; then
247 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
251 # Set the Werror flags.
254 cflags="${cflags} ${cflags_werror}"
257 # Output what we were asked
259 if test "${echo_linkage}" = yes; then
264 if test "${echo_list}" = yes; then
265 if test "${echo_plugin}" = yes; then
269 if test "${echo_builtin}" = yes; then
276 if test "${echo_prefix}" = yes; then
279 if test "${echo_exec_prefix}" = yes; then
280 echo "${exec_prefix}"
282 if test "${echo_cppflags}" = yes; then
285 if test "${echo_cflags}" = yes; then
286 echo "${cppflags} ${cflags}"
288 if test "${echo_cxxflags}" = yes; then
289 echo "${cppflags} ${cxxflags}"
291 if test "${echo_objcflags}" = yes; then
292 echo "${cppflags} ${objcflags}"
294 if test "${echo_ldflags}" = yes; then
299 # There are 4 possibilities
300 # - We are a plugin or a builtin
301 # - We are building something from the inside (builtin)
302 # - Link with builtins in place
303 # If you want something shared from the inside (binding),
304 # you need "builtin vlc"
305 if test "${echo_libs}" = yes; then