Commit ca0ddba7 authored by Damien Fouilleul's avatar Damien Fouilleul

extras/contrib/src/Makefile: cleaned up INSTALL_NAME macro for MacOS X: all...

extras/contrib/src/Makefile: cleaned up INSTALL_NAME macro for MacOS X: all the dylib in contrib/lib are soft-linked to their distributed version in 'vlc-lib'. this way, VLC build system can use contrib libs on MacOS X the same way as for UNIX, and should simplify porting to libtool
configure.ac: cleaned up Cocoa.h detection, removed link path dependency to 'vlc-lib' as it is no longer necessary
Makefile.am: fixed installation of dylibs as vlc_ prefix is already appended by INSTALL_NAME

NOTE: this change is highly disruptive for MacOS X build, I strongly recommend that you rebuild the contrib packages for this platform. Other platforms are unaffected
parent f96736f0
...@@ -394,7 +394,7 @@ VLC-release.app: vlc ...@@ -394,7 +394,7 @@ VLC-release.app: vlc
if test -d $(srcdir)/extras/contrib/vlc-lib; then \ if test -d $(srcdir)/extras/contrib/vlc-lib; then \
mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/lib ; \ mkdir -p $(top_builddir)/VLC-release.app/Contents/MacOS/lib ; \
for i in $(srcdir)/extras/contrib/vlc-lib/*.dylib ; do \ for i in $(srcdir)/extras/contrib/vlc-lib/*.dylib ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \ $(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/lib/`basename $${i}` ; \
done ; \ done ; \
fi fi
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share $(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share
...@@ -505,7 +505,7 @@ VLC.app: vlc ...@@ -505,7 +505,7 @@ VLC.app: vlc
if test -d $(srcdir)/extras/contrib/vlc-lib; then \ if test -d $(srcdir)/extras/contrib/vlc-lib; then \
mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/lib ; \ mkdir -p $(top_builddir)/VLC.app/Contents/MacOS/lib ; \
for i in $(srcdir)/extras/contrib/vlc-lib/*.dylib ; do \ for i in $(srcdir)/extras/contrib/vlc-lib/*.dylib ; do \
ln -sfn `pwd`/$${i} $(top_builddir)/VLC.app/Contents/MacOS/lib/vlc_`basename $${i}` ; \ ln -sfn `pwd`/$${i} $(top_builddir)/VLC.app/Contents/MacOS/lib/`basename $${i}` ; \
done ; \ done ; \
fi fi
ln -sfn `pwd`/share $(top_builddir)/VLC.app/Contents/MacOS/ ln -sfn `pwd`/share $(top_builddir)/VLC.app/Contents/MacOS/
......
...@@ -114,10 +114,6 @@ AC_ARG_WITH(contrib, ...@@ -114,10 +114,6 @@ AC_ARG_WITH(contrib,
else else
export PKG_CONFIG_LIBDIR=${topdir}/extras/contrib/lib/pkgconfig export PKG_CONFIG_LIBDIR=${topdir}/extras/contrib/lib/pkgconfig
fi fi
if test -d ${topdir}/extras/contrib/vlc-lib; then
LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/vlc-lib"
LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/vlc-lib"
fi
LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/lib" LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/lib"
LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/lib" LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/lib"
...@@ -4655,6 +4651,8 @@ AC_ARG_ENABLE(opie, ...@@ -4655,6 +4651,8 @@ AC_ARG_ENABLE(opie,
dnl dnl
dnl MacOS X module dnl MacOS X module
dnl dnl
ORIGCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -x objective-c"
AC_ARG_ENABLE(macosx, AC_ARG_ENABLE(macosx,
[ --enable-macosx MacOS X support (default enabled on MacOS X)], [ --enable-macosx MacOS X support (default enabled on MacOS X)],
[if test "${enable_macosx}" = "yes" [if test "${enable_macosx}" = "yes"
...@@ -4666,6 +4664,7 @@ AC_ARG_ENABLE(macosx, ...@@ -4666,6 +4664,7 @@ AC_ARG_ENABLE(macosx,
VLC_ADD_BUILTINS([macosx]) VLC_ADD_BUILTINS([macosx])
VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL]) VLC_ADD_LDFLAGS([macosx],[-framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC -framework OpenGL])
)]) )])
CFLAGS=$ORIGCFLAGS
dnl dnl
dnl QNX RTOS module dnl QNX RTOS module
...@@ -5044,6 +5043,7 @@ then ...@@ -5044,6 +5043,7 @@ then
CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}" CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
AC_CHECK_HEADERS(mozilla-config.h) AC_CHECK_HEADERS(mozilla-config.h)
CPPFLAGS="${CPPFLAGS_save}" CPPFLAGS="${CPPFLAGS_save}"
MOZILLA_SDK_PATH="`${MOZILLA_CONFIG} --prefix`"
XPIDL_INCL="`${MOZILLA_CONFIG} --cflags plugin xpcom java` \ XPIDL_INCL="`${MOZILLA_CONFIG} --cflags plugin xpcom java` \
`${MOZILLA_CONFIG} --idlflags plugin xpcom java` " `${MOZILLA_CONFIG} --idlflags plugin xpcom java` "
xpidl_path="`${MOZILLA_CONFIG} --prefix`/bin" xpidl_path="`${MOZILLA_CONFIG} --prefix`/bin"
...@@ -5074,6 +5074,7 @@ then ...@@ -5074,6 +5074,7 @@ then
fi fi
fi fi
MOZILLA_SDK_PATH="${real_mozilla_sdk}"
XPIDL_INCL="-I${real_mozilla_sdk}${mozilla_sdk_xpcom}/idl" XPIDL_INCL="-I${real_mozilla_sdk}${mozilla_sdk_xpcom}/idl"
xpidl_path="${real_mozilla_sdk}${mozilla_sdk_xpcom}/bin" xpidl_path="${real_mozilla_sdk}${mozilla_sdk_xpcom}/bin"
...@@ -5308,6 +5309,7 @@ AC_SUBST(ALIASES) ...@@ -5308,6 +5309,7 @@ AC_SUBST(ALIASES)
AC_SUBST(ASM) AC_SUBST(ASM)
AC_SUBST(MOC) AC_SUBST(MOC)
AC_SUBST(WINDRES) AC_SUBST(WINDRES)
AC_SUBST(MOZILLA_SDK_PATH)
AC_SUBST(XPIDL) AC_SUBST(XPIDL)
AC_SUBST(XPIDL_INCL) AC_SUBST(XPIDL_INCL)
AC_SUBST(LIBEXT) AC_SUBST(LIBEXT)
......
...@@ -36,6 +36,9 @@ include ./packages.mak ...@@ -36,6 +36,9 @@ include ./packages.mak
export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH) export PATH := $(PREFIX)/bin:$(EXTRA_PATH):$(PATH)
export PKG_CONFIG_PATH export PKG_CONFIG_PATH
export DYLD_LIBRARY_PATH = $(PREFIX)/lib export DYLD_LIBRARY_PATH = $(PREFIX)/lib
# following is required for configure scripts that check dyld libraries
# by building and running a test app
export DYLD_FALLBACK_LIBRARY_PATH = $(PREFIX)/vlc-lib
export MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET) export MACOSX_DEPLOYMENT_TARGET = $(SDK_TARGET)
export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH) export LIBRARY_PATH := $(PREFIX)/lib:$(LIBRARY_PATH)
export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS) export CFLAGS = -I$(PREFIX)/include $(EXTRA_CFLAGS) $(EXTRA_CPPFLAGS)
...@@ -122,7 +125,7 @@ ifdef HAVE_DARWIN_OS ...@@ -122,7 +125,7 @@ ifdef HAVE_DARWIN_OS
.FLAC .speex .shout .faad .faac .lame .twolame .ebml .matroska .ffmpeg \ .FLAC .speex .shout .faad .faac .lame .twolame .ebml .matroska .ffmpeg \
.dvdcss .dvdnav .dvdread .dvbpsi .live .x264 .caca .mod \ .dvdcss .dvdnav .dvdread .dvbpsi .live .x264 .caca .mod \
.png .gpg-error .gcrypt .gnutls .opendaap .cddb .cdio .vcdimager .SDL_image \ .png .gpg-error .gcrypt .gnutls .opendaap .cddb .cdio .vcdimager .SDL_image \
.glib .libidl .gecko .mpcdec .expat .clinkcc .aclocal .glib .libidl .gecko .mpcdec .expat .clinkcc .aclocal .dirac_encoder .dirac_decoder
# .FLAC .expat .clinkcc don't work with SDK yet # .FLAC .expat .clinkcc don't work with SDK yet
# .glib .libidl .gecko are required to build the mozilla plugin # .glib .libidl .gecko are required to build the mozilla plugin
# .mozilla will build an entire mozilla. it can be used if we need to create a new .gecko package # .mozilla will build an entire mozilla. it can be used if we need to create a new .gecko package
...@@ -210,25 +213,35 @@ endef ...@@ -210,25 +213,35 @@ endef
# touch $@ # touch $@
ifdef HAVE_DARWIN_OS ifdef HAVE_DARWIN_OS
define INSTALL_NAME_LIB # the original libtoto.dylib is copied from contrib/lib to vlc-lib as
install_name_tool \ # vlc_libtoto.dylib. a soft link to this library is created in contrib/lib
-change $(PREFIX)/lib/$(shell cd $(PREFIX)/lib; ls | grep "lib$(INSTALL_LIB).[0-9]*.dylib") \ # using the orginal dylib name. if libtoto.la also exists, the library named
@executable_path/lib/vlc_lib$(INSTALL_LIB).dylib \ # in dlname is also changed to a soft-link to vlc-lib in order to support
$(PREFIX)/vlc-lib/lib$(patsubst .%,%,$@).dylib ; # libtool. to satisfy VLC.app dyld search, vlc_libtoto.dylib dyld id is changed
endef # to @executable_path/lib/vlc_libtoto.dylib
define INSTALL_NAME define INSTALL_NAME
if which install_name_tool >/dev/null; then \ if which install_name_tool >/dev/null; then \
mkdir -p $(PREFIX)/vlc-lib ; \ mkdir -p $(PREFIX)/vlc-lib ; \
cp $(PREFIX)/lib/lib$(patsubst .%,%,$@).dylib \ libname='lib$(patsubst .%,%,$@)' ; \
$(PREFIX)/vlc-lib/lib$(patsubst .%,%,$@).dylib ; \ dlname="$$libname.dylib" ; \
cp $(PREFIX)/lib/$$dlname \
$(PREFIX)/vlc-lib/vlc_$$dlname ; \
rm $(PREFIX)/lib/$$dlname ; \
ln -s $(PREFIX)/vlc-lib/vlc_$$dlname \
$(PREFIX)/lib/$$dlname ; \
if [ -f $(PREFIX)/lib/$$libname.la ]; then \
eval ltname=`sed -n 's/dlname=//p' $(PREFIX)/lib/$$libname.la`; \
rm $(PREFIX)/lib/$$ltname ; \
ln -s $(PREFIX)/vlc-lib/vlc_$$dlname \
$(PREFIX)/lib/$$ltname ; \
fi ; \
install_name_tool \ install_name_tool \
-id @executable_path/lib/vlc_lib$(patsubst .%,%,$@).dylib \ -id @executable_path/lib/vlc_$$dlname \
$(PREFIX)/vlc-lib/lib$(patsubst .%,%,$@).dylib ; \ $(PREFIX)/vlc-lib/vlc_$$dlname ; \
$(foreach INSTALL_LIB,$(patsubst .%,%,$(filter .%,$^)), \
$(INSTALL_NAME_LIB)) \
fi fi
endef endef
endif endif
ifeq ($(HOST),i586-pc-beos) ifeq ($(HOST),i586-pc-beos)
...@@ -953,7 +966,7 @@ DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz ...@@ -953,7 +966,7 @@ DISTCLEAN_PKG += libdvdcss-$(LIBDVDCSS_VERSION).tar.gz
# *************************************************************************** # ***************************************************************************
.dvdread: .dvdnav .dvdread: .dvdnav
$(INSTALL_NAME) $(INSTALL_NAME)
(install_name_tool -change $(PREFIX)/lib/libdvdread.0.dylib @executable_path/lib/vlc_libdvdread.dylib $(PREFIX)/vlc-lib/libdvdnav.dylib) (install_name_tool -change $(PREFIX)/lib/libdvdread.0.dylib @executable_path/lib/vlc_libdvdread.dylib $(PREFIX)/vlc-lib/vlc_libdvdnav.dylib)
touch $@ touch $@
CLEAN_FILE += .dvdread CLEAN_FILE += .dvdread
...@@ -1484,7 +1497,6 @@ gnutls-$(GNUTLS_VERSION).tar.bz2: ...@@ -1484,7 +1497,6 @@ gnutls-$(GNUTLS_VERSION).tar.bz2:
gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2 gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
$(EXTRACT_BZ2) $(EXTRACT_BZ2)
(cd gnutls/gl ;ln -s alloca_.h alloca.h)
.gnutls: gnutls .gcrypt .gpg-error .gnutls: gnutls .gcrypt .gpg-error
ifdef HAVE_WIN32 ifdef HAVE_WIN32
...@@ -1754,6 +1766,14 @@ endif ...@@ -1754,6 +1766,14 @@ endif
.dirac: dirac .dirac: dirac
(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && DOC_DIR="" make && DOC_DIR="" make install) (cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" && DOC_DIR="" make && DOC_DIR="" make install)
touch $@
# for MacOS X, dirac is split into two libraries, which needs be installed using two targets
.dirac_encoder: .dirac
$(INSTALL_NAME)
touch $@
.dirac_decoder: .dirac
$(INSTALL_NAME) $(INSTALL_NAME)
touch $@ touch $@
......
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