3 ## bootstrap file for the VLC media player
5 ## Copyright (C) 2005-2006 the VideoLAN team
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 if test "$#" != "0"; then
12 echo " Calls automake, autoconf, autoheader, autopoint and other auto* to generate"
13 echo " m4 macros and prepare Makefiles."
18 ### Get a sane environment, just in case
29 ## Check for various tools
34 ACLOCAL_ARGS
="-I m4 ${ACLOCAL_ARGS}"
36 # Check for contrib directory
37 if test -d extras
/contrib
/bin
; then
38 export PATH
="`pwd`/extras/contrib/bin:$PATH"
39 if test -d extras
/contrib
/share
/aclocal
; then
40 ACLOCAL_ARGS
="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
42 if test ".`uname -s`" = ".Darwin"; then
43 export LD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LD_LIBRARY_PATH
44 export DYLD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$DYLD_LIBRARY_PATH
45 elif test ".`uname -s`" = ".BeOS"; then
46 export LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LIBRARY_PATH
47 export BELIBRARIES
=.
/extras
/contrib
/lib
:$BELIBRARIES
52 rm -f m
4/autoconf260.
m4
53 case "$(autoconf --version|head -1)" in
55 echo "Hey, your autoconf is quite old. Update it." >&2
60 echo "Enabling provisional autoconf 2.59 work-around. Update autoconf ASAP."
61 cp -f extras
/m
4/autoconf260.
m4 m
4/
67 for v
in "-1.10" "110" "-1.9" "19"; do
68 if automake
${v} --version >/dev
/null
2>&1; then
70 amvers
="`echo ${v} | sed -e 's/^-//'`"
75 if test "${amvers}" = "no" && automake
--version > /dev
/null
2>&1; then
76 amvers
="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
81 no|
1.
[012345678]|
1.
[0123456].
*|
1[0123456]|
1.
[0123456]-*)
83 echo "$0: you need automake version 1.9 or later"
90 if glibtoolize
--version >/dev
/null
2>&1; then
91 libtoolize
="glibtoolize"
92 elif libtoolize
--version >/dev
/null
2>&1; then
93 libtoolize
="libtoolize"
96 if test "$libtoolize" = "no"; then
98 echo "$0: you need libtool"
103 if gettextize
--version >/dev
/null
2>&1; then
104 # Autopoint is available from 0.11.3, but we need 0.11.5
105 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
106 '>=' 0.11.5 >/dev
/null
2>&1; then
107 # We have gettext, and a recent version! Everything is cool.
111 # User's gettext is too old. try to continue anyway.
116 echo "you need gettextize (package gettext-devel or gettext)"
120 # Check for pkg-config
121 if pkg-config
--version >/dev
/null
2>&1; then
122 # We have pkg-config, everything is cool.
128 aclocal
=aclocal
${amsuff}
129 automake
=automake
${amsuff}
131 autoheader
=autoheader
134 ## Generate the modules makefile, by parsing modules/**/Modules.am
138 echo "generating modules/**/Makefile.am and m4/private.m4"
140 # Prepare m4/private.m4
141 rm -f m
4/private.
m4 && cat > m
4/private.
m4 << EOF
142 dnl Private VLC macros - generated by bootstrap
146 if [ "${PKGCONFIG}" = "no" ]; then cat >> m
4/private.
m4 << EOF
147 dnl User does not have pkg-config, so assume package was not found
148 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
153 if [ "${GETTEXT}" != "yes" ]; then cat >> m
4/private.
m4 << EOF
154 dnl User does not have gettext, so this is a no-op
155 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
160 rm -f m
4/private.m4-tmp1
&& cat > m
4/private.m4-tmp1
<< EOF
161 dnl The required AM_CONDITIONAL calls
162 dnl XXX: too many conditionals make the build very slow, disabled them
163 AC_DEFUN([VLC_CONDITIONALS], [
165 rm -f m
4/private.m4-tmp2
&& cat > m
4/private.m4-tmp2
<< EOF
166 dnl The required AC_SUBST calls
167 AC_DEFUN([VLC_SUBSTS], [
169 rm -f m
4/private.m4-tmp3
&& cat > m
4/private.m4-tmp3
<< EOF
170 dnl The required AC_OUTPUT calls
171 dnl XXX: this feature is only supported starting from automake-1.7
172 AC_DEFUN([VLC_MAKEFILES], [AC_OUTPUT([
174 rm -f m
4/private.m4-tmp4
&& cat > m
4/private.m4-tmp4
<< EOF
175 dnl Helper macro for vlc-config generation
176 AC_DEFUN([VLC_CONFIG_HELPER], [
177 cat >> vlc-config.in << BLAH
182 rm -f modules
/Makefile.am
&& cat > modules
/Makefile.am
<< EOF
183 # Autogenerated by bootstrap - DO NOT EDIT
185 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
188 for dir
in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
191 modf
="modules/${dir}/Modules.am"
192 makf
="modules/${dir}/Makefile.am"
193 basedir
="`echo "${dir}" | cut -f1 -d/`"
194 # automake will not recurse for make dist if we don't define SUBDIRS = .
195 subdirs
="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
196 mods
="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | xargs`"
201 extra_libs
="${extra_libs} lib${mod}_plugin.a lib${mod}.a"
202 extra_ltlibs
="${extra_ltlibs} lib${mod}_plugin.la"
204 rm -f "${makf}" && cat > "${makf}" << EOF
206 # ${makf} automatically generated from ${modf} by bootstrap
207 # DO NOT EDIT - edit Modules.am or \$(top_srcdir)/bootstrap instead
215 EXTRA_DIST = Modules.am
219 SUFFIXES = _plugin\$(LIBEXT) _plugin.a
221 libvlcdir = \$(libdir)/vlc/\$(basedir)
223 EXTRA_LIBRARIES = ${extra_libs}
224 EXTRA_LTLIBRARIES = ${extra_ltlibs}
228 LTLIBVLC = \$(top_builddir)/src/libvlc.la
231 LIBVLC = -L\$(top_builddir)/src -lvlc
238 \$(top_builddir)/compile
240 # Find out which modules were enabled and tell make to build them
243 @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
244 z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin.la;; esac; done; \\
245 \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
248 @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
249 z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; \\
250 z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; \\
251 \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
255 # Build a plugin with the adequate linker and linker's flags
256 _plugin.a_plugin\$(LIBEXT):
257 @mod="\$*" ; mod=\$\${mod#lib} ; \
258 ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` \$(LIBADD) -u \$(SYMPREF)\$(VLC_ENTRY)" ; \
259 case \`\$(VLC_CONFIG) --linkage \$\$mod\` in \\
260 c++) ld="\$(CXXLINK)" ;; \
261 objc) ld="\$(OBJCLINK)" ;; \
262 c|*) ld="\$(LINK)" ;; \
264 echo \$\$ld \$< \$\$ldfl ; \
266 #ifneq (,\$(findstring cygwin,\$(host)))
267 # mv -f "\$@.exe" "\$@"
269 @if test -f "\$@.exe"; then mv -f "\$@.exe" "\$@"; fi
272 \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap
273 cd \$(top_srcdir) && \$(SHELL) ./bootstrap
280 -rm -f *.a *\$(LIBEXT)
283 clean-local: \$(clean_modules)
285 ### automake creates libvlcdir after running install-*-local
286 ### so we have to create it ourselves first
287 install-exec-local: all-modules
289 @if test -z "\$(libvlc_LTLIBRARIES)"; then \
290 z=\$\$(\$(VLC_CONFIG) --list plugin); \
291 m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
293 \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" install-libvlcLTLIBRARIES || exit \$\$? ; \
296 mkdir -p -- "\$(DESTDIR)\$(libvlcdir)"
297 @z=\$\$(\$(VLC_CONFIG) --list plugin); \
298 for mod in \$(mods); do \
300 in *\ \$\${mod}\ *) \
301 echo \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" ; \
302 \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" || exit \$\$?; \
310 @if test -z "\$(libvlc_LTLIBRARIES)"; then \
311 z=\$\$(\$(VLC_CONFIG) --list plugin); \
312 m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
314 \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" uninstall-libvlcLTLIBRARIES || exit \$\$?; \
317 @z=\$\$(\$(VLC_CONFIG) --list plugin); \
318 for mod in \$(mods); do \
320 in *\ \$\${mod}\ *) \
321 echo rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" ; \
322 rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" || true; \
331 if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev
/null
2>&1; then
334 cat >> m
4/private.m4-tmp4
<< EOF
335 ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
337 # Generation of modules/**/Makefile.am
338 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
339 # - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
340 # S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
341 # the resulting file size.
342 # - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
343 # work properly with any automake version I tested.
344 cat >> "${makf}" << EOF
348 if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
349 clean_modules += clean-${mod}
351 -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
355 if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
356 BUILT_SOURCES += \$(B${mod})
359 cat >> "${makf}" << EOF
360 lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
361 lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
363 if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
364 nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
365 nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod})
368 cat >> "${makf}" << EOF
369 lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
370 lib${mod}_plugin_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
371 lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
372 lib${mod}_plugin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
373 lib${mod}_plugin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
374 lib${mod}_plugin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
375 lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\
376 -rpath '\$(libvlcdir)' -avoid-version -module -shrext \$(LIBEXT) \\
377 -export-symbol-regex ^\$(VLC_ENTRY)\$\$ -no-undefined
378 lib${mod}_plugin_la_LIBADD = \$(LTLIBVLC)
380 lib${mod}_a_SOURCES = \$(SOURCES_${mod})
382 if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
383 nodist_lib${mod}_a_SOURCES = \$(nodist_SOURCES_${mod})
386 cat >> "${makf}" << EOF
387 lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin pic ${mod}\`
388 lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin pic ${mod}\`
389 lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin pic ${mod}\`
395 cat >> m
4/private.m4-tmp1
<< EOF
398 cat m
4/private.m4-tmp1
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp1
399 cat >> m
4/private.m4-tmp2
<< EOF
402 cat m
4/private.m4-tmp2
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp2
403 cat >> m
4/private.m4-tmp3
<< EOF
406 cat m
4/private.m4-tmp3
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp3
407 cat >> m
4/private.m4-tmp4
<< EOF
411 cat m
4/private.m4-tmp4
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp4
416 ### classic bootstrap stuff
420 # remove autotools cruft
421 rm -f aclocal.
m4 configure config.log config.h config.h.
in
422 rm -Rf autom4te
*.cache
423 # remove old autotools extra cruft
424 rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
425 # remove new autotools extra cruft
428 # remove libtool cruft
429 rm -f ltmain.sh libtool ltconfig
430 # remove gettext cruft
434 rm -f stamp-builtin stamp-h
* mozilla
/stamp-pic
436 # Automake complains if these are not present
437 rm -f vlc-config.
in && printf "" > vlc-config.
in
438 if [ "$GETTEXT" != "yes" ]; then
439 test -d intl || mkdir intl
440 printf "" > intl
/Makefile.am
441 printf "" > ABOUT-NLS
444 # Libtoolize directory
445 ${libtoolize} --copy --force
446 if test -f "ltmain.sh"; then
447 echo "$0: working around a minor libtool issue"
448 mv ltmain.sh autotools
/
451 # patch for DLL link for libtool on cygwin (remove when fixed)
452 if test ".`uname -s|sed -n '/^CYGWIN/p'`" != "."; then
453 patch -s -p0 << 'EOF'
454 --- autotools
/ltmain.orig
2006-12-05 15:15:42.064607000 +0000
455 +++ autotools
/ltmain.sh
2006-12-05 15:16:24.705777800 +0000
456 @@
-4360,7 +4360,7 @@
460 - *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
461 + *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,;s,.dll.exe$,.dll,'` ;;
463 if test -n "$vinfo"; then
464 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
470 ${aclocal} ${ACLOCAL_ARGS}
473 ${automake} --add-missing --copy -Wall
476 ## files which need to be regenerated
478 rm -f vlc-config.
in vlc-config
479 rm -f src
/misc
/modules_builtin.h
485 ## Tell the user about gettext, pkg-config and sed
487 if [ "${GETTEXT}" = "old" ]; then
490 ==========================================================
491 NOTE: you have an old version of gettext installed on your
492 system. The vlc build will work, but if your system does not
493 have libintl you will not have internationalization support.
494 We suggest upgrading to gettext 0.11.5 or later.
498 if [ "$PKGCONFIG" = "no" ]; then
501 ==============================================================
502 NOTE: you do not have the "pkg-config" utility on your system;
503 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be