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.)
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
98 cppflags="${cppflags} -DDEBUG"
99 cflags="${cflags} -g ${cflags_werror}"
100 cxxflags="${cxxflags} -g"
101 objcflags="${objcflags} -g"
102 ldflags="${ldflags} -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}" = size ]; then
121 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
122 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
123 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
124 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
125 cflags="${cflags} ${cflags_optim_nodebug}"
126 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
127 objcflags="${objcflags} ${cflags_optim_nodebug}"
129 elif [ "${optim}" = speed ]; then
130 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
131 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
132 objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
133 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
134 cflags="${cflags} ${cflags_optim_nodebug}"
135 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
136 objcflags="${objcflags} ${cflags_optim_nodebug}"
139 cflags="${cflags} ${cflags_nooptim}"
140 cxxflags="${cxxflags} ${cflags_nooptim}"
141 objcflags="${objcflags} ${cflags_nooptim}"
145 # The main argument loop
147 while test $# -gt 0; do
149 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
153 # Mangle plugin name, if applicable
154 # This is just a convenience hack for modules/common.am
160 tgt="${tgt%_plugin_la-*.lo}"
164 tgt="${tgt%_plugin.la}"
173 if test "${exec_prefix_set}" = no ; then
174 exec_prefix="${optarg}"
181 exec_prefix="${optarg}"
219 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
223 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
227 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
238 # Register per-module *FLAGS
239 register_flags "$tgt"
245 # If a module was requested, use its name
247 if test -n "${module}"; then
248 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
252 # Output what we were asked
254 if test "${echo_linkage}" = yes; then
259 if test "${echo_list}" = yes; then
260 if test "${echo_plugin}" = yes; then
264 if test "${echo_builtin}" = yes; then
271 if test "${echo_prefix}" = yes; then
274 if test "${echo_exec_prefix}" = yes; then
275 echo "${exec_prefix}"
277 if test "${echo_cppflags}" = yes; then
280 if test "${echo_cflags}" = yes; then
281 echo "${cppflags} ${cflags}"
283 if test "${echo_cxxflags}" = yes; then
284 echo "${cppflags} ${cxxflags}"
286 if test "${echo_objcflags}" = yes; then
287 echo "${cppflags} ${objcflags}"
289 if test "${echo_ldflags}" = yes; then
294 # There are 4 possibilities
295 # - We are a plugin or a builtin
296 # - We are building something from the inside (builtin)
297 # - Link with builtins in place
298 # If you want something shared from the inside (binding),
299 # you need "builtin vlc"
300 if test "${echo_libs}" = yes; then