3 ## bootstrap file for the VLC media player
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
27 ## Check for various tools
34 # Check for contrib directory
35 if test -d extras
/contrib
/bin
; then
36 export PATH
=.
/extras
/contrib
/bin
:$PATH
37 ACLOCAL_ARGS
="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
38 if test ".`uname -s`" = ".Darwin"; then
39 export LD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LD_LIBRARY_PATH
40 export DYLD_LIBRARY_PATH
=.
/extras
/contrib
/lib
:$DYLD_LIBRARY_PATH
41 elif test ".`uname -s`" = ".BeOS"; then
42 export LIBRARY_PATH
=.
/extras
/contrib
/lib
:$LIBRARY_PATH
43 export BELIBRARIES
=.
/extras
/contrib
/lib
:$BELIBRARIES
49 if automake-1.8
--version >/dev
/null
2>&1; then
51 # If we also have 1.6 (>> 1.6.1), use it instead because it is faster
52 if automake-1.6
--version >/dev
/null
2>&1; then
53 if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev
/null
2>&1; then
57 elif automake-1.7
--version >/dev
/null
2>&1; then
59 # If we also have 1.6 (>> 1.6.1), use it instead because it is faster
60 if automake-1.6
--version >/dev
/null
2>&1; then
61 if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" ">" "1.6.1" > /dev
/null
2>&1; then
65 elif automake-1.6
--version >/dev
/null
2>&1; then
67 if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev
/null
2>&1; then
70 elif automake-1.5
--version >/dev
/null
2>&1; then
73 elif automake
--version > /dev
/null
2>&1; then
75 case "`automake --version | sed -e '1s/[^0-9]*//' -e q`" in
76 0|
0.
*|
1|
1.
[01234]|
1.
[01234][-.
]*)
85 if test "${amvers}" = "none"; then
87 echo "you need automake version 1.5 or later"
92 if gettextize
--version >/dev
/null
2>&1; then
93 # Autopoint is available from 0.11.3, but we need 0.11.5
94 if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
95 '>=' 0.11.5 >/dev
/null
2>&1; then
96 # We have gettext, and a recent version! Everything is cool.
100 # User's gettext is too old. try to continue anyway.
104 # we don't have gettext. grmbl. try to continue anyway.
109 # Check for pkg-config
110 if pkg-config
--version >/dev
/null
2>&1; then
111 # We have pkg-config, everything is cool.
117 aclocal
=aclocal
${amvers}
118 automake
=automake
${amvers}
120 autoheader
=autoheader
123 ## Generate the modules makefile, by parsing modules/**/Modules.am
127 echo "generating modules/**/Makefile.am and m4/private.m4"
129 # Prepare m4/private.m4
130 rm -f m
4/private.
m4 && cat > m
4/private.
m4 << EOF
131 dnl Private VLC macros - generated by bootstrap
135 if [ "${PKGCONFIG}" = "no" ]; then cat >> m
4/private.
m4 << EOF
136 dnl User does not have pkg-config, so this is a no-op
137 AC_DEFUN([PKG_CHECK_MODULES], [:], [], [], [])
142 if [ "${GETTEXT}" != "yes" ]; then cat >> m
4/private.
m4 << EOF
143 dnl User does not have gettext, so this is a no-op
144 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
149 rm -f m
4/private.m4-tmp1
&& cat > m
4/private.m4-tmp1
<< EOF
150 dnl The required AM_CONDITIONAL calls
151 dnl XXX: too many conditionals make the build very slow, disabled them
152 AC_DEFUN([VLC_CONDITIONALS], [
154 rm -f m
4/private.m4-tmp2
&& cat > m
4/private.m4-tmp2
<< EOF
155 dnl The required AC_SUBST calls
156 AC_DEFUN([VLC_SUBSTS], [
158 rm -f m
4/private.m4-tmp3
&& cat > m
4/private.m4-tmp3
<< EOF
159 dnl The required AC_OUTPUT calls
160 dnl XXX: this feature is only supported starting from automake-1.7
161 AC_DEFUN([VLC_MAKEFILES], [AC_OUTPUT([
163 rm -f m
4/private.m4-tmp4
&& cat > m
4/private.m4-tmp4
<< EOF
164 dnl Helper macro for vlc-config generation
165 AC_DEFUN([VLC_CONFIG_HELPER], [
166 cat >> vlc-config.in << BLAH
171 rm -f modules
/Makefile.am
&& cat > modules
/Makefile.am
<< EOF
172 # Autogenerated by bootstrap - DO NOT EDIT
174 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
175 #DIST_SUBDIRS = \$(SUBDIRS)
178 for dir
in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
181 mf
="modules/${dir}/Modules.am"
182 basedir
="`echo "${dir}" | cut -f1 -d/`"
183 # automake will not recurse for make dist if we don't define SUBDIRS = .
184 subdirs
="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
185 rm -f modules
/${dir}/Makefile.am
&& cat > modules
/${dir}/Makefile.am
<< EOF
187 # Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
193 EXTRA_DIST = Modules.am
196 #DIST_SUBDIRS = \$(SUBDIRS)
197 libvlcdir = \$(libdir)/vlc/${basedir}
202 # There's no need for pic code on win32 so get rid of this to substantially
203 # reduce the compilation time.
211 -rm -f *.a *.so *.dll *.sl *.dylib
215 @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
216 if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target plugin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}_plugin*) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
217 if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target builtin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}.a*) echo lib\$\${mod}.a;; esac; done; fi; \\
218 if test "\$(pic)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target builtin pic); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}_pic.a*) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
219 \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
223 for mod
in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
225 if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev
/null
2>&1; then
228 if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/dev
/null
2>&1; then
231 # cat >> m4/private.m4-tmp1 << EOF
232 #dnl AM_CONDITIONAL(${mod}_p, test x\$${mod}_p = xyes)
233 #dnl AM_CONDITIONAL(${mod}_b, test x\$${mod}_b = xyes)
235 cat >> m
4/private.m4-tmp4
<< EOF
236 ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
238 # Generation of modules/**/Makefile.am
239 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240 # - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
241 # S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
242 # the resulting file size.
243 # - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
244 # work properly with any automake version I tested.
245 cat >> modules
/${dir}/Makefile.am
<< EOF
249 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
250 clean-local: clean-${mod}
252 -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
256 cat >> modules
/${dir}/Makefile.am
<< EOF
258 L${mod}p = lib${mod}_plugin.a
259 D${mod}p = lib${mod}_plugin\$(LIBEXT)
260 L${mod}b = lib${mod}.a
261 L${mod}pic = lib${mod}_pic.a
263 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
264 B${mod} = \$(nodist_SOURCES_${mod})
267 cat >> modules
/${dir}/Makefile.am
<< EOF
271 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
272 ${PRIVATE}BUILT_SOURCES += \$(B${mod})
275 cat >> modules
/${dir}/Makefile.am
<< EOF
276 ${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
278 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
279 ${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
282 cat >> modules
/${dir}/Makefile.am
<< EOF
283 lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
284 lib${mod}_plugin_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
285 lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
287 lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
289 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
290 nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
293 cat >> modules
/${dir}/Makefile.am
<< EOF
294 lib${mod}_pic_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin pic ${mod}\`
295 lib${mod}_pic_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin pic ${mod}\`
296 lib${mod}_pic_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin pic ${mod}\`
298 lib${mod}_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
300 if [ "${NODIST}" != "#" ]; then cat >> modules
/${dir}/Makefile.am
<< EOF
301 nodist_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
304 cat >> modules
/${dir}/Makefile.am
<< EOF
305 lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
306 lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
307 lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
309 libvlc_LIBRARIES += \$(L${mod}b) \$(L${mod}pic)
310 lib${mod}_DATA = \$(D${mod}p)
312 lib${mod}dir = \$(libdir)/vlc/${topdir}
313 ${PRIVATE}noinst_LIBRARIES += \$(L${mod}p)
314 ${PRIVATE}lib${mod}_plugin\$(LIBEXT): \$(lib${mod}_plugin_a_OBJECTS)
315 ${PRIVATE} @case \`\$(VLC_CONFIG) --linkage ${mod}\` in \\
316 ${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}\` ;; \\
317 ${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}\` ;; \\
318 ${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}\` ;; \\
326 cat >> m
4/private.m4-tmp1
<< EOF
327 AM_CONDITIONAL(UNTRUE, false)
330 cat m
4/private.m4-tmp1
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp1
331 cat >> m
4/private.m4-tmp2
<< EOF
334 cat m
4/private.m4-tmp2
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp2
335 cat >> m
4/private.m4-tmp3
<< EOF
338 cat m
4/private.m4-tmp3
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp3
339 cat >> m
4/private.m4-tmp4
<< EOF
343 cat m
4/private.m4-tmp4
>> m
4/private.
m4 && rm -f m
4/private.m4-tmp4
348 ### classic bootstrap stuff
352 # remove autotools cruft
353 rm -f aclocal.
m4 configure config.log config.h config.h.
in
354 rm -Rf autom4te.cache
355 # remove old autotools extra cruft
356 rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
357 # remove new autotools extra cruft
360 # remove libtool cruft
361 rm -f ltmain.sh libtool ltconfig
362 # remove gettext cruft
365 # remove old vlc cruft
366 rm -f m
4/oldgettext.
m4 stamp-pic configure.ac.
in Modules.am
367 # remove new vlc cruft
368 rm -f stamp-builtin stamp-h
* mozilla
/stamp-pic
370 # Automake complains if these are not present
371 rm -f vlc-config.
in && printf "" > vlc-config.
in
372 if [ "$GETTEXT" != "yes" ]; then
373 test -d intl || mkdir intl
374 printf "" > intl
/Makefile.am
375 printf "" > ABOUT-NLS
380 ${aclocal} ${ACLOCAL_ARGS}
383 ${automake} --add-missing --copy
386 ## files which need to be regenerated
388 rm -f vlc-config.
in vlc-config
389 rm -f src
/misc
/modules_builtin.h src
/misc
/modules_plugin.h
390 rm -f include
/vlc_symbols.h
391 rm -f mozilla
/vlcintf.h
397 ## Tell the user about gettext, pkg-config and sed
403 ===========================================================
404 IMPORTANT NOTE: you do not have gettext installed on your
405 system. The vlc build will work, but you will not have
406 internationalization support. We suggest installing gettext.
411 ==========================================================
412 NOTE: you have an old version of gettext installed on your
413 system. The vlc build will work, but if your system does not
414 have libintl you will not have internationalization support.
415 We suggest upgrading to gettext 0.11.5 or later.
424 ==============================================================
425 NOTE: you do not have the "pkg-config" utility on your system;
426 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
432 case "$AUTOMAKESUCKS" in
436 =============================================================
437 IMPORTANT NOTE: your version of automake has a bug which will
438 prevent proper plugin compilation. Either compile VLC with
439 the --disable-plugins flag, or use a version of automake newer
440 than 1.6.1 (1.6.2 is OK, and so are the 1.5 series).
445 case "$INSTALLSUCKS" in
449 =============================================================
450 IMPORTANT NOTE: your version of automake has a bug which will
451 prevent proper installation. Do not use "make install" with this
452 version of automake, or use a version of automake newer than 1.5
453 (such as 1.6 or 1.7).