]> git.sesse.net Git - vlc/commitdiff
contrib/*: started to adapt the contrib system for BeOS
authorEric Petit <titer@videolan.org>
Thu, 22 Jul 2004 08:51:40 +0000 (08:51 +0000)
committerEric Petit <titer@videolan.org>
Thu, 22 Jul 2004 08:51:40 +0000 (08:51 +0000)
extras/contrib/bootstrap
extras/contrib/src/Makefile
extras/contrib/src/Patches/gettext.patch [new file with mode: 0644]
extras/contrib/src/packages.mak

index 62df25611be70de7233cb49266585a4227b321d5..1b90ef248a4564c6650815e87e72fbf821415c49 100755 (executable)
@@ -3,7 +3,7 @@
 # bootstrap : Set up config.mak
 # ***************************************************************************
 # Copyright (C) 2003 VideoLAN
-# $Id: bootstrap,v 1.3 2004/01/19 01:11:47 hartman Exp $
+# $Id$
 #
 # Authors: Christophe Massiot <massiot@via.ecp.fr>
 #
@@ -39,13 +39,15 @@ if test ".`uname -s`" = ".Darwin"; then
        echo "SYS = DARWIN" >> config.mak
        echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> config.mak
        echo "CONTRIB_URL = http://download.videolan.org/pub/videolan/devtools/contrib-macosx.tar.bz2" >> config.mak
+elif test ".`uname -s`" = ".BeOS"; then
+       echo "SYS = BEOS" >> config.mak
 else
        echo "SYS = UNKNOWN" >> config.mak
 fi
 
 if which curl >/dev/null; then
        echo "WGET = curl -O" >> config.mak
-elif which wget >/dev/null; then
+elif wget --version >/dev/null 2>&1; then
        echo "WGET = wget" >> config.mak
 else
        echo "You need at least wget or curl to fetch the packages." >&2
index 0fd8a0d2b387fe19a7d547ef436d9dfebe2c30bc..eaa0a51fc5c8a7f0cd5b75545e0cce0e286cf93d 100644 (file)
@@ -29,22 +29,41 @@ include ./packages.mak
 # Set a clean environment
 # ***************************************************************************
 
+ifeq ($(SYS),DARWIN)
 export PATH = $(PREFIX)/bin:/bin:/usr/bin
 export DYLD_LIBRARY_PATH = $(PREFIX)/lib
 export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
 export CFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
 export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
 export LDFLAGS = -L$(PREFIX)/lib
+endif
+ifeq ($(SYS),BEOS)
+export PATH = $(PREFIX)/bin:.:/boot/home/config/bin:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:/boot/develop/tools/gnupro/bin
+export LIBRARY_PATH = $(PREFIX)/lib:%A/lib:/boot/home/config/lib:/boot/beos/system/lib
+export BELIBRARIES = $(PREFIX)/lib:/boot/develop/lib/x86
+export C_INCLUDE_PATH = $(PREFIX)/include
+export CPLUS_INCLUDE_PATH = $(PREFIX)/include
+endif
 
 # ***************************************************************************
 # Standard rules
 # ***************************************************************************
 
+ifeq ($(SYS),DARWIN)
 all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \
        .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \
        .FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .openslp \
        .dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \
        .cddb .cdio .vcdimager
+endif
+ifeq ($(SYS),BEOS)
+all: .perl .autoconf .libtool .automake .iconv .intl .freetype .fribidi \
+       .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \
+       .FLAC .speex .faad .faac .lame .ffmpeg .openslp \
+       .dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \
+       .cddb .cdio .vcdimager
+endif
+
 FORCE:
 
 # ***************************************************************************
@@ -75,6 +94,7 @@ endef
 #      $(INSTALL_NAME)
 #      touch $@
 
+ifeq ($(SYS),DARWIN)
 define INSTALL_NAME_LIB
        install_name_tool \
                -change $(PREFIX)/lib/$(shell cd $(PREFIX)/lib; ls | grep "lib$(INSTALL_LIB).[0-9]*.dylib") \
@@ -94,6 +114,37 @@ define INSTALL_NAME
                        $(INSTALL_NAME_LIB)) \
        fi
 endef
+endif
+
+ifeq ($(SYS),BEOS)
+define INSTALL_NAME
+       mkdir -p $(PREFIX)/vlc-lib ; \
+       cp $(PREFIX)/lib/lib$(patsubst .%,%,$@).so \
+               $(PREFIX)/vlc-lib/lib$(patsubst .%,%,$@).so ;
+endef
+endif
+
+# ***************************************************************************
+# perl
+# ***************************************************************************
+
+ifeq ($(SYS),BEOS)
+perl-$(PERL_VERSION).tar.gz:
+       $(WGET) $(PERL_URL)
+
+perl: perl-$(PERL_VERSION).tar.gz
+       $(EXTRACT_GZ)
+       mv perl/hints/beos.sh perl/hints/beos.sh.orig
+       sed 's%prefix="/boot/home/config"%prefix="$(PREFIX)"%' < perl/hints/beos.sh.orig > perl/hints/beos.sh
+
+.perl: perl
+       (cd $<; ./Configure -d -e && make && make install && ln -sf perl5/$(PERL_VERSION)/BePC-beos/CORE/libperl.so $(PREFIX)/lib/libperl.so)
+       touch $@
+
+CLEAN_FILE += .perl
+CLEAN_PKG += perl
+DISTCLEAN_PKG += perl-$(PERL_VERSION).tar.gz
+endif
 
 # ***************************************************************************
 # autoconf
@@ -117,25 +168,28 @@ DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.gz
 # libtool
 # ***************************************************************************
 
-# This breaks under Darwin
-#libtool_$(LIBTOOL_VERSION).orig.tar.gz:
-#      $(WGET) $(LIBTOOL_URL)
-
-#libtool: libtool_$(LIBTOOL_VERSION).orig.tar.gz
-#      $(EXTRACT_GZ)
-#      rm $@
-#      mv libtool-$(LIBTOOL_VERSION) $@
-
-#.libtool: libtool
-#      (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
-#      touch $@
-
-# Darwin-specific
+ifeq ($(SYS),DARWIN)
 .libtool:
        if test -x /usr/bin/glibtoolize; then \
                ln -sf /usr/bin/glibtoolize $(PREFIX)/bin/libtoolize ; \
        fi
        touch $@
+endif
+
+ifeq ($(SYS),BEOS)
+libtool-$(LIBTOOL_VERSION).tar.gz:
+       $(WGET) $(LIBTOOL_URL)
+
+libtool: libtool-$(LIBTOOL_VERSION).tar.gz
+       $(EXTRACT_GZ)
+
+.libtool: libtool
+       (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
+       touch $@
+
+CLEAN_PKG += libtool
+DISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gz
+endif
 
 CLEAN_FILE += .libtool
 
@@ -202,9 +256,16 @@ gettext-$(GETTEXT_VERSION).tar.gz:
 
 gettext: gettext-$(GETTEXT_VERSION).tar.gz
        $(EXTRACT_GZ)
+       patch -p 0 < Patches/gettext.patch
 
 .intl: gettext .iconv
-       (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
+       ( cd $< && ./configure --prefix=$(PREFIX) )
+ifeq ($(SYS),BEOS)
+# The ugliest kludge ever - so libtool correctly links shared libraries
+# on BeOS. Sorry, I just can't figure out how libtool works
+       ( cd $< && for f in `find . -name libtool`; do mv $$f $$f.orig; sed -e 's/ -shared / -nostart /' -e 's/^predep_objects.*/predep_objects=""/' < $$f.orig > $$f; chmod +x $$f; rm $$f.orig; done )
+endif
+       ( cd $< && make && make install )
        $(INSTALL_NAME)
        touch $@
 
@@ -224,7 +285,9 @@ freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
 
 .freetype: freetype2
        (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
+ifeq ($(SYS),DARWIN)
        $(INSTALL_NAME)
+endif
        touch $@
 
 CLEAN_FILE += .freetype
@@ -244,7 +307,9 @@ fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
 
 .fribidi: fribidi
        (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
+ifeq ($(SYS),DARWIN)
        $(INSTALL_NAME)
+endif
        touch $@
 
 CLEAN_FILE += .fribidi
diff --git a/extras/contrib/src/Patches/gettext.patch b/extras/contrib/src/Patches/gettext.patch
new file mode 100644 (file)
index 0000000..fea4116
--- /dev/null
@@ -0,0 +1,55 @@
+diff -ru gettext-original/gettext-runtime/libasprintf/autosprintf.cc gettext/gettext-runtime/libasprintf/autosprintf.cc
+--- gettext-original/gettext-runtime/libasprintf/autosprintf.cc        Mon Oct 28 19:44:32 2002
++++ gettext/gettext-runtime/libasprintf/autosprintf.cc Thu Jul 22 10:23:30 2004
+@@ -32,6 +32,51 @@
+ #include <string.h>
+ #include "lib-asprintf.h"
++#ifdef __BEOS__
++/* vasprintf emulation (borrowed from VLC) */
++#define vasprintf beossux_vasprintf
++int beossux_vasprintf(char **strp, const char *fmt, va_list ap)
++{
++    /* Guess we need no more than 100 bytes. */
++    int     i_size = 100;
++    char    *p = (char *) malloc( i_size );
++    int     n;
++
++    if( p == NULL )
++    {
++        *strp = NULL;
++        return -1;
++    }
++
++    for( ;; )
++    {
++        /* Try to print in the allocated space. */
++        n = vsnprintf( p, i_size, fmt, ap );
++
++        /* If that worked, return the string. */
++        if (n > -1 && n < i_size)
++        {
++            *strp = p;
++            return strlen( p );
++        }
++        /* Else try again with more space. */
++        if (n > -1)    /* glibc 2.1 */
++        {
++           i_size = n+1; /* precisely what is needed */
++        }
++        else           /* glibc 2.0 */
++        {
++           i_size *= 2;  /* twice the old size */
++        }
++        if( (p = (char *) realloc( p, i_size ) ) == NULL)
++        {
++            *strp = NULL;
++            return -1;
++        }
++    }
++}
++#endif
++
+ namespace gnu
+ {
index 70e6e0ac811232fbd5311bb727e4ae5ddb36fe60..15c943c90ba09b35c4b1ed47b28a82402e0e25f3 100644 (file)
 GNU=http://ftp.gnu.org/pub/gnu
 SF=http://heanet.dl.sourceforge.net/sourceforge
 VIDEOLAN=http://download.videolan.org/pub/videolan
-AUTOCONF_VERSION=2.58
+PERL_VERSION=5.8.5
+PERL_URL=http://ftp.funet.fi/pub/CPAN/src/perl-$(PERL_VERSION).tar.gz
+# Autoconf > 2.57 doesn't work ok on BeOS. Don't ask why.
+AUTOCONF_VERSION=2.57
 AUTOCONF_URL=$(GNU)/autoconf/autoconf-$(AUTOCONF_VERSION).tar.gz
-#LIBTOOL_VERSION=1.5
-#LIBTOOL_URL=$(GNU)/libtool/libtool-$(LIBTOOL_VERSION).tar.gz
-#LIBTOOL_URL=http://ftp.fr.debian.org/debian/pool/main/libt/libtool/libtool_$(LIBTOOL_VERSION).orig.tar.gz
+LIBTOOL_VERSION=1.5.6
+LIBTOOL_URL=$(GNU)/libtool/libtool-$(LIBTOOL_VERSION).tar.gz
 AUTOMAKE_VERSION=1.7.8
 AUTOMAKE_URL=$(GNU)/automake/automake-$(AUTOMAKE_VERSION).tar.gz
 PKGCFG_VERSION=0.15.0