File: genmf

package info (click to toggle)
vlc 1.1.3-1squeeze6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 134,496 kB
  • ctags: 53,762
  • sloc: ansic: 341,893; cpp: 80,372; objc: 23,171; sh: 12,102; makefile: 5,035; xml: 1,351; asm: 524; python: 257; perl: 76; sed: 16
file content (70 lines) | stat: -rwxr-xr-x 1,783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /bin/sh

##  genmf file for the VLC media player
##
## Copyright (C) 2005-2007 the VideoLAN team
##
##  Authors: Sam Hocevar <sam@zoy.org>
##           Rémi Denis-Courmont <rem # videolan # org>

cd $(dirname "$0")/.. || exit 1

while test "$1"
do
  printf "."
  dir="$1"
  modf="modules/${dir}/Modules.am"
  if ! test -f "$modf"; then
    echo "$modf does not exist!" >&2
    exit 1
  fi
  makf="modules/${dir}/Makefile.am"
  basedir="`echo "${dir}" | cut -f1 -d/`"
  mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | sort | uniq | xargs`"
  plugins="`sed -n -e 's/^.*lib\([^ ]*\)_plugin\.la.*/\1/p' < "${modf}" | sort | uniq | xargs`"
  libvlc_ltlibs=""
  extra_ltlibs=""
  for mod in $mods
  do
    case " ${plugins} " in
      *\ ${mod}\ *)
	;;
      *)
        libvlc_ltlibs="${libvlc_ltlibs} \$(LTLIB${mod})"
        extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la"
      ;;
    esac
  done
  rm -f "${makf}" && cat > "${makf}" << EOF
# ${makf} automatically generated from ${modf} by $0
# DO NOT EDIT THIS FILE DIRECTLY! See Modules.am instead.

basedir = ${basedir}
dir = ${dir}
mods = ${mods}
libvlc_LTLIBRARIES = ${libvlc_ltlibs}
EXTRA_LTLIBRARIES = ${extra_ltlibs}

include \$(top_srcdir)/modules/common.am

EOF
  for mod in $mods
  do
    cat >> "${makf}" << EOF
# The ${mod} plugin
lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod})
# Force per-target objects:
lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS)
lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS)
lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS)
# Set LIBADD and DEPENDENCIES manually:
lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD)
lib${mod}_plugin_la_DEPENDENCIES = \$(top_srcdir)/src/libvlccore.sym

EOF
  done

  shift
done
printf "\n"