Commit 727eb9d8 authored by Damien Fouilleul's avatar Damien Fouilleul

miscellaneous fixes when building contribs on Cygwin

- boostrap: make configure.ac happy when detecting contribs build on Cygwin
- Makefile: cleanup, fixed extraction of files containing invalid characters (on DOS LFN), gpg-error compiling
parent 4962512e
......@@ -43,11 +43,6 @@ fi
rm -f config.mak
echo -e "# Automatically generated by bootstrap.\n# Make changes if you know what you're doing.\n" > config.mak
echo "BUILD = $BUILD" >> config.mak
echo "HOST = $HOST" >> config.mak
echo "PREFIX = `pwd`" >> config.mak
if test "$HOST" != "$BUILD"; then
CC="${HOST}-gcc"
CXX="${HOST}-g++"
......@@ -117,10 +112,11 @@ case $HOST in
;;
i686-pc-cygwin)
echo "HAVE_WIN32 = 1" >> config.mak
CC="gcc -mno-cygwin"
CXX="g++ -mno-cygwin"
EXTRA_CFLAGS=" -mno-cygwin"
EXTRA_CPPFLAGS=" -mno-cygwin"
CC="gcc -mno-cygwin -isystem /usr/include/mingw"
CXX="g++ -mno-cygwin -isystem /usr/include/mingw"
HOST=`$CC -dumpmachine`
EXTRA_CFLAGS=" -mno-cygwin -isystem /usr/include/mingw"
EXTRA_CPPFLAGS=" -mno-cygwin -isystem /usr/include/mingw"
EXTRA_LDFLAGS=" -mno-cygwin"
echo "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig" >> config.mak
;;
......@@ -133,6 +129,11 @@ case $HOST in
;;
esac
echo "BUILD = $BUILD" >> config.mak
echo "HOST = $HOST" >> config.mak
echo "PREFIX = `pwd`" >> config.mak
echo "CC = ${CC}" >> config.mak
echo "CXX = ${CXX}" >> config.mak
echo "LD = ${LD}" >> config.mak
......
......@@ -10,6 +10,7 @@
# Felix Kühne <fkuehne@users.sourceforge.net>
# Christophe Mutricy <xtophe AT xtelevision.com>
# Gildas Bazin <gbazin at videolan dot org>
# Damien Fouilleul <damienf at videolan dot org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -81,15 +82,21 @@ else
HOSTCC2=$(HOSTCC)
endif
ifneq ($(BUILD),$(HOST))
# We are cross compiling
HOSTCONF=--host=$(HOST) --build=$(BUILD)
FFMPEGCONF=--cross-prefix=$(HOST)-
X264CONF=--crosscompile=$(HOST)
else
ifneq ($(CC),)
FFMPEGCONF=--cc="$(CC)"
endif
#
# compiling for MinGW under Cygwin could be detected as cross compiling
# unfortunately there isn't a complete separate GCC toolchain for MinGW under cygwin
#
ifeq (,$(findstring cygwin,$(BUILD)),)
ifneq ($(BUILD),$(HOST))
# We are cross compiling
HOSTCONF=--host=$(HOST) --build=$(BUILD)
FFMPEGCONF=--cross-prefix=$(HOST)-
X264CONF=--crosscompile=$(HOST)
else
ifneq ($(CC),)
FFMPEGCONF=--cc="$(CC)"
endif
endif
endif
#
......@@ -198,17 +205,26 @@ FORCE:
# ***************************************************************************
define EXTRACT_GZ
tar xzf $<
rm -rf $@ || true
tar xzf $< --exclude='[*?:<>\|]'
mv $(patsubst %.tar.gz,%,$(patsubst %.tgz,%,$(notdir $<))) $@ || true
touch $@
endef
define EXTRACT_BZ2
bunzip2 -c $< | tar xf -
rm -rf $@ || true
bunzip2 -c $< | tar xf - --exclude='[*?:<>\|]'
mv $(patsubst %.tar.bz2,%,$(notdir $<)) $@ || true
touch $@
endef
define EXTRACT_ZIP
rm -rf $@ || true
unzip $<
mv $(patsubst %.zip,%,$(notdir $<)) $@ || true
touch $@
endef
### Darwin-specific ###
# These macros prepare the dynamic libraries for inclusion in the Mac OS X
# bundle. For instance if you're building a library named libtoto.dylib,
......@@ -786,7 +802,7 @@ faad: faad2-$(FAAD2_VERSION).tar.bz2
touch $@
CLEAN_FILE += .faad
CLEAN_PKG += faad2
CLEAN_PKG += faad
DISTCLEAN_PKG += faad2-$(FAAD2_VERSION).tar.bz2
# ***************************************************************************
......@@ -1486,7 +1502,8 @@ libgpg-error: libgpg-error-$(GPGERROR_VERSION).tar.gz
ifeq ($(HOST),i686-apple-darwin8)
(cd $<; ./autogen.sh)
endif
(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --prefix=$(PREFIX) --disable-nls --disable-shared && make && make install)
# MinGW host is not properly detected when building on cygwin
(cd $<; $(HOSTCC) ./configure $(HOSTCONF) --host=$(HOST) --prefix=$(PREFIX) --disable-nls --disable-shared && make && make install)
# $(INSTALL_NAME)
touch $@
......@@ -1948,3 +1965,4 @@ clean-src: clean
rm -rf $(DISTCLEAN_PKG)
distclean: clean-src
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