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@"
30 # Do not touch below this place unless you really know what you are doing
35 Usage: vlc-config OPTIONS MODULES
37 [--prefix[=DIR]] set prefix
38 [--exec-prefix[=DIR]] set exec prefix
39 [--version] print version and exit
40 [--linkage] print linkage mode (c, c++, objc)
41 [--list] print modules names and exit
42 [--libs] output linking flags
43 [--cflags] output C compilation flags
44 [--cxxflags] output C++ compilation flags
45 [--objcflags] output Objective C compilation flags
47 vlc the main VLC object
48 plugin flags for plugin modules
49 builtin flags for built-in modules
50 pic flags for PIC code
51 MODULE any available module (dummy, gtk, avi, etc.)
52 libs flags for external libs
66 if test $# -eq 0; then
70 if test "${top_builddir}" != ""; then
71 top_builddir="${top_builddir}/"
72 elif test "${TOP_BUILDDIR}" != ""; then
73 top_builddir="${TOP_BUILDDIR}/"
75 includes="${includes}"
76 cppflags="${includes}"
81 # On Linux and Solaris, activate 64-bit off_t (by default under BSD)
83 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE"
86 # Various additional defines
88 if [ "${debug}" = yes ]; then
90 cxxflags="${cxxflags} -g"
91 objcflags="${objcflags} -g"
92 ldflags="${ldflags} -g"
94 if [ "${cprof}" = yes ]; then
95 cflags="${cflags} -finstrument-functions"
96 cxxflags="${cxxflags} -finstrument-functions"
97 objcflags="${objcflags} -finstrument-functions"
99 if [ "${gprof}" = yes ]; then
100 cflags="${cflags} -pg"
101 cxxflags="${cxxflags} -pg"
102 objcflags="${objcflags} -pg"
103 ldflags="${ldflags} -pg"
105 if [ "${optim}" = size ]; then
106 cflags="${cflags} ${cflags_optim_size} ${cflags_tuning}"
107 cxxflags="${cxxflags} ${cflags_optim_size} ${cflags_tuning}"
108 objcflags="${objcflags} ${cflags_optim_size} ${cflags_tuning}"
109 if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
110 cflags="${cflags} ${cflags_optim_nodebug}"
111 cxxflags="${cxxflags} ${cflags_optim_nodebug}"
112 objcflags="${objcflags} ${cflags_optim_nodebug}"
114 elif [ "${optim}" = speed ]; then
115 cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
116 cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
117 objcflags="${objcflags} ${cflags_optim_speed} ${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}"
124 cflags="${cflags} ${cflags_nooptim}"
125 cxxflags="${cxxflags} ${cflags_nooptim}"
126 objcflags="${objcflags} ${cflags_nooptim}"
130 # The main argument loop
132 while test $# -gt 0; do
134 -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
138 # Mangle plugin name, if applicable
139 # This is just a convenience hack for modules/common.am
145 tgt="${tgt%_plugin_la-*.lo}"
149 tgt="${tgt%_plugin.la}"
158 if test "${exec_prefix_set}" = no ; then
159 exec_prefix="${optarg}"
166 exec_prefix="${optarg}"
204 cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
208 cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
212 cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
223 # Register per-module *FLAGS
224 register_flags "$tgt"
230 # If a module was requested, use its name
232 if test -n "${module}"; then
233 cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
237 # Output what we were asked
239 if test "${echo_linkage}" = yes; then
244 if test "${echo_list}" = yes; then
245 if test "${echo_plugin}" = yes; then
249 if test "${echo_builtin}" = yes; then
256 if test "${echo_prefix}" = yes; then
259 if test "${echo_exec_prefix}" = yes; then
260 echo "${exec_prefix}"
262 if test "${echo_cppflags}" = yes; then
265 if test "${echo_cflags}" = yes; then
266 echo "${cppflags} ${cflags}"
268 if test "${echo_cxxflags}" = yes; then
269 echo "${cppflags} ${cxxflags}"
271 if test "${echo_objcflags}" = yes; then
272 echo "${cppflags} ${objcflags}"
274 if test "${echo_ldflags}" = yes; then
279 # There are 4 possibilities
280 # - We are a plugin or a builtin
281 # - We are building something from the inside (builtin)
282 # - Link with builtins in place
283 # If you want something shared from the inside (binding),
284 # you need "builtin vlc"
285 if test "${echo_libs}" = yes; then