]> git.sesse.net Git - vlc/blob - vlc-config.in.in
vlc-config: remove unused linkage command
[vlc] / vlc-config.in.in
1 #!@SHELL@
2
3 prefix="@prefix@"
4 exec_prefix="@exec_prefix@"
5 exec_prefix_set=no
6 datarootdir="@datarootdir@"
7
8 optim="@optim@"
9
10 plugins="@PLUGINS@ "
11 builtins="@BUILTINS@ "
12
13 cppflags=""
14 cflags=""
15 cxxflags=""
16 objcflags=""
17 ldflags=""
18 libs=""
19
20 cflags_tuning="@CFLAGS_TUNING@"
21
22 #
23 #  Do not touch below this place unless you really know what you are doing
24 #
25 usage()
26 {
27         cat << BLAH
28 Usage: vlc-config OPTIONS MODULES
29 Options:
30         [--prefix[=DIR]]          set prefix
31         [--exec-prefix[=DIR]]     set exec prefix
32         [--version]               print version and exit
33         [--list]                  print modules names and exit
34         [--libs]                  output linking flags
35         [--cflags]                output C compilation flags
36         [--cxxflags]              output C++ compilation flags
37         [--objcflags]             output Objective C compilation flags
38 Modules:
39         vlc                       the main VLC object
40         plugin                    flags for plugin modules
41         builtin                   flags for built-in modules
42         pic                       flags for PIC code
43         MODULE                    any available module (dummy, gtk, avi, etc.)
44         libs                      flags for external libs
45 BLAH
46         exit $1
47 }
48
49 register_flags()
50 {
51   case "$1" in
52     #@1@#
53     *)
54       ;;
55   esac
56 }
57
58 if test $# -eq 0; then
59         usage 1 1>&2
60 fi
61
62 if test "${top_builddir}" != ""; then
63   top_builddir="${top_builddir}/"
64 elif test "${TOP_BUILDDIR}" != ""; then
65   top_builddir="${TOP_BUILDDIR}/"
66 fi
67 includes="${includes}"
68 cppflags="${includes}"
69 module=""
70
71 #
72 #  On Linux and Solaris, activate 64-bit off_t (by default under BSD)
73 #
74 cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE"
75
76 #
77 #  Various additional defines
78 #
79 if [ "${optim}" = speed ]; then
80   cflags="${cflags} ${cflags_tuning}"
81   cxxflags="${cxxflags} ${cflags_tuning}"
82   objcflags="${objcflags} ${cflags_tuning}"
83 fi
84
85 #
86 #  The main argument loop
87 #
88 while test $# -gt 0; do
89   case "$1" in
90   -*=*) optarg=`echo "$1" | sed 's/-[_a-zA-Z0-9\-]*=//'` ;;
91   *) optarg= ;;
92   esac
93
94   # Mangle plugin name, if applicable
95   # This is just a convenience hack for modules/common.am
96   tgt="$1"
97   tgt="${tgt##*/}"
98   case "$tgt" in
99     lib*_plugin_la-*.lo)
100       tgt="${tgt#*lib}"
101       tgt="${tgt%_plugin_la-*.lo}"
102       ;;
103     lib*_plugin.la)
104       tgt="${tgt#lib}"
105       tgt="${tgt%_plugin.la}"
106       ;;
107     *)
108       ;;
109   esac
110
111   case "$tgt" in
112     --prefix=*)
113       prefix="${optarg}"
114       if test "${exec_prefix_set}" = no ; then
115         exec_prefix="${optarg}"
116       fi
117       ;;
118     --prefix)
119       echo_prefix=yes
120       ;;
121     --exec-prefix=*)
122       exec_prefix="${optarg}"
123       exec_prefix_set=yes
124       ;;
125     --exec-prefix)
126       echo_exec_prefix=yes
127       ;;
128     --version)
129       echo "@VERSION@"
130       exit 0
131       ;;
132     --list)
133       echo_list=yes
134       ;;
135     --cflags)
136       echo_cflags=yes
137       ;;
138     --cppflags)
139       echo_cppflags=yes
140       ;;
141     --cxxflags)
142       echo_cxxflags=yes
143       ;;
144     --objcflags)
145       echo_objcflags=yes
146       ;;
147     --ldflags)
148       echo_ldflags=yes
149       ;;
150     --libs|-libs)
151       echo_libs=yes
152       ;;
153     -*)
154       usage 1 1>&1
155       ;;
156     libvlccore)
157       cppflags="${cppflags} -D__LIBVLC__ -I${top_builddir}src/misc"
158       ;;
159     plugin)
160       echo_plugin=yes
161       cppflags="${cppflags} -D__LIBVLC__ -D__PLUGIN__"
162       ;;
163     builtin)
164       echo_builtin=yes
165       cppflags="${cppflags} -D__LIBVLC__ -D__BUILTIN__"
166       ;;
167     pic)
168       ;;
169     *)
170       module="$tgt"
171       ;;
172   esac
173
174   # Register per-module *FLAGS
175   register_flags "$tgt"
176
177   shift
178 done
179
180 #
181 #  If a module was requested, use its name
182 #
183 if test -n "${module}"; then
184   cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
185 fi
186
187 #
188 #  Output what we were asked
189 #
190 if test "${echo_list}" = yes; then
191   if test "${echo_plugin}" = yes; then
192     echo "${plugins}"
193     printf '\n'
194   fi
195   if test "${echo_builtin}" = yes; then
196     echo "${builtins}"
197     printf '\n'
198   fi
199   exit 0
200 fi
201
202 if test "${echo_prefix}" = yes; then
203   echo "${prefix}"
204 fi
205 if test "${echo_exec_prefix}" = yes; then
206   echo "${exec_prefix}"
207 fi
208 if test "${echo_cppflags}" = yes; then
209   echo "${cppflags}"
210 fi
211 if test "${echo_cflags}" = yes; then
212   echo "${cppflags} ${cflags}"
213 fi
214 if test "${echo_cxxflags}" = yes; then
215   echo "${cppflags} ${cxxflags}"
216 fi
217 if test "${echo_objcflags}" = yes; then
218   echo "${cppflags} ${objcflags}"
219 fi
220 if test "${echo_ldflags}" = yes; then
221   echo "${ldflags}"
222 fi
223
224 # Libs
225 # There are 4 possibilities
226 #  - We are a plugin or a builtin
227 #  - We are building something from the inside (builtin)
228 #       - Link with builtins in place
229 #  If you want something shared from the inside (binding),
230 #  you need "builtin vlc"
231 if test "${echo_libs}" = yes; then
232   echo "${libs}"
233 fi