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