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

Suppress support for position dependant code (except on mingw32).

This simplifies the build system quite a lot, and reduce compilation
times when PIC is actually needed.

If you really mind the extra overhead of PIC, use:
./configure --enable-libtool --enable-static --disable-shared
parent 7cc72564
...@@ -9,7 +9,7 @@ NULL = ...@@ -9,7 +9,7 @@ NULL =
# which have makefiles with distribution information. # which have makefiles with distribution information.
# - intl should come before modules and . because all the code uses gettext # - intl should come before modules and . because all the code uses gettext
# - modules should come before . because vlc needs the builtins # - modules should come before . because vlc needs the builtins
# - . should come before mozilla/bindings because the plugin needs libvlc_pic.a # - . should come before mozilla/bindings because the plugin needs libvlc.a
# - po should come before . because VLC.app needs the pofiles # - po should come before . because VLC.app needs the pofiles
# - loader should come before modules because some plugins need it # - loader should come before modules because some plugins need it
SUBDIRS = intl loader src modules po . mozilla bindings activex share m4 doc SUBDIRS = intl loader src modules po . mozilla bindings activex share m4 doc
......
...@@ -192,7 +192,7 @@ do ...@@ -192,7 +192,7 @@ do
extra_ltlibs="" extra_ltlibs=""
for mod in $mods for mod in $mods
do do
extra_libs="${extra_libs} lib${mod}_plugin.a lib${mod}.a lib${mod}_pic.a" extra_libs="${extra_libs} lib${mod}_plugin.a lib${mod}.a"
extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la lib${mod}_builtin.la" extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la lib${mod}_builtin.la"
done done
rm -f "${makf}" && cat > "${makf}" << EOF rm -f "${makf}" && cat > "${makf}" << EOF
...@@ -240,7 +240,6 @@ else ...@@ -240,7 +240,6 @@ else
@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; \\
if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\ if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\
if test "\$(pic)" = "pic"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) 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; \\ \`; 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"
endif endif
...@@ -305,17 +304,6 @@ else ...@@ -305,17 +304,6 @@ else
;; \ ;; \
esac; \ esac; \
done done
if BUILD_PIC
@z=\$\$(\$(VLC_CONFIG) --list builtin); \
for mod in \$(mods); do \
case "\$\$z " \
in *\ \$\${mod}\ *) \
echo \$(INSTALL_DATA) "lib\$\${mod}_pic.a" "\$(DESTDIR)\$(libdir)/vlc/" ; \
\$(INSTALL_DATA) "lib\$\${mod}_pic.a" "\$(DESTDIR)\$(libdir)/vlc/" || exit \$\$?; \
;; \
esac; \
done
endif
endif endif
uninstall-local: uninstall-local:
...@@ -345,17 +333,6 @@ else ...@@ -345,17 +333,6 @@ else
;; \ ;; \
esac; \ esac; \
done done
if BUILD_PIC
@z=\$\$(\$(VLC_CONFIG) --list builtin); \
for mod in \$(mods); do \
case "\$\$z " \
in *\ \$\${mod}\ *) \
echo rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}_pic.a" ; \
rm -f "\$(DESTDIR)\$(libdir)/vlc/lib\$\${mod}_pic.a" || true; \
;; \
esac; \
done
endif
endif endif
EOF EOF
...@@ -409,17 +386,6 @@ lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\ ...@@ -409,17 +386,6 @@ lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\
-rpath '\$(libvlcdir)' -module -shrext \$(LIBEXT) -rpath '\$(libvlcdir)' -module -shrext \$(LIBEXT)
lib${mod}_plugin_la_LIBADD = \$(LTLIBVLC) lib${mod}_plugin_la_LIBADD = \$(LTLIBVLC)
lib${mod}_pic_a_SOURCES = \$(SOURCES_${mod})
EOF
if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
nodist_lib${mod}_pic_a_SOURCES = \$(nodist_SOURCES_${mod})
EOF
fi
cat >> "${makf}" << 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 = \$(SOURCES_${mod}) lib${mod}_a_SOURCES = \$(SOURCES_${mod})
lib${mod}_builtin_la_SOURCES = \$(SOURCES_${mod}) lib${mod}_builtin_la_SOURCES = \$(SOURCES_${mod})
EOF EOF
...@@ -429,9 +395,9 @@ nodist_lib${mod}_builtin_la_SOURCES = \$(nodist_SOURCES_${mod}) ...@@ -429,9 +395,9 @@ nodist_lib${mod}_builtin_la_SOURCES = \$(nodist_SOURCES_${mod})
EOF EOF
fi fi
cat >> "${makf}" << EOF cat >> "${makf}" << EOF
lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\` lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin \$(pic) ${mod}\`
lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\` lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin \$(pic) ${mod}\`
lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\` lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin \$(pic) ${mod}\`
lib${mod}_builtin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\` lib${mod}_builtin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
lib${mod}_builtin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\` lib${mod}_builtin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
lib${mod}_builtin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\` lib${mod}_builtin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
...@@ -478,9 +444,7 @@ rm -f ltmain.sh libtool ltconfig ...@@ -478,9 +444,7 @@ rm -f ltmain.sh libtool ltconfig
# remove gettext cruft # remove gettext cruft
rm -f ABOUT-NLS rm -f ABOUT-NLS
rm -Rf intl rm -Rf intl
# remove old vlc cruft # remove vlc cruft
rm -f m4/oldgettext.m4 stamp-pic configure.ac.in Modules.am
# remove new vlc cruft
rm -f stamp-builtin stamp-h* mozilla/stamp-pic rm -f stamp-builtin stamp-h* mozilla/stamp-pic
# Automake complains if these are not present # Automake complains if these are not present
......
...@@ -1441,7 +1441,6 @@ test "${enable_release}" != "yes" && enable_release="no" ...@@ -1441,7 +1441,6 @@ test "${enable_release}" != "yes" && enable_release="no"
dnl dnl
dnl Is the shared libvlc forced ? dnl Is the shared libvlc forced ?
dnl dnl
build_pic=no
AC_ARG_ENABLE(shared-libvlc, AC_ARG_ENABLE(shared-libvlc,
[ --enable-shared-libvlc Win32 libvlc.dll build (default disabled)]) [ --enable-shared-libvlc Win32 libvlc.dll build (default disabled)])
AS_IF([test "${enable_libtool}" != "no" && test "${enable_shared_libvlc}"], [ AS_IF([test "${enable_libtool}" != "no" && test "${enable_shared_libvlc}"], [
...@@ -5224,7 +5223,6 @@ then ...@@ -5224,7 +5223,6 @@ then
if test "${enable_mozilla}" != "false" if test "${enable_mozilla}" != "false"
then then
build_pic=yes
AC_PATH_PROG(XPIDL, xpidl, no, ${xpidl_path}:/usr/lib/mozilla:/usr/lib64/mozilla:/usr/lib/xulrunner:/usr/lib64/xulrunner) AC_PATH_PROG(XPIDL, xpidl, no, ${xpidl_path}:/usr/lib/mozilla:/usr/lib64/mozilla:/usr/lib/xulrunner:/usr/lib64/xulrunner)
if test "${XPIDL}" = "no"; then if test "${XPIDL}" = "no"; then
AC_MSG_ERROR([Please install the Mozilla development tools, xpidl was not found.]) AC_MSG_ERROR([Please install the Mozilla development tools, xpidl was not found.])
...@@ -5240,10 +5238,6 @@ AC_ARG_ENABLE(mediacontrol-python-bindings, ...@@ -5240,10 +5238,6 @@ AC_ARG_ENABLE(mediacontrol-python-bindings,
[ --enable-mediacontrol-python-bindings Enable Python bindings for MediaControl (default disabled)]) [ --enable-mediacontrol-python-bindings Enable Python bindings for MediaControl (default disabled)])
dnl TODO: look for python dev headers dnl TODO: look for python dev headers
AM_CONDITIONAL(BUILD_PYTHON, [test "${enable_mediacontrol_python_bindings}" = "yes"]) AM_CONDITIONAL(BUILD_PYTHON, [test "${enable_mediacontrol_python_bindings}" = "yes"])
if test "${enable_mediacontrol_python_bindings}" = "yes"
then
build_pic=yes
fi
dnl dnl
dnl Java bindings dnl Java bindings
...@@ -5251,22 +5245,6 @@ dnl ...@@ -5251,22 +5245,6 @@ dnl
AC_ARG_ENABLE(java-bindings, AC_ARG_ENABLE(java-bindings,
[ --enable-java-bindings Enable Java bindings (default disabled)]) [ --enable-java-bindings Enable Java bindings (default disabled)])
AM_CONDITIONAL(BUILD_JAVA, [test "${enable_java_bindings}" = "yes"]) AM_CONDITIONAL(BUILD_JAVA, [test "${enable_java_bindings}" = "yes"])
if test "${enable_java_bindings}" = "yes"
then
build_pic=yes
fi
dnl
dnl Enable pic libraries
dnl
AC_ARG_ENABLE(pic,
[ --enable-pic Enable pic libraries (default disabled)])
AM_CONDITIONAL(BUILD_PIC, [test "${enable_pic}" = "yes"])
if test "${enable_pic}" = "yes"
then
build_pic=yes
fi
dnl dnl
dnl test plugins dnl test plugins
...@@ -5400,14 +5378,10 @@ AS_IF([test "${enable_shared_libvlc}" != "no" || test "${enable_libtool}" != "no ...@@ -5400,14 +5378,10 @@ AS_IF([test "${enable_shared_libvlc}" != "no" || test "${enable_libtool}" != "no
FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"], FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"],
FILE_LIBVLC_DLL="" ) FILE_LIBVLC_DLL="" )
pic=no pic=pic
AS_IF([test "${build_pic}" = "yes"], [pic=pic]) AS_IF([test "${SYS}" = "mingw32"], [pic=])
AS_IF([test "${SYS}" = "mingw32"], [pic=no])
AS_IF([test "${pic}" = "no"], [pic=])
AC_SUBST(pic) AC_SUBST(pic)
AM_CONDITIONAL(BUILD_PIC, [test "${build_pic}" = "yes" && test "x${pic}" = "xpic"])
dnl Import conditional variables generated by bootstrap dnl Import conditional variables generated by bootstrap
VLC_CONDITIONALS VLC_CONDITIONALS
......
...@@ -25,7 +25,7 @@ if BUILD_SHARED ...@@ -25,7 +25,7 @@ if BUILD_SHARED
LIBRARIES_libvlc_pic = -Wl,-rpath '$(libdir)' -L$(top_builddir)/src -lvlc LIBRARIES_libvlc_pic = -Wl,-rpath '$(libdir)' -L$(top_builddir)/src -lvlc
LIBRARIES_libvlc_nopic = $(LIBRARIES_libvlc_pic) LIBRARIES_libvlc_nopic = $(LIBRARIES_libvlc_pic)
else else
LIBRARIES_libvlc_pic = $(top_builddir)/src/libvlc_pic.a LIBRARIES_libvlc_pic = $(top_builddir)/src/libvlc.a
LIBRARIES_libvlc_nopic = $(top_builddir)/src/libvlc.a LIBRARIES_libvlc_nopic = $(top_builddir)/src/libvlc.a
endif endif
......
...@@ -131,14 +131,13 @@ if USE_LIBTOOL ...@@ -131,14 +131,13 @@ if USE_LIBTOOL
while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
endif endif
if BUILD_SHARED if BUILD_SHARED
@if test "$(pic)" = "pic"; then ext="_pic.a"; else ext=".a"; fi ; \ @for c in `$(VLC_CONFIG) --libs builtin`; do \
for c in `$(VLC_CONFIG) --libs builtin`; do \
case $$c in \ case $$c in \
../modules/*.a) echo $$c ;; \ ../modules/*.a) echo $$c ;; \
esac ; \ esac ; \
done | \ done | \
sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \ sed -e 's/^\(.*\)\/\([^\/]*\)\.a$$/cd \1 \&\& $(MAKE) \2/g' | \
while read cmd; do echo $$cmd$$ext; eval "($$cmd$$ext)" || exit $$? ; done while read cmd; do echo $$cmd.a; eval "($$cmd.a)" || exit $$? ; done
endif endif
touch $@ touch $@
...@@ -151,11 +150,6 @@ libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc` ...@@ -151,11 +150,6 @@ libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc` libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc`
libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc` libvlc_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc`
libvlc_pic_a_SOURCES = $(SOURCES_libvlc)
libvlc_pic_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc pic`
libvlc_pic_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags vlc pic`
libvlc_pic_a_OBJCFLAGS = `$(VLC_CONFIG) --objcflags vlc pic`
libvlc_la_SOURCES = $(SOURCES_libvlc) libvlc_la_SOURCES = $(SOURCES_libvlc)
libvlc_la_LIBADD = $(INCLUDED_LIBINTL) libvlc_la_LIBADD = $(INCLUDED_LIBINTL)
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc` libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
...@@ -190,9 +184,6 @@ if USE_LIBTOOL ...@@ -190,9 +184,6 @@ if USE_LIBTOOL
lib_LTLIBRARIES = libvlc.la lib_LTLIBRARIES = libvlc.la
else else
lib_LIBRARIES = libvlc.a lib_LIBRARIES = libvlc.a
if BUILD_PIC
lib_LIBRARIES += libvlc_pic.a
endif
endif endif
if HAVE_WIN32 if HAVE_WIN32
......
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