| 186 | | EOF |
|---|
| 187 | | |
|---|
| 188 | | for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac` |
|---|
| 189 | | do |
|---|
| 190 | | printf "." |
|---|
| 191 | | modf="modules/${dir}/Modules.am" |
|---|
| 192 | | makf="modules/${dir}/Makefile.am" |
|---|
| 193 | | basedir="`echo "${dir}" | cut -f1 -d/`" |
|---|
| 194 | | # automake will not recurse for make dist if we don't define SUBDIRS = . |
|---|
| 195 | | subdirs="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`" |
|---|
| 196 | | mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | xargs`" |
|---|
| 197 | | extra_ltlibs="" |
|---|
| 198 | | for mod in $mods |
|---|
| 199 | | do |
|---|
| 200 | | extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la" |
|---|
| 201 | | done |
|---|
| 202 | | rm -f "${makf}" && cat > "${makf}" << EOF |
|---|
| 203 | | |
|---|
| 204 | | # ${makf} automatically generated from ${modf} by bootstrap |
|---|
| 205 | | # DO NOT EDIT - edit Modules.am or \$(top_srcdir)/bootstrap instead |
|---|
| 206 | | |
|---|
| 207 | | basedir = ${basedir} |
|---|
| 208 | | mods = ${mods} |
|---|
| 209 | | |
|---|
| 210 | | NULL = |
|---|
| 211 | | libvlc_LTLIBRARIES = |
|---|
| 212 | | EXTRA_DIST = Modules.am |
|---|
| 213 | | BUILT_SOURCES = |
|---|
| 214 | | CLEANFILES = |
|---|
| 215 | | SUBDIRS = ${subdirs} |
|---|
| 216 | | SUFFIXES = _plugin\$(LIBEXT) _plugin.la |
|---|
| 217 | | |
|---|
| 218 | | libvlcdir = \$(libdir)/vlc/\$(basedir) |
|---|
| 219 | | |
|---|
| 220 | | EXTRA_LTLIBRARIES = ${extra_ltlibs} |
|---|
| 221 | | |
|---|
| 222 | | include Modules.am |
|---|
| 223 | | |
|---|
| 224 | | if HAVE_PLUGINS |
|---|
| 225 | | LTLIBVLC = -L\$(top_builddir)/src -lvlc |
|---|
| 226 | | |
|---|
| 227 | | AM_LDFLAGS = -rpath '\$(libvlcdir)' -avoid-version \\ |
|---|
| 228 | | -module -no-undefined -shrext \$(LIBEXT) |
|---|
| 229 | | if HAVE_COMPILER_EXPORT |
|---|
| 230 | | AM_LDFLAGS += -export-dynamic |
|---|
| 231 | | else |
|---|
| 232 | | AM_LDFLAGS += -export-symbol-regex ^\$(VLC_ENTRY)\$\$ |
|---|
| 233 | | endif |
|---|
| 234 | | AM_LIBADD = \$(LTLIBVLC) |
|---|
| 235 | | endif |
|---|
| 236 | | |
|---|
| 237 | | all: all-modules |
|---|
| 238 | | |
|---|
| 239 | | nice: |
|---|
| 240 | | \$(top_builddir)/compile |
|---|
| 241 | | |
|---|
| 242 | | # Find out which modules were enabled and tell make to build them |
|---|
| 243 | | all-modules: |
|---|
| 244 | | @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\ |
|---|
| 245 | | z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin.la;; esac; done; \\ |
|---|
| 246 | | \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\ |
|---|
| 247 | | test -z "\$\$fail" |
|---|
| 248 | | |
|---|
| 249 | | # Build a plugin with the adequate linker and linker's flags |
|---|
| 250 | | _plugin.la_plugin\$(LIBEXT): |
|---|
| 251 | | @mod="\$*" ; mod=\$\${mod#lib} ; \ |
|---|
| 252 | | ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` \$(LIBVLC) -u \$(SYMPREF)\$(VLC_ENTRY)" ; \ |
|---|
| 253 | | case \`\$(VLC_CONFIG) --linkage \$\$mod\` in \\ |
|---|
| 254 | | c++) ld="\$(CXXLINK)" ;; \ |
|---|
| 255 | | objc) ld="\$(OBJCLINK)" ;; \ |
|---|
| 256 | | c|*) ld="\$(LINK)" ;; \ |
|---|
| 257 | | esac ; \ |
|---|
| 258 | | echo \$\$ld \$< \$\$ldfl ; \ |
|---|
| 259 | | \$\$ld \$< \$\$ldfl |
|---|
| 260 | | |
|---|
| 261 | | if MAINTAINER_MODE |
|---|
| 262 | | \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap |
|---|
| 263 | | cd \$(top_srcdir) && \$(SHELL) ./bootstrap |
|---|
| 264 | | endif |
|---|
| 265 | | |
|---|
| 266 | | mostlyclean-local: |
|---|
| 267 | | -rm -f -- *.la |
|---|
| 268 | | |
|---|
| 269 | | ### automake creates libvlcdir after running install-*-local |
|---|
| 270 | | ### so we have to create it ourselves first |
|---|
| 271 | | install-exec-local: all-modules |
|---|
| 272 | | @if test -z "\$(libvlc_LTLIBRARIES)"; then \ |
|---|
| 273 | | z=\$\$(\$(VLC_CONFIG) --list plugin); \ |
|---|
| 274 | | m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \ |
|---|
| 275 | | test -z "\$\$m" || \ |
|---|
| 276 | | \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" install-libvlcLTLIBRARIES || exit \$\$? ; \ |
|---|
| 277 | | fi |
|---|
| 278 | | |
|---|
| 279 | | uninstall-local: |
|---|
| 280 | | @if test -z "\$(libvlc_LTLIBRARIES)"; then \ |
|---|
| 281 | | z=\$\$(\$(VLC_CONFIG) --list plugin); \ |
|---|
| 282 | | m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \ |
|---|
| 283 | | test -z "\$\$m" || \ |
|---|
| 284 | | \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" uninstall-libvlcLTLIBRARIES || exit \$\$?; \ |
|---|
| 285 | | fi |
|---|
| 286 | | |
|---|
| 287 | | EOF |
|---|
| 288 | | for mod in $mods |
|---|
| 289 | | do |
|---|
| 290 | | if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev/null 2>&1; then |
|---|
| 291 | | NODIST=''; else |
|---|
| 292 | | NODIST='#'; fi |
|---|
| 293 | | cat >> m4/private.m4 << EOF |
|---|
| 294 | | ${mod}) list="\\\${list} ${dir}/lib${mod}" ;; |
|---|
| 295 | | EOF |
|---|
| 296 | | # Generation of modules/**/Makefile.am |
|---|
| 297 | | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 298 | | # - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_, |
|---|
| 299 | | # S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce |
|---|
| 300 | | # the resulting file size. |
|---|
| 301 | | # - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to |
|---|
| 302 | | # work properly with any automake version I tested. |
|---|
| 303 | | cat >> "${makf}" << EOF |
|---|
| 304 | | # The ${mod} plugin |
|---|
| 305 | | |
|---|
| 306 | | EOF |
|---|
| 307 | | cat >> "${makf}" << EOF |
|---|
| 308 | | lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod}) |
|---|
| 309 | | EOF |
|---|
| 310 | | if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF |
|---|
| 311 | | nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod}) |
|---|
| 312 | | CLEANFILES += \$(nodist_SOURCES_${mod}) |
|---|
| 313 | | BUILT_SOURCES += \$(B${mod}) |
|---|
| 314 | | EOF |
|---|
| 315 | | fi |
|---|
| 316 | | cat >> "${makf}" << EOF |
|---|
| 317 | | lib${mod}_plugin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\` |
|---|
| 318 | | lib${mod}_plugin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\` |
|---|
| 319 | | lib${mod}_plugin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\` |
|---|
| 320 | | lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \$(AM_LDFLAGS) |
|---|
| 321 | | lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD) |
|---|
| 322 | | EOF |
|---|
| 323 | | done |
|---|
| 324 | | done |
|---|
| 325 | | |
|---|
| 326 | | printf "\n" |
|---|
| | 187 | |
|---|
| | 188 | EOF |
|---|
| | 189 | |
|---|
| | 190 | modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac` |
|---|