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 =
# which have makefiles with distribution information.
# - intl should come before modules and . because all the code uses gettext
# - 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
# - loader should come before modules because some plugins need it
SUBDIRS = intl loader src modules po . mozilla bindings activex share m4 doc
......
......@@ -192,7 +192,7 @@ do
extra_ltlibs=""
for mod in $mods
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"
done
rm -f "${makf}" && cat > "${makf}" << EOF
......@@ -240,7 +240,6 @@ else
@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 "\$(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; \\
test -z "\$\$fail"
endif
......@@ -305,17 +304,6 @@ else
;; \
esac; \
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
uninstall-local:
......@@ -345,17 +333,6 @@ else
;; \
esac; \
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
EOF
......@@ -409,17 +386,6 @@ lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\
-rpath '\$(libvlcdir)' -module -shrext \$(LIBEXT)
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}_builtin_la_SOURCES = \$(SOURCES_${mod})
EOF
......@@ -429,9 +395,9 @@ nodist_lib${mod}_builtin_la_SOURCES = \$(nodist_SOURCES_${mod})
EOF
fi
cat >> "${makf}" << 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}\`
lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin \$(pic) ${mod}\`
lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin \$(pic) ${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_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
lib${mod}_builtin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
......@@ -478,9 +444,7 @@ rm -f ltmain.sh libtool ltconfig
# remove gettext cruft
rm -f ABOUT-NLS
rm -Rf intl
# remove old vlc cruft
rm -f m4/oldgettext.m4 stamp-pic configure.ac.in Modules.am
# remove new vlc cruft
# remove vlc cruft
rm -f stamp-builtin stamp-h* mozilla/stamp-pic
# Automake complains if these are not present
......
......@@ -1441,7 +1441,6 @@ test "${enable_release}" != "yes" && enable_release="no"
dnl
dnl Is the shared libvlc forced ?
dnl
build_pic=no
AC_ARG_ENABLE(shared-libvlc,
[ --enable-shared-libvlc Win32 libvlc.dll build (default disabled)])
AS_IF([test "${enable_libtool}" != "no" && test "${enable_shared_libvlc}"], [
......@@ -5224,7 +5223,6 @@ then
if test "${enable_mozilla}" != "false"
then
build_pic=yes
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
AC_MSG_ERROR([Please install the Mozilla development tools, xpidl was not found.])
......@@ -5240,10 +5238,6 @@ AC_ARG_ENABLE(mediacontrol-python-bindings,
[ --enable-mediacontrol-python-bindings Enable Python bindings for MediaControl (default disabled)])
dnl TODO: look for python dev headers
AM_CONDITIONAL(BUILD_PYTHON, [test "${enable_mediacontrol_python_bindings}" = "yes"])
if test "${enable_mediacontrol_python_bindings}" = "yes"
then
build_pic=yes
fi
dnl
dnl Java bindings
......@@ -5251,22 +5245,6 @@ dnl
AC_ARG_ENABLE(java-bindings,
[ --enable-java-bindings Enable Java bindings (default disabled)])
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 test plugins
......@@ -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="" )
pic=no
AS_IF([test "${build_pic}" = "yes"], [pic=pic])
AS_IF([test "${SYS}" = "mingw32"], [pic=no])
AS_IF([test "${pic}" = "no"], [pic=])
pic=pic
AS_IF([test "${SYS}" = "mingw32"], [pic=])
AC_SUBST(pic)
AM_CONDITIONAL(BUILD_PIC, [test "${build_pic}" = "yes" && test "x${pic}" = "xpic"])
dnl Import conditional variables generated by bootstrap
VLC_CONDITIONALS
......
......@@ -25,7 +25,7 @@ if BUILD_SHARED
LIBRARIES_libvlc_pic = -Wl,-rpath '$(libdir)' -L$(top_builddir)/src -lvlc
LIBRARIES_libvlc_nopic = $(LIBRARIES_libvlc_pic)
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
endif
......
......@@ -131,14 +131,13 @@ if USE_LIBTOOL
while read cmd; do echo $$cmd; eval "($$cmd)" || exit $$? ; done
endif
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 \
../modules/*.a) echo $$c ;; \
esac ; \
done | \
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
touch $@
......@@ -151,11 +150,6 @@ libvlc_a_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
libvlc_a_CXXFLAGS = `$(VLC_CONFIG) --cxxflags 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_LIBADD = $(INCLUDED_LIBINTL)
libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
......@@ -190,9 +184,6 @@ if USE_LIBTOOL
lib_LTLIBRARIES = libvlc.la
else
lib_LIBRARIES = libvlc.a
if BUILD_PIC
lib_LIBRARIES += libvlc_pic.a
endif
endif
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