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 = ...@@ -216,6 +216,9 @@ noinst_HEADERS =
EXTRA_DIST = Modules.am EXTRA_DIST = Modules.am
BUILT_SOURCES = BUILT_SOURCES =
SUBDIRS = ${subdirs} 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) libvlcdir = \$(libdir)/vlc/\$(basedir)
...@@ -233,6 +236,8 @@ endif ...@@ -233,6 +236,8 @@ endif
endif endif
all: all-modules all: all-modules
# Find out which modules were enabled and tell make to build them
all-modules: all-modules:
@set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\ @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; \\ 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: ...@@ -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; \\ \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
test -z "\$\$fail" 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 \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap
cd \$(top_srcdir) && \$(SHELL) ./bootstrap cd \$(top_srcdir) && \$(SHELL) ./bootstrap
...@@ -315,9 +332,6 @@ endif ...@@ -315,9 +332,6 @@ endif
EOF EOF
for mod in $mods for mod in $mods
do 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 if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev/null 2>&1; then
NODIST=''; else NODIST=''; else
NODIST='#'; fi NODIST='#'; fi
...@@ -343,14 +357,14 @@ clean-${mod}: ...@@ -343,14 +357,14 @@ clean-${mod}:
EOF EOF
fi fi
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
${PRIVATE}BUILT_SOURCES += \$(B${mod}) BUILT_SOURCES += \$(B${mod})
EOF EOF
fi fi
cat >> "${makf}" << EOF cat >> "${makf}" << EOF
${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod}) lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
EOF EOF
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << 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 EOF
fi fi
cat >> "${makf}" << EOF cat >> "${makf}" << EOF
...@@ -358,10 +372,10 @@ lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\` ...@@ -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_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags 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 EOF
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << 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 EOF
fi fi
cat >> "${makf}" << EOF cat >> "${makf}" << EOF
...@@ -380,15 +394,6 @@ lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\` ...@@ -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_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags 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 EOF
done done
done done
......
...@@ -296,6 +296,9 @@ dnl Plugin compilation stuff ...@@ -296,6 +296,9 @@ dnl Plugin compilation stuff
VLC_LIBRARY_SUFFIX VLC_LIBRARY_SUFFIX
VLC_SYMBOL_PREFIX
AC_SUBST(SYMPREF)
case "${SYS}" in case "${SYS}" in
mingw32|cygwin) mingw32|cygwin)
VLC_ADD_CFLAGS([pic plugin mozilla activex],[${CFLAGS_mingw32_special}]) VLC_ADD_CFLAGS([pic plugin mozilla activex],[${CFLAGS_mingw32_special}])
......
...@@ -153,3 +153,14 @@ AC_DEFUN([VLC_LIBRARY_SUFFIX], [ ...@@ -153,3 +153,14 @@ AC_DEFUN([VLC_LIBRARY_SUFFIX], [
AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension]) 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: .rc.o:
$(WINDRES) -DUNDER_CE -D__MINGW32__ -I. -I$(srcdir) -i $< -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