| 1 |
#! /bin/sh |
|---|
| 2 |
|
|---|
| 3 |
## genmf file for the VLC media player |
|---|
| 4 |
## |
|---|
| 5 |
## Copyright (C) 2005-2007 the VideoLAN team |
|---|
| 6 |
## |
|---|
| 7 |
## Authors: Sam Hocevar <sam@zoy.org> |
|---|
| 8 |
## Rémi Denis-Courmont <rem # videolan # org> |
|---|
| 9 |
|
|---|
| 10 |
cd $(dirname "$0")/.. || exit 1 |
|---|
| 11 |
|
|---|
| 12 |
while test "$1" |
|---|
| 13 |
do |
|---|
| 14 |
printf "." |
|---|
| 15 |
dir="$1" |
|---|
| 16 |
modf="modules/${dir}/Modules.am" |
|---|
| 17 |
if ! test -f "$modf"; then |
|---|
| 18 |
echo "$modf does not exist!" >&2 |
|---|
| 19 |
exit 1 |
|---|
| 20 |
fi |
|---|
| 21 |
makf="modules/${dir}/Makefile.am" |
|---|
| 22 |
basedir="`echo "${dir}" | cut -f1 -d/`" |
|---|
| 23 |
mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | sort | uniq | xargs`" |
|---|
| 24 |
plugins="`sed -n -e 's/^.*lib\([^ ]*\)_plugin\.la.*/\1/p' < "${modf}" | sort | uniq | xargs`" |
|---|
| 25 |
libvlc_ltlibs="" |
|---|
| 26 |
extra_ltlibs="" |
|---|
| 27 |
for mod in $mods |
|---|
| 28 |
do |
|---|
| 29 |
case " ${plugins} " in |
|---|
| 30 |
*\ ${mod}\ *) |
|---|
| 31 |
;; |
|---|
| 32 |
*) |
|---|
| 33 |
libvlc_ltlibs="${libvlc_ltlibs} \$(LTLIB${mod})" |
|---|
| 34 |
extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la" |
|---|
| 35 |
;; |
|---|
| 36 |
esac |
|---|
| 37 |
done |
|---|
| 38 |
rm -f "${makf}" && cat > "${makf}" << EOF |
|---|
| 39 |
# ${makf} automatically generated from ${modf} by $0 |
|---|
| 40 |
# DO NOT EDIT THIS FILE DIRECTLY! See Modules.am instead. |
|---|
| 41 |
|
|---|
| 42 |
basedir = ${basedir} |
|---|
| 43 |
dir = ${dir} |
|---|
| 44 |
mods = ${mods} |
|---|
| 45 |
libvlc_LTLIBRARIES = ${libvlc_ltlibs} |
|---|
| 46 |
EXTRA_LTLIBRARIES = ${extra_ltlibs} |
|---|
| 47 |
|
|---|
| 48 |
include \$(top_srcdir)/modules/common.am |
|---|
| 49 |
|
|---|
| 50 |
EOF |
|---|
| 51 |
for mod in $mods |
|---|
| 52 |
do |
|---|
| 53 |
cat >> "${makf}" << EOF |
|---|
| 54 |
# The ${mod} plugin |
|---|
| 55 |
lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod}) |
|---|
| 56 |
nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod}) |
|---|
| 57 |
# Force per-target objects: |
|---|
| 58 |
lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS) |
|---|
| 59 |
lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS) |
|---|
| 60 |
lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS) |
|---|
| 61 |
# Set LIBADD and DEPENDENCIES manually: |
|---|
| 62 |
lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD) |
|---|
| 63 |
lib${mod}_plugin_la_DEPENDENCIES = |
|---|
| 64 |
|
|---|
| 65 |
EOF |
|---|
| 66 |
done |
|---|
| 67 |
|
|---|
| 68 |
shift |
|---|
| 69 |
done |
|---|
| 70 |
printf "\n" |
|---|