From: Damien Fouilleul Date: Thu, 27 Jul 2006 19:51:57 +0000 (+0000) Subject: miscellaneous fixes when building contribs on Cygwin X-Git-Tag: 0.9.0-test0~10772 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=727eb9d899feb540f9ac298aeb125fa25d2cbbc8;p=vlc 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 --- diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap index 3a23255a5b..f5730f2168 100755 --- a/extras/contrib/bootstrap +++ b/extras/contrib/bootstrap @@ -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 diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile index e4ae4c884e..51e904c96e 100644 --- a/extras/contrib/src/Makefile +++ b/extras/contrib/src/Makefile @@ -10,6 +10,7 @@ # Felix Kühne # Christophe Mutricy # Gildas Bazin +# Damien Fouilleul # # 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 +