3 ## bootstrap file for the VLC media player
4 ## $Id: bootstrap,v 1.71 2003/07/24 20:34:47 sam Exp $
6 ## Authors: Sam Hocevar <sam@zoy.org>
8 if test "$#" != "0"; then
10 echo " Calls automake, autoconf, autoheader, autopoint and other auto* to generate"
11 echo " m4 macros and prepare Makefiles."
16 ### Get a sane environment, just in case
26 ## Naively assume our system doesn't suck. Unfortunately it seldom doesn't.
32 ## Generate the modules makefile, by parsing modules/**/Modules.am
35 printf "generating modules/**/Makefile.am and m4/private.m4"
37 # Prepare m4/private.m4
38 rm -f m
4/private.
m4 && cat > m
4/private.
m4 << EOF
39 dnl Private VLC macros - generated by bootstrap
42 rm -f m
4/private.m4-tmp1
&& cat > m
4/private.m4-tmp1
<< EOF
43 dnl The required AM_CONDITIONAL calls
44 dnl XXX: too many conditionals make the build very slow, disabled them
45 AC_DEFUN([AX_VLC_CONDITIONALS], [
47 rm -f m
4/private.m4-tmp2
&& cat > m
4/private.m4-tmp2
<< EOF
48 dnl The required AC_SUBST calls
49 AC_DEFUN([AX_VLC_SUBSTS], [
51 rm -f m
4/private.m4-tmp3
&& cat > m
4/private.m4-tmp3
<< EOF
52 dnl The required AC_OUTPUT calls
53 dnl XXX: this feature is only supported starting from automake-1.7
54 AC_DEFUN([AX_VLC_MAKEFILES], [AC_OUTPUT([
56 rm -f m
4/private.m4-tmp4
&& cat > m
4/private.m4-tmp4
<< EOF
57 dnl Helper macro for vlc-config generation
58 AC_DEFUN([AX_VLC_CONFIG_HELPER], [
59 cat >> vlc-config.in << BLAH
64 rm -f modules
/Makefile.am
&& cat > modules
/Makefile.am
<< EOF
65 # Autogenerated by bootstrap - DO NOT EDIT
67 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
68 #DIST_SUBDIRS = \$(SUBDIRS)
71 for dir
in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
74 mf
="modules/${dir}/Modules.am"
76 # automake will not recurse for make dist if we don't define SUBDIRS = .
77 subdirs
="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
78 rm -f modules
/${dir}/Makefile.am
&& cat > modules
/${dir}/Makefile.am
<< EOF
80 # Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
86 EXTRA_DIST = Modules.am
89 #DIST_SUBDIRS = \$(SUBDIRS)
90 libvlcdir = \$(libdir)/vlc/${basedir}
95 -rm -f *.a *.so *.dll *.sl *.dylib
98 for mod
in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
100 if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev
/null
2>&1; then
103 if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/dev
/null
2>&1; then
106 # cat >> m4/private.m4-tmp1 << EOF
107 #dnl AM_CONDITIONAL(${mod}_p, test x\$${mod}_p = xyes)
108 #dnl AM_CONDITIONAL(${mod}_b, test x\$${mod}_b = xyes)
110 cat >> m
4/private.m4-tmp4
<< EOF
111 ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
113 # Generation of modules/**/Makefile.am
114 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115 # - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
116 # S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
117 # the resulting file size.
118 # - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
119 # work properly with any automake version I tested.
120 cat >> modules
/${dir}/Makefile.am
<< EOF
126 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
128 -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
132 cat >> modules
/${dir}/Makefile.am
<< EOF
135 @set fnord \$\$MAKEFLAGS; amf=\$\$2; \\
136 if test "\$(plugin)" != "no" \\
137 && \$(VLC_CONFIG) --target plugin | grep "${dir}/lib${mod}_plugin" >/dev/null 2>&1; then \\
138 \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_plugin\$(LIBEXT) || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
140 if test "\$(builtin)" != "no" \\
141 && \$(VLC_CONFIG) --target builtin | grep "${dir}/lib${mod}\\.a" >/dev/null 2>&1; then \\
142 \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
144 if test "\$(pic)" != "no" \\
145 && \$(VLC_CONFIG) --target builtin pic | grep "${dir}/lib${mod}_pic\\.a" >/dev/null 2>&1; then \\
146 \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_pic.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
150 @set fnord \$\$MAKEFLAGS; amf=\$\$2; \\
151 if test "\$(plugin)" != "no" \\
152 && \$(VLC_CONFIG) --target plugin | grep "${dir}/lib${mod}_plugin" >/dev/null 2>&1; then \\
153 \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_plugin\$(LIBEXT) || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
155 if test "\$(builtin)" != "no" \\
156 && \$(VLC_CONFIG) --target builtin | grep "${dir}/lib${mod}\\.a" >/dev/null 2>&1; then \\
157 \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
163 L${mod}p = lib${mod}_plugin.a
164 D${mod}p = lib${mod}_plugin\$(LIBEXT)
165 L${mod}b = lib${mod}.a
166 L${mod}pic = lib${mod}_pic.a
168 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
169 B${mod} = \$(nodist_SOURCES_${mod})
172 cat >> modules
/${dir}/Makefile.am
<< EOF
176 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
177 ${PRIVATE}BUILT_SOURCES += \$(B${mod})
180 cat >> modules
/${dir}/Makefile.am
<< EOF
181 ${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
183 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
184 ${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
187 cat >> modules
/${dir}/Makefile.am
<< EOF
188 lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
189 lib${mod}_plugin_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
190 lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
192 lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
194 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
195 nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
198 cat >> modules
/${dir}/Makefile.am
<< EOF
199 lib${mod}_pic_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin pic ${mod}\`
200 lib${mod}_pic_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin pic ${mod}\`
201 lib${mod}_pic_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin pic ${mod}\`
203 lib${mod}_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
205 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
206 nodist_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
209 cat >> modules
/${dir}/Makefile.am
<< EOF
210 lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
211 lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
212 lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
214 libvlc_LIBRARIES += \$(L${mod}b) \$(L${mod}pic)
215 lib${mod}_DATA = \$(D${mod}p)
217 lib${mod}dir = \$(libdir)/vlc/${topdir}
218 ${PRIVATE}noinst_LIBRARIES += \$(L${mod}p)
219 ${PRIVATE}lib${mod}_plugin\$(LIBEXT): \$(lib${mod}_plugin_a_OBJECTS)
220 ${PRIVATE} @case \`\$(VLC_CONFIG) --linkage ${mod}\` in \\
221 ${PRIVATE} c++) echo \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
222 ${PRIVATE} objc) echo \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
223 ${PRIVATE} c|*) echo \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
231 cat >> m
4/private.m4-tmp1
<< EOF
232 AM_CONDITIONAL(UNTRUE, false)
235 cat m
4/private.m4-tmp1
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp1
236 cat >> m
4/private.m4-tmp2
<< EOF
239 cat m
4/private.m4-tmp2
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp2
240 cat >> m
4/private.m4-tmp3
<< EOF
243 cat m
4/private.m4-tmp3
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp3
244 cat >> m
4/private.m4-tmp4
<< EOF
248 cat m
4/private.m4-tmp4
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp4
253 ### classic bootstrap stuff
257 # remove autotools cruft
258 rm -f aclocal.
m4 configure config.log config.h config.h.
in
259 # remove old autotools extra cruft
260 rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
261 # remove new autotools extra cruft
262 (cd autotools
&& rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
)
263 # remove libtool cruft
264 rm -f ltmain.sh libtool ltconfig
265 # remove gettext cruft
268 # remove old vlc cruft
269 rm -f m
4/oldgettext.
m4 stamp-pic configure.ac.
in Modules.am
270 # remove new vlc cruft
271 rm -f stamp-builtin stamp-h
* mozilla
/stamp-pic
274 if gettextize
--version >/dev
/null
2>&1; then
275 # Autopoint is available from 0.11.3, but we need 0.11.5
276 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
277 '>=' 0.11.5 >/dev
/null
2>&1; then
278 # We have gettext, and a recent version! Everything is cool.
282 # User's gettext is too old. try to continue anyway.
285 echo > intl
/Makefile.am
286 cat >> m
4/private.
m4 << EOF
287 dnl User's gettext is too old, so this is a no-op
288 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
294 # we don't have gettext. grmbl. try to continue anyway.
297 echo > intl
/Makefile.am
298 cat >> m
4/private.
m4 << EOF
299 dnl User does not have gettext, so this is a no-op
300 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
307 # Check for pkg-config
308 if pkg-config
--version >/dev
/null
2>&1; then
309 # We have pkg-config, everything is cool.
312 # Not present, use a workaround.
313 cat >> m
4/private.
m4 << EOF
314 dnl User does not have pkg-config, so this is a no-op
315 AC_DEFUN([PKG_CHECK_MODULES], [])
323 if automake-1.7
--version >/dev
/null
2>&1; then
325 # If we also have 1.6, use it instead because it is faster
326 if automake-1.6
--version >/dev
/null
2>&1; then
327 if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev
/null
2>&1; then
331 elif automake-1.6
--version >/dev
/null
2>&1; then
333 if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev
/null
2>&1; then
336 elif automake-1.5
--version >/dev
/null
2>&1; then
339 elif automake
--version > /dev
/null
2>&1; then
341 case "`automake --version | sed -e '1s/[^0-9]*//' -e q`" in
342 0|
0.
*|
1|
1.
[01234]|
1.
[01234][-.
]*)
351 if test "${amvers}" = "none"; then
353 echo "you need automake version 1.5 or later"
357 aclocal
=aclocal
${amvers}
358 automake
=automake
${amvers}
360 autoheader
=autoheader
362 # Automake complains if this is not present
363 rm -f vlc-config.
in && printf "" > vlc-config.
in
370 ${automake} --add-missing --copy
373 ## files which need to be regenerated
375 rm -f vlc-config.
in vlc-config
376 rm -f src
/misc
/modules_builtin.h src
/misc
/modules_plugin.h
377 rm -f include
/vlc_symbols.h
378 rm -f mozilla
/vlcintf.h
384 ## Tell the user about gettext, pkg-config and sed
390 ===========================================================
391 IMPORTANT NOTE: you do not have gettext installed on your
392 system. The vlc build will work, but you will not have
393 internationalization support. We suggest installing gettext.
398 ==========================================================
399 NOTE: you have an old version of gettext installed on your
400 system. The vlc build will work, but if your system does not
401 have libintl you will not have internationalization support.
402 We suggest upgrading to gettext 0.11.5 or later.
411 ==============================================================
412 NOTE: you do not have the "pkg-config" utility on your system;
413 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
419 case "$AUTOMAKESUCKS" in
423 =============================================================
424 IMPORTANT NOTE: your version of automake has a bug which will
425 prevent proper plugin compilation. Either compile VLC with
426 the --disable-plugins flag, or use a version of automake newer
427 than 1.6.1 (1.6.2 is OK, and so are the 1.5 series).
432 case "$INSTALLSUCKS" in
436 =============================================================
437 IMPORTANT NOTE: your version of automake has a bug which will
438 prevent proper installation. Do not use "make install" with this
439 version of automake, or use a version of automake newer than 1.5
440 (such as 1.6 or 1.7).