]> git.sesse.net Git - vlc/commitdiff
miscellaneous fixes when building contribs on Cygwin
authorDamien Fouilleul <damienf@videolan.org>
Thu, 27 Jul 2006 19:51:57 +0000 (19:51 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Thu, 27 Jul 2006 19:51:57 +0000 (19:51 +0000)
- 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

extras/contrib/bootstrap
extras/contrib/src/Makefile

index 3a23255a5bdec7bf38e32572b46f23ce950805b1..f5730f21684294cbbbc7407428656108dedcd3f5 100755 (executable)
@@ -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
index e4ae4c884e07f76299d69546026407b66ffa7377..51e904c96ef199a3ffc8fdc999d571019d41ab5b 100644 (file)
@@ -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
+