bootstrap 17.3 KB
Newer Older
1
2
#! /bin/sh

3
##  bootstrap file for the VLC media player
Sam Hocevar's avatar
Sam Hocevar committed
4
##  $Id$
5
##
6
## Copyright (C) 2005-2006 the VideoLAN team
7
8
##
##  Initial author: Sam Hocevar <sam@zoy.org>
9

Sam Hocevar's avatar
Sam Hocevar committed
10
11
12
13
if test "$#" != "0"; then
  echo "Usage: $0"
  echo "  Calls automake, autoconf, autoheader, autopoint and other auto* to generate"
  echo "  m4 macros and prepare Makefiles."
14
15
16
  exit 1
fi

17
###
18
###  Get a sane environment, just in case
19
###
20
21
LANG=C
export LANG
22
23
CYGWIN=binmode
export CYGWIN
24

25
set -e
26
set -x
27

28
##
29
## Check for various tools
30
##
31
32
AUTOMAKESUCKS=no
INSTALLSUCKS=no
33

34
35
ACLOCAL_ARGS="-I m4"

36
37
38
# Check for contrib directory
if test -d extras/contrib/bin; then
  export PATH=./extras/contrib/bin:$PATH
39
40
41
  if test -d extras/contrib/share/aclocal; then
    ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
  fi
42
43
44
45
46
47
48
  if test ".`uname -s`" = ".Darwin"; then
    export LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
    export DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
  elif test ".`uname -s`" = ".BeOS"; then
    export LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
    export BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
  fi
49
50
fi

51
52
# Check for automake
amvers="none"
53
if automake-1.9 --version >/dev/null 2>&1; then
54
  amvers="-1.9"
55
56
elif automake-1.8 --version >/dev/null 2>&1; then
  amvers="-1.8"
57
elif automake-1.7 --version >/dev/null 2>&1; then
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  amvers="-1.7"
elif automake-1.6 --version >/dev/null 2>&1; then
  amvers="-1.6"
  if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev/null 2>&1; then
    AUTOMAKESUCKS=yes
  fi
elif automake-1.5 --version >/dev/null 2>&1; then
  INSTALLSUCKS=yes
  amvers="-1.5"
elif automake --version > /dev/null 2>&1; then
  amvers=""
  case "`automake --version | sed -e '1s/[^0-9]*//' -e q`" in
    0|0.*|1|1.[01234]|1.[01234][-.]*)
      amvers="none" ;;
    1.5|1.5.*)
      INSTALLSUCKS=yes ;;
    1.6|1.6.0|1.6.1)
      AUTOMAKESUCKS=yes ;;
Rocky Bernstein's avatar
Rocky Bernstein committed
76
77
    1.9|1.9.2)
      ;;
78
79
80
81
82
  esac
fi

if test "${amvers}" = "none"; then
  set +x
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  echo "$0: you need automake version 1.5 or later"
  exit 1
fi

# Check for libtool
libtoolize="no"
if glibtoolize --version >/dev/null 2>&1; then
  libtoolize="glibtoolize"
elif libtoolize --version >/dev/null 2>&1; then
  libtoolize="libtoolize"
fi

if test "$libtoolize" = "no"; then
  set +x
  echo "$0: you need libtool"
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  exit 1
fi

# Check for gettext
if gettextize --version >/dev/null 2>&1; then
# Autopoint is available from 0.11.3, but we need 0.11.5
if expr `gettextize --version | sed -e '1s/[^0-9]*//' -e q` \
        '>=' 0.11.5 >/dev/null 2>&1; then
  # We have gettext, and a recent version! Everything is cool.
  autopoint=autopoint
  GETTEXT=yes
else
  # User's gettext is too old. try to continue anyway.
  autopoint=:
  GETTEXT=old
fi;else
114
115
116
  set +x
  echo "you need gettextize (package gettext-devel or gettext)"
  exit 1
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
fi

# Check for pkg-config
if pkg-config --version >/dev/null 2>&1; then
  # We have pkg-config, everything is cool.
  PKGCONFIG=yes
else
  PKGCONFIG=no
fi

aclocal=aclocal${amvers}
automake=automake${amvers}
autoconf=autoconf
autoheader=autoheader

132
133
134
135
##
## Generate the modules makefile, by parsing modules/**/Modules.am
##

136
set +x
137
echo "generating modules/**/Makefile.am and m4/private.m4"
138

Sam Hocevar's avatar
Sam Hocevar committed
139
# Prepare m4/private.m4
Sam Hocevar's avatar
Sam Hocevar committed
140
rm -f m4/private.m4 && cat > m4/private.m4 << EOF
141
dnl  Private VLC macros - generated by bootstrap
142
143

EOF
gbazin's avatar
   
gbazin committed
144
145

if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
146
147
dnl  User does not have pkg-config, so assume package was not found
AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
gbazin's avatar
   
gbazin committed
148
149
150
151
152
153
154
155
156
157
158

EOF
fi

if [ "${GETTEXT}" != "yes" ]; then cat >> m4/private.m4 << EOF
dnl  User does not have gettext, so this is a no-op
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])

EOF
fi

Sam Hocevar's avatar
Sam Hocevar committed
159
160
161
rm -f m4/private.m4-tmp1 && cat > m4/private.m4-tmp1 << EOF
dnl  The required AM_CONDITIONAL calls
dnl  XXX: too many conditionals make the build very slow, disabled them
Sam Hocevar's avatar
Sam Hocevar committed
162
AC_DEFUN([VLC_CONDITIONALS], [
Sam Hocevar's avatar
Sam Hocevar committed
163
164
165
EOF
rm -f m4/private.m4-tmp2 && cat > m4/private.m4-tmp2 << EOF
dnl  The required AC_SUBST calls
Sam Hocevar's avatar
Sam Hocevar committed
166
AC_DEFUN([VLC_SUBSTS], [
Sam Hocevar's avatar
Sam Hocevar committed
167
168
169
170
EOF
rm -f m4/private.m4-tmp3 && cat > m4/private.m4-tmp3 << EOF
dnl  The required AC_OUTPUT calls
dnl  XXX: this feature is only supported starting from automake-1.7
Sam Hocevar's avatar
Sam Hocevar committed
171
AC_DEFUN([VLC_MAKEFILES], [AC_OUTPUT([
Sam Hocevar's avatar
Sam Hocevar committed
172
173
174
EOF
rm -f m4/private.m4-tmp4 && cat > m4/private.m4-tmp4 << EOF
dnl  Helper macro for vlc-config generation
Sam Hocevar's avatar
Sam Hocevar committed
175
AC_DEFUN([VLC_CONFIG_HELPER], [
Sam Hocevar's avatar
Sam Hocevar committed
176
177
  cat >> vlc-config.in << BLAH
EOF
178
179
180

modules=""

Sam Hocevar's avatar
Sam Hocevar committed
181
182
183
rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
# Autogenerated by bootstrap - DO NOT EDIT
EXTRA_DIST = LIST
Sam Hocevar's avatar
Sam Hocevar committed
184
SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
Sam Hocevar's avatar
Sam Hocevar committed
185
EOF
186

Sam Hocevar's avatar
Sam Hocevar committed
187
for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
Sam Hocevar's avatar
Sam Hocevar committed
188
189
do
  printf "."
190
191
  modf="modules/${dir}/Modules.am"
  makf="modules/${dir}/Makefile.am"
Sam Hocevar's avatar
Sam Hocevar committed
192
  basedir="`echo "${dir}" | cut -f1 -d/`"
Sam Hocevar's avatar
Sam Hocevar committed
193
  # automake will not recurse for make dist if we don't define SUBDIRS = .
Sam Hocevar's avatar
Sam Hocevar committed
194
  subdirs="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
195
196
  mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | xargs`"
  extra_libs=""
197
  extra_ltlibs=""
198
199
  for mod in $mods
  do
200
201
    extra_libs="${extra_libs} lib${mod}_plugin.a lib${mod}.a lib${mod}_pic.a"
    extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la lib${mod}.la"
202
203
  done
  rm -f "${makf}" && cat > "${makf}" << EOF
Sam Hocevar's avatar
Sam Hocevar committed
204

205
# ${makf} automatically generated from ${modf} by bootstrap
206
207
208
209
# DO NOT EDIT - edit Modules.am or \$(top_srcdir)/bootstrap instead

basedir = ${basedir}
mods = ${mods}
Sam Hocevar's avatar
Sam Hocevar committed
210
211

NULL =
212
libvlc_LTLIBRARIES =
213
noinst_LTLIBRARIES =
Sam Hocevar's avatar
Sam Hocevar committed
214
215
EXTRA_DIST = Modules.am
BUILT_SOURCES =
216
clean_modules =
Sam Hocevar's avatar
Sam Hocevar committed
217
SUBDIRS = ${subdirs}
218
SUFFIXES = _plugin\$(LIBEXT) _plugin.a
219
220

libvlcdir = \$(libdir)/vlc/\$(basedir)
221
222

EXTRA_LIBRARIES = ${extra_libs}
223
224
EXTRA_LTLIBRARIES = ${extra_ltlibs}

Sam Hocevar's avatar
Sam Hocevar committed
225
include Modules.am
Sam Hocevar's avatar
Sam Hocevar committed
226

227
228
LTLIBVLC = \$(top_builddir)/src/libvlc.la

229
if BUILD_SHARED
230
LIBVLC = \$(top_builddir)/src/libvlc\$(LIBEXT)
231
232
233
LIBADD = \$(LIBVLC)
endif

Sam Hocevar's avatar
Sam Hocevar committed
234
all: all-modules
235
236

# Find out which modules were enabled and tell make to build them
Sam Hocevar's avatar
Sam Hocevar committed
237
all-modules:
238
239
240
241
242
243
244
if USE_LIBTOOL
	@set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
	if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin.la;; esac; done; fi; \\
	if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.la;; esac; done; fi; \\
	\`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
	test -z "\$\$fail"
else
Sam Hocevar's avatar
Sam Hocevar committed
245
	@set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
246
247
	if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
	if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\
248
	if test "\$(pic)" = "pic"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
Sam Hocevar's avatar
Sam Hocevar committed
249
250
	\`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
	test -z "\$\$fail"
251
endif
Sam Hocevar's avatar
Sam Hocevar committed
252

253
254
# Build a plugin with the adequate linker and linker's flags
_plugin.a_plugin\$(LIBEXT):
255
	@mod="\$*" ; mod=\$\${mod#lib} ; \
256
	ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` \$(LIBADD) -u \$(SYMPREF)\$(VLC_ENTRY)" ; \
257
258
259
260
261
262
263
	case \`\$(VLC_CONFIG) --linkage \$\$mod\` in \\
	  c++)  ld="\$(CXXLINK)" ;; \
	  objc) ld="\$(OBJCLINK)" ;; \
	  c|*)  ld="\$(LINK)" ;; \
	esac ; \
	echo \$\$ld \$< \$\$ldfl ; \
	\$\$ld \$< \$\$ldfl
264
#ifneq (,\$(findstring cygwin,\$(host)))
265
#	mv -f "\$@.exe" "\$@"
266
#endif
267
	@if test -f "\$@.exe"; then mv -f "\$@.exe" "\$@"; fi
268

269
if MAINTAINER_MODE
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
270
\$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap
271
	cd \$(top_srcdir) && \$(SHELL) ./bootstrap
272
endif
273

274
275
276
mostlyclean-local:
	-rm -f *.a *\$(LIBEXT)

277
278
clean-local: \$(clean_modules)
if USE_LIBTOOL
279
	@if test -z "\$(libvlc_LTLIBRARIES)\$(noinst_LTLIBRARIES)"; then \
280
281
282
283
284
	  l=\$\$(\$(VLC_CONFIG) --list plugin); \
	  p=\`for mod in \$(mods); do case "\$\$l " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
	  l=\$\$(\$(VLC_CONFIG) --list builtin); \
	  s=\`for mod in \$(mods); do case "\$\$l " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}.la" ;; esac; done\` ; \
	  test -z "\$\$p\$\$s" || \
285
286
  	    \$(MAKE) \$(AM_MAKEFLAGS) \
	      libvlc_LTLIBRARIES="\$\$p" noinst_LTLIBRARIES="\$\$s" clean ; \
287
288
289
	fi
endif

290
291
292
### automake creates libvlcdir after running install-*-local
### so we have to create it ourselves first
install-exec-local: all-modules
293
294
295
296
if USE_LIBTOOL
	@if test -z "\$(libvlc_LTLIBRARIES)"; then \
	  z=\$\$(\$(VLC_CONFIG) --list plugin); \
	  m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
297
298
	  test -z "\$\$m" || \
  	    \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" install ; \
299
300
	fi
else
301
	mkdir -p -- "\$(DESTDIR)\$(libvlcdir)"
302
303
304
305
	@z=\$\$(\$(VLC_CONFIG) --list plugin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
306
307
	      echo \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" ; \
	      \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" || exit \$\$?; \
308
309
310
311
312
313
314
	      ;; \
	  esac; \
	done
	@z=\$\$(\$(VLC_CONFIG) --list builtin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
315
316
	      echo \$(INSTALL_DATA) "lib\$\${mod}.a" "\$(DESTDIR)\$(libdir)/vlc/" ; \
	      \$(INSTALL_DATA) "lib\$\${mod}.a" "\$(DESTDIR)\$(libdir)/vlc/" || exit \$\$?; \
317
318
319
320
321
322
323
324
	      ;; \
	  esac; \
	done
if BUILD_MOZILLA
	@z=\$\$(\$(VLC_CONFIG) --list builtin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
325
326
	      echo \$(INSTALL_DATA) "lib\$\${mod}_pic.a" "\$(DESTDIR)\$(libdir)/vlc/" ; \
	      \$(INSTALL_DATA) "lib\$\${mod}_pic.a" "\$(DESTDIR)\$(libdir)/vlc/" || exit \$\$?; \
327
328
329
330
	      ;; \
	  esac; \
	done
endif
331
endif
332
333

uninstall-local:
334
335
336
337
if USE_LIBTOOL
	@if test -z "\$(libvlc_LTLIBRARIES)"; then \
	  z=\$\$(\$(VLC_CONFIG) --list plugin); \
	  m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
338
339
	  test -z "\$\$m" || \
	    \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" uninstall ; \
340
341
	fi
else
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
	@z=\$\$(\$(VLC_CONFIG) --list plugin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
	      echo rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" ; \
	      rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" || true; \
	      ;; \
	  esac; \
	done
	@z=\$\$(\$(VLC_CONFIG) --list builtin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
	      echo rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}.a" ; \
	      rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}.a" || true; \
	      ;; \
	  esac; \
	done
if BUILD_MOZILLA
	@z=\$\$(\$(VLC_CONFIG) --list builtin); \
	for mod in \$(mods); do \
	  case "\$\$z " \
	    in *\ \$\${mod}\ *) \
	      echo rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}_pic.a" ; \
	      rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}_pic.a" || true; \
	      ;; \
	  esac; \
	done
endif
371
endif
372

373
EOF
374
  for mod in $mods
375
  do
376
    if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev/null 2>&1; then
377
378
        NODIST=''; else
        NODIST='#'; fi
Sam Hocevar's avatar
Sam Hocevar committed
379
380
    cat >> m4/private.m4-tmp4 << EOF
    ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
381
EOF
Sam Hocevar's avatar
Sam Hocevar committed
382
383
# Generation of modules/**/Makefile.am
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384
385
386
# - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
#   S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
#   the resulting file size.
Sam Hocevar's avatar
Sam Hocevar committed
387
388
# - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
#   work properly with any automake version I tested.
389
    cat >> "${makf}" << EOF
390
# The ${mod} plugin
Sam Hocevar's avatar
Sam Hocevar committed
391

392
EOF
393
    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
394
clean_modules += clean-${mod}
395
clean-${mod}:
Sam Hocevar's avatar
Sam Hocevar committed
396
	-test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
397
398
399

EOF
    fi
400
    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
401
BUILT_SOURCES += \$(B${mod})
Sam Hocevar's avatar
Sam Hocevar committed
402
403
EOF
    fi
404
    cat >> "${makf}" << EOF
405
lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
406
lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
407
EOF
408
    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
409
nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
410
nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
411
412
EOF
    fi
413
    cat >> "${makf}" << EOF
Sam Hocevar's avatar
Sam Hocevar committed
414
415
416
lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
lib${mod}_plugin_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
417
418
419
420
421
422
lib${mod}_plugin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
lib${mod}_plugin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
lib${mod}_plugin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\
	-rpath '\$(libvlcdir)' -module -shrext \$(LIBEXT)
lib${mod}_plugin_la_LIBADD = \$(LTLIBVLC)
423
lib${mod}_plugin_la_DEPENDENCIES = \$(LTLIBVLC)
Sam Hocevar's avatar
Sam Hocevar committed
424

425
lib${mod}_pic_a_SOURCES = \$(SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
426
EOF
427
    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
428
nodist_lib${mod}_pic_a_SOURCES = \$(nodist_SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
429
430
EOF
    fi
431
    cat >> "${makf}" << EOF
Sam Hocevar's avatar
Sam Hocevar committed
432
433
434
435
lib${mod}_pic_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin pic ${mod}\`
lib${mod}_pic_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin pic ${mod}\`
lib${mod}_pic_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin pic ${mod}\`

436
437
lib${mod}_a_SOURCES = \$(SOURCES_${mod})
lib${mod}_la_SOURCES = \$(SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
438
EOF
439
    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
440
441
nodist_lib${mod}_a_SOURCES = \$(nodist_SOURCES_${mod})
nodist_lib${mod}_la_SOURCES = \$(nodist_SOURCES_${mod})
Sam Hocevar's avatar
Sam Hocevar committed
442
443
EOF
    fi
444
    cat >> "${makf}" << EOF
Sam Hocevar's avatar
Sam Hocevar committed
445
446
447
lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
448
449
450
451
lib${mod}_la_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
lib${mod}_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
lib${mod}_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
lib${mod}_la_LDFLAGS = \`\$(VLC_CONFIG) --libs ${mod}\` -static
Sam Hocevar's avatar
Sam Hocevar committed
452

453
454
455
456
EOF
  done
done

Sam Hocevar's avatar
Sam Hocevar committed
457
458
459
460
461
462
463
464
465
466
467
468
469
470
cat >> m4/private.m4-tmp1 << EOF
])
EOF
cat m4/private.m4-tmp1 >> m4/private.m4 && rm -f m4/private.m4-tmp1
cat >> m4/private.m4-tmp2 << EOF
])
EOF
cat m4/private.m4-tmp2 >> m4/private.m4 && rm -f m4/private.m4-tmp2
cat >> m4/private.m4-tmp3 << EOF
])])
EOF
cat m4/private.m4-tmp3 >> m4/private.m4 && rm -f m4/private.m4-tmp3
cat >> m4/private.m4-tmp4 << EOF
BLAH
471
472
])
EOF
Sam Hocevar's avatar
Sam Hocevar committed
473
cat m4/private.m4-tmp4 >> m4/private.m4 && rm -f m4/private.m4-tmp4
474

475
echo " done."
476

477
###
478
###  classic bootstrap stuff
479
###
480
set -x
481
482

# remove autotools cruft
483
rm -f aclocal.m4 configure config.log config.h config.h.in
484
rm -Rf autom4te*.cache
485
486
487
# remove old autotools extra cruft
rm -f config.guess config.sub missing mkinstalldirs compile depcomp install-sh
# remove new autotools extra cruft
Sam Hocevar's avatar
Sam Hocevar committed
488
489
rm -Rf autotools
mkdir autotools
490
491
492
# remove libtool cruft
rm -f ltmain.sh libtool ltconfig
# remove gettext cruft
493
rm -f ABOUT-NLS
494
rm -Rf intl
495
496
# remove old vlc cruft
rm -f m4/oldgettext.m4 stamp-pic configure.ac.in Modules.am
Sam Hocevar's avatar
Sam Hocevar committed
497
498
# remove new vlc cruft
rm -f stamp-builtin stamp-h* mozilla/stamp-pic
499

500
# Automake complains if these are not present
Sam Hocevar's avatar
Sam Hocevar committed
501
rm -f vlc-config.in && printf "" > vlc-config.in
502
503
504
505
506
if [ "$GETTEXT" != "yes" ]; then
  test -d intl || mkdir intl
  printf "" > intl/Makefile.am
  printf "" > ABOUT-NLS
fi
Sam Hocevar's avatar
Sam Hocevar committed
507

508
509
510
511
512
513
514
# Libtoolize directory
${libtoolize} --copy --force
if test -f "ltmain.sh"; then
  echo "$0: working around a minor libtool issue"
  mv ltmain.sh autotools/
fi

515
# Do the rest
Sam Hocevar's avatar
Sam Hocevar committed
516
${autopoint} -f
517
${aclocal} ${ACLOCAL_ARGS}
Sam Hocevar's avatar
Sam Hocevar committed
518
519
520
${autoconf}
${autoheader}
${automake} --add-missing --copy
521
522

##
Sam Hocevar's avatar
Sam Hocevar committed
523
##  files which need to be regenerated
524
##
Sam Hocevar's avatar
Sam Hocevar committed
525
rm -f vlc-config.in vlc-config
526
rm -f src/misc/modules_builtin.h
527
rm -f mozilla/vlcintf.h
528

529
# Shut up
530
set +x
531

532
##
533
##  Tell the user about gettext, pkg-config and sed
534
##
535
if [ "${GETTEXT}" = "old" ]; then
536
  cat << EOF
537
538
539

==========================================================
NOTE: you have an old version of gettext installed on your
540
541
system. The vlc build will work, but if your system does not
have libintl you will not have internationalization support.
542
We suggest upgrading to gettext 0.11.5 or later.
543
EOF
544
fi
545

546
if [ "$PKGCONFIG" = "no" ]; then
547
  cat << EOF
548
549
550
551
552
553

==============================================================
NOTE: you do not have the "pkg-config" utility on your system;
detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
reliable.
EOF
554
fi
555

556
if [ "$AUTOMAKESUCKS" = "yes" ]; then
557
  cat << EOF
558
559
560
561
562
563
564

=============================================================
IMPORTANT NOTE: your version of automake has a bug which will
prevent proper plugin compilation. Either compile VLC with
the --disable-plugins flag, or use a version of automake newer
than 1.6.1 (1.6.2 is OK, and so are the 1.5 series).
EOF
565
fi
566

567
if [ "$INSTALLSUCKS" = "yes" ]; then
568
  cat << EOF
569
570
571
572
573
574
575

=============================================================
IMPORTANT NOTE: your version of automake has a bug which will
prevent proper installation. Do not use "make install" with this
version of automake, or use a version of automake newer than 1.5
(such as 1.6 or 1.7).
EOF
576
fi
577