Commit c4a560fb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Redo 12234; this time with (hopefully) Mac OS X support

It was probably too easy that building to Windows and Linux worked the same
parent dc849c8b
......@@ -216,6 +216,9 @@ noinst_HEADERS =
EXTRA_DIST = Modules.am
BUILT_SOURCES =
SUBDIRS = ${subdirs}
SUFFIXES = _plugin\$(LIBEXT) _plugin.a
### TODO ought to be defined somewhere else
VLC_ENTRY = \$(SYMPREF)vlc_entry__0_8_2
libvlcdir = \$(libdir)/vlc/\$(basedir)
......@@ -233,6 +236,8 @@ endif
endif
all: all-modules
# Find out which modules were enabled and tell make to build them
all-modules:
@set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
......@@ -241,6 +246,18 @@ all-modules:
\`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
test -z "\$\$fail"
# Build a plugin with the adequate linker and linker's flags
_plugin.a_plugin\$(LIBEXT):
@mod="\$*" ; mod=\$\${mod:3} ; \
ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` -u \$(VLC_ENTRY)" ; \
case \`\$(VLC_CONFIG) --linkage \$\$mod\` in \\
c++) ld="\$(CXXLINK)" ;; \
objc) ld="\$(OBJCLINK)" ;; \
c|*) ld="\$(LINK)" ;; \
esac ; \
echo \$\$ld \$< \$\$ldfl ; \
\$\$ld \$< \$\$ldfl
\$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap
cd \$(top_srcdir) && \$(SHELL) ./bootstrap
......@@ -315,9 +332,6 @@ endif
EOF
for mod in $mods
do
if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < "${modf}" >/dev/null 2>&1; then
PRIVATE='#'; else
PRIVATE=''; fi
if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev/null 2>&1; then
NODIST=''; else
NODIST='#'; fi
......@@ -343,14 +357,14 @@ clean-${mod}:
EOF
fi
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
${PRIVATE}BUILT_SOURCES += \$(B${mod})
BUILT_SOURCES += \$(B${mod})
EOF
fi
cat >> "${makf}" << EOF
${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
EOF
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
EOF
fi
cat >> "${makf}" << EOF
......@@ -358,10 +372,10 @@ 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})
lib${mod}_pic_a_SOURCES = \$(SOURCES_${mod})
EOF
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
nodist_lib${mod}_pic_a_SOURCES = \$(nodist_SOURCES_${mod})
EOF
fi
cat >> "${makf}" << EOF
......@@ -380,15 +394,6 @@ 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}\`
lib${mod}dir = \$(libdir)/vlc/${topdir}
${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
......
......@@ -296,6 +296,9 @@ dnl Plugin compilation stuff
VLC_LIBRARY_SUFFIX
VLC_SYMBOL_PREFIX
AC_SUBST(SYMPREF)
case "${SYS}" in
mingw32|cygwin)
VLC_ADD_CFLAGS([pic plugin mozilla activex],[${CFLAGS_mingw32_special}])
......
......@@ -153,3 +153,14 @@ AC_DEFUN([VLC_LIBRARY_SUFFIX], [
AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
])
AC_DEFUN([VLC_SYMBOL_PREFIX], [
AC_MSG_CHECKING(for prefix to exported symbols)
SYMPREF=""
case "${target_os}" in
darwin*)
SYMPREF="_"
;;
esac
AC_MSG_RESULT(${SYMPREF})
])
SUFFIXES = .rc
SUFFIXES += .rc
.rc.o:
$(WINDRES) -DUNDER_CE -D__MINGW32__ -I. -I$(srcdir) -i $< -o $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment