-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
-
-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
-AC_DEFUN([VLC_CONDITIONALS], [
-EOF
-rm -f m4/private.m4-tmp2 && cat > m4/private.m4-tmp2 << EOF
-dnl The required AC_SUBST calls
-AC_DEFUN([VLC_SUBSTS], [
-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
-AC_DEFUN([VLC_MAKEFILES], [AC_OUTPUT([
-EOF
-rm -f m4/private.m4-tmp4 && cat > m4/private.m4-tmp4 << EOF
-dnl Helper macro for vlc-config generation
-AC_DEFUN([VLC_CONFIG_HELPER], [
- cat >> vlc-config.in << BLAH
-EOF
-
-modules=""
-
-rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
-# Autogenerated by bootstrap - DO NOT EDIT
-EXTRA_DIST = LIST
-SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
-#DIST_SUBDIRS = \$(SUBDIRS)
-EOF
-
-for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
-do
- printf "."
- mf="modules/${dir}/Modules.am"
- basedir="`echo "${dir}" | cut -f1 -d/`"
- # automake will not recurse for make dist if we don't define SUBDIRS = .
- subdirs="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
- rm -f modules/${dir}/Makefile.am && cat > modules/${dir}/Makefile.am << EOF
-
-# Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
-
-NULL =
-libvlc_LIBRARIES =
-noinst_LIBRARIES =
-noinst_HEADERS =
-EXTRA_DIST = Modules.am
-BUILT_SOURCES =
-SUBDIRS = ${subdirs}
-#DIST_SUBDIRS = \$(SUBDIRS)
-libvlcdir = \$(libdir)/vlc/${basedir}
-include Modules.am
-
-if BUILD_MOZILLA
-if HAVE_WIN32
-# There's no need for pic code on win32 so get rid of this to substantially
-# reduce the compilation time.
-pic = no
-endif
-else
-pic = no
-endif
-
-clean-local:
- -rm -f *.a *.so *.dll *.sl *.dylib
-
-all: all-modules
-all-modules:
- @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
- if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target plugin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}_plugin*) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
- if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target builtin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}.a*) echo lib\$\${mod}.a;; esac; done; fi; \\
- if test "\$(pic)" != "no"; then z=\$\$(\$(VLC_CONFIG) --target builtin pic); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z" in */lib\$\${mod}_pic.a*) echo lib\$\${mod}_pic.a;; 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"
-
-EOF
- for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
- do
- if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev/null 2>&1; then
- PRIVATE='#'; else
- PRIVATE=''; fi
- if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/dev/null 2>&1; then
- NODIST=''; else
- NODIST='#'; fi
-# cat >> m4/private.m4-tmp1 << EOF
-#dnl AM_CONDITIONAL(${mod}_p, test x\$${mod}_p = xyes)
-#dnl AM_CONDITIONAL(${mod}_b, test x\$${mod}_b = xyes)
-#EOF
- cat >> m4/private.m4-tmp4 << EOF
- ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
-EOF
-# Generation of modules/**/Makefile.am
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# - 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.
-# - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
-# work properly with any automake version I tested.
- cat >> modules/${dir}/Makefile.am << EOF
-# The ${mod} plugin
-
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-clean-local: clean-${mod}
-clean-${mod}:
- -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
-
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-if UNTRUE
-L${mod}p = lib${mod}_plugin.a
-D${mod}p = lib${mod}_plugin\$(LIBEXT)
-L${mod}b = lib${mod}.a
-L${mod}pic = lib${mod}_pic.a
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-B${mod} = \$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-endif
-
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}BUILT_SOURCES += \$(B${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-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}\`
-
-lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-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}\`
-
-lib${mod}_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-nodist_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-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}\`
-
-libvlc_LIBRARIES += \$(L${mod}b) \$(L${mod}pic)
-lib${mod}_DATA = \$(D${mod}p)
-
-lib${mod}dir = \$(libdir)/vlc/${topdir}
-${PRIVATE}noinst_LIBRARIES += \$(L${mod}p)
-${PRIVATE}lib${mod}_plugin\$(LIBEXT): \$(lib${mod}_plugin_a_OBJECTS)
-${PRIVATE} @case \`\$(VLC_CONFIG) --linkage ${mod}\` in \\
-${PRIVATE} c++) echo \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} objc) echo \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} c|*) echo \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} esac
-
-
-EOF
- done
-done
-
-cat >> m4/private.m4-tmp1 << EOF
- AM_CONDITIONAL(UNTRUE, false)
-])
-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
-])
-EOF
-cat m4/private.m4-tmp4 >> m4/private.m4 && rm -f m4/private.m4-tmp4
-
-echo " done."