Change the gmp download URL to https://gmplib.org/download
[vlc/gmpfix.git] / modules / genmf
blobbe97990031088aa86feb257fe90e5c9d1ba95f8f
1 #! /bin/sh
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>
10 cd $(dirname "$0")/.. || exit 1
12 while test "$1"
14 dir="$1"
15 modf="modules/${dir}/Modules.am"
16 if test ! -f "$modf"; then
17 echo "$modf does not exist!" >&2
18 exit 1
20 makf="modules/${dir}/Makefile.am"
21 basedir="`echo "${dir}" | cut -f1 -d/`"
22 mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | sort | uniq | xargs`"
23 plugins="`sed -n -e 's/^.*lib\([^ ]*\)_plugin\.la.*/\1/p' < "${modf}" | sort | uniq | xargs`"
24 rm -f "${makf}" && cat > "${makf}" << EOF
25 # ${makf} automatically generated from ${modf} by $0
26 # DO NOT EDIT THIS FILE DIRECTLY! See Modules.am instead.
28 ${basedir}dir = \$(pluginsdir)/${basedir}
29 ${basedir}_LTLIBRARIES =
30 EXTRA_LTLIBRARIES =
32 EXTRA_DIST = Modules.am
34 include \$(top_srcdir)/modules/common.am
35 include \$(srcdir)/Modules.am
37 if MAINTAINER_MODE
38 \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/modules/genmf
39 \$(AM_V_GEN)cd \\\$(top_srcdir) && \\\$(SHELL) modules/genmf ${dir}
40 endif
41 EOF
42 for mod in $mods
44 cat >> "${makf}" << EOF
46 lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
47 lib${mod}_plugin_la_CPPFLAGS = \$(AM_CPPFLAGS) \$(CPPFLAGS_${mod}) \
48 -DMODULE_NAME_IS_${mod}
49 lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS) \$(CFLAGS_${mod})
50 lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS) \$(CXXFLAGS_${mod})
51 lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS) \$(OBJCFLAGS_${mod})
52 lib${mod}_plugin_la_LIBADD = \$(LIBS_${mod})
53 lib${mod}_plugin_la_LDFLAGS = \$(AM_LDFLAGS) -rpath '\$(${basedir}dir)' \$(LDFLAGS_${mod})
54 EOF
55 case " ${plugins} " in
56 *\ ${mod}\ *)
59 cat >> "${makf}" << EOF
60 EXTRA_LTLIBRARIES += lib${mod}_plugin.la
61 ${basedir}_LTLIBRARIES += \$(LTLIB${mod})
62 EOF
64 esac
65 done
67 shift
68 done