#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+confflags = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
+
#
# Compilation options
#
-
-CONFIG_FLAGS = --enable-release --prefix=/usr
-CONFIG_FLAGS += \
+vlc_confflags = --enable-release --prefix=/usr
+vlc_confflags += \
--disable-gnome \
--disable-gtk \
--disable-familiar \
--disable-satellite \
--enable-ogg \
--enable-vorbis \
- --enable-wxwindows \
- --with-wx-config=wxgtk-2.4-config \
+ --enable-wxwidgets \
+ --with-wx-config=wx-config \
--disable-slp \
--enable-flac \
--disable-skins \
--enable-gnutls \
--enable-ffmpeg \
--enable-ncurses \
+ --enable-smb \
$(NULL)
# These ones are currently shipped with VLC
-CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad2
-CONFIG_FLAGS += --enable-x264 --with-x264-tree=extras/x264
+vlc_confflags += --enable-faad --with-faad-tree=extras/faad2
+vlc_confflags += --enable-x264 --with-x264-tree=extras/x264
# Glide and svgalib are only for x86
-ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
-CONFIG_FLAGS += --enable-glide
-CONFIG_FLAGS += --enable-svgalib
+ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
+vlc_confflags += --enable-glide
+vlc_confflags += --enable-svgalib
+endif
+
+# We need this hack for i386 and amd64
+ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
+CC = $(shell pwd)/debian/gcc-snapshot
+export CC
+endif
+ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),amd64)
+CC = $(shell pwd)/debian/gcc-snapshot
+export CC
endif
# Remove --without-dvdcss in non-totalitarian countries
-CONFIG_FLAGS += --enable-dvd --without-dvdcss
+vlc_confflags += --enable-dvd --without-dvdcss
# A few shortcuts
VIDDIR = usr/share/vlc
PIXDIR = usr/share/pixmaps
-GNOMEDIR = usr/share/gnome/apps/Multimedia
+APPDIR = usr/share/applications
+
#
# Build rules
# Check that we have an x264 tree in here (can be a symlink)
test -d extras/x264
- if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/x264 \
- && jam -dx libx264.a; \
- fi
+ cd extras/x264 \
+ && ./configure $(confflags) --extra-cflags='$$(ECFLAGS)' \
+ --extra-asflags='$$(EASFLAGS)' \
+ && $(MAKE)
# Check that we have an faad2 tree in here (can be a symlink)
test -d extras/faad2
- if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/faad2 \
- && touch `find . -name configure.in` \
- && touch `find . -name aclocal.m4` \
- && touch `find . -name configure` \
- && touch `find . -name config.h.in` \
- && touch `find . -name Makefile.in` \
- && ./configure --disable-shared \
- && cd libfaad \
- && $(MAKE); \
- fi
+ cd extras/faad2 \
+ && touch `find . -name configure.in` \
+ && touch `find . -name aclocal.m4` \
+ && touch `find . -name configure` \
+ && touch `find . -name config.h.in` \
+ && touch `find . -name Makefile.in` \
+ && ./configure $(confflags) --disable-shared \
+ && cd libfaad \
+ && $(MAKE)
# Configure VLC
./configure --mandir=$${prefix}/share/man \
- --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
+ --infodir=$${prefix}/share/info $(confflags) $(vlc_confflags)
touch configure-stamp
$(MAKE) vlc
# Hackety hackety hack
- if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/x264 \
- && jam -dx clean \
- && rm -f Jamfile.pic \
- && sed 's/^CCFLAGS *=/& -fPIC -DPIC /' <Jamfile >Jamfile.pic \
- && jam -dx -sJAMFILE=Jamfile.pic libx264.a \
- && rm -f Jamfile.pic; \
- fi
+ cd extras/x264 && $(MAKE) clean && $(MAKE) ECFLAGS=-fPIC EASFLAGS=-D__PIC__
# HACKETY HACKETY HACK
- if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/faad2/libfaad \
- && $(MAKE) clean \
- && $(MAKE) AM_CFLAGS=-fPIC; \
- fi
+ cd extras/faad2/libfaad && $(MAKE) clean && $(MAKE) AM_CFLAGS=-fPIC
# Build all the rest, with the PIC libs
AM_MAKEFLAGS='builtin=no' $(MAKE)
# Check that we have an x264 tree in here (can be a symlink)
test -d extras/x264
- -if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/x264 && jam -dx clean; \
- fi
+ -cd extras/x264 && $(MAKE) distclean
# Check that we have an faad2 tree in here (can be a symlink)
test -d extras/faad2
- -if test ! '(' -d CVS -o -d .svn ')'; then \
- cd extras/faad2 && $(MAKE) distclean; \
- fi
+ -cd extras/faad2 && $(MAKE) distclean
+
+ # Clean zsh completion stuff
+ rm -f extras/zsh
# Removed ugly cruft
rm -f src/misc/modules_builtin.h
# Package: vlc
mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
- cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
- cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
+ cp debian/gvlc.desktop debian/gvlc/$(APPDIR)
+ cp debian/gnome-vlc.desktop debian/gnome-vlc/$(APPDIR)
#cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
#strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
# Package: vlc-plugin-glide
-ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
+ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
debian/vlc-plugin-glide/usr/lib/vlc/video_output/
#mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
# Package: vlc-plugin-svgalib
-ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
+ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
cp debian/vlc/$(VIDDIR)/vlc.xpm debian/wxvlc/$(VIDDIR)/wxvlc.xpm
- mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
+ cp debian/vlc.desktop debian/wxvlc/$(APPDIR)
+ mv debian/vlc/usr/lib/vlc/gui/libwxwidgets_plugin.so \
debian/wxvlc/usr/lib/vlc/gui/
ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz