Commit 17a71971 authored by Eric Petit's avatar Eric Petit

contrib/*: started to adapt the contrib system for BeOS

parent 94506eca
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# bootstrap : Set up config.mak # bootstrap : Set up config.mak
# *************************************************************************** # ***************************************************************************
# Copyright (C) 2003 VideoLAN # 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> # Authors: Christophe Massiot <massiot@via.ecp.fr>
# #
...@@ -39,13 +39,15 @@ if test ".`uname -s`" = ".Darwin"; then ...@@ -39,13 +39,15 @@ if test ".`uname -s`" = ".Darwin"; then
echo "SYS = DARWIN" >> config.mak echo "SYS = DARWIN" >> config.mak
echo "EXTRA_CPPFLAGS = -no-cpp-precomp" >> 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 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 else
echo "SYS = UNKNOWN" >> config.mak echo "SYS = UNKNOWN" >> config.mak
fi fi
if which curl >/dev/null; then if which curl >/dev/null; then
echo "WGET = curl -O" >> config.mak 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 echo "WGET = wget" >> config.mak
else else
echo "You need at least wget or curl to fetch the packages." >&2 echo "You need at least wget or curl to fetch the packages." >&2
......
...@@ -29,22 +29,41 @@ include ./packages.mak ...@@ -29,22 +29,41 @@ include ./packages.mak
# Set a clean environment # Set a clean environment
# *************************************************************************** # ***************************************************************************
ifeq ($(SYS),DARWIN)
export PATH = $(PREFIX)/bin:/bin:/usr/bin export PATH = $(PREFIX)/bin:/bin:/usr/bin
export DYLD_LIBRARY_PATH = $(PREFIX)/lib export DYLD_LIBRARY_PATH = $(PREFIX)/lib
export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS) export CPPFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
export CFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS) export CFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS) export CXXFLAGS = -I$(PREFIX)/include $(EXTRA_CPPFLAGS)
export LDFLAGS = -L$(PREFIX)/lib 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 # Standard rules
# *************************************************************************** # ***************************************************************************
ifeq ($(SYS),DARWIN)
all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \ all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \
.a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ .a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \
.FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .openslp \ .FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .openslp \
.dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \ .dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \
.cddb .cdio .vcdimager .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: FORCE:
# *************************************************************************** # ***************************************************************************
...@@ -75,6 +94,7 @@ endef ...@@ -75,6 +94,7 @@ endef
# $(INSTALL_NAME) # $(INSTALL_NAME)
# touch $@ # touch $@
ifeq ($(SYS),DARWIN)
define INSTALL_NAME_LIB define INSTALL_NAME_LIB
install_name_tool \ install_name_tool \
-change $(PREFIX)/lib/$(shell cd $(PREFIX)/lib; ls | grep "lib$(INSTALL_LIB).[0-9]*.dylib") \ -change $(PREFIX)/lib/$(shell cd $(PREFIX)/lib; ls | grep "lib$(INSTALL_LIB).[0-9]*.dylib") \
...@@ -94,6 +114,37 @@ define INSTALL_NAME ...@@ -94,6 +114,37 @@ define INSTALL_NAME
$(INSTALL_NAME_LIB)) \ $(INSTALL_NAME_LIB)) \
fi fi
endef 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 # autoconf
...@@ -117,25 +168,28 @@ DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.gz ...@@ -117,25 +168,28 @@ DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.gz
# libtool # libtool
# *************************************************************************** # ***************************************************************************
# This breaks under Darwin ifeq ($(SYS),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
.libtool: .libtool:
if test -x /usr/bin/glibtoolize; then \ if test -x /usr/bin/glibtoolize; then \
ln -sf /usr/bin/glibtoolize $(PREFIX)/bin/libtoolize ; \ ln -sf /usr/bin/glibtoolize $(PREFIX)/bin/libtoolize ; \
fi fi
touch $@ 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 CLEAN_FILE += .libtool
...@@ -202,9 +256,16 @@ gettext-$(GETTEXT_VERSION).tar.gz: ...@@ -202,9 +256,16 @@ gettext-$(GETTEXT_VERSION).tar.gz:
gettext: gettext-$(GETTEXT_VERSION).tar.gz gettext: gettext-$(GETTEXT_VERSION).tar.gz
$(EXTRACT_GZ) $(EXTRACT_GZ)
patch -p 0 < Patches/gettext.patch
.intl: gettext .iconv .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) $(INSTALL_NAME)
touch $@ touch $@
...@@ -224,7 +285,9 @@ freetype2: freetype-$(FREETYPE2_VERSION).tar.gz ...@@ -224,7 +285,9 @@ freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
.freetype: freetype2 .freetype: freetype2
(cd $<; ./configure --prefix=$(PREFIX) && make && make install) (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME) $(INSTALL_NAME)
endif
touch $@ touch $@
CLEAN_FILE += .freetype CLEAN_FILE += .freetype
...@@ -244,7 +307,9 @@ fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz ...@@ -244,7 +307,9 @@ fribidi: fribidi-$(FRIBIDI_VERSION).tar.gz
.fribidi: fribidi .fribidi: fribidi
(cd $<; ./configure --prefix=$(PREFIX) && make && make install) (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME) $(INSTALL_NAME)
endif
touch $@ touch $@
CLEAN_FILE += .fribidi CLEAN_FILE += .fribidi
......
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
{
...@@ -25,11 +25,13 @@ ...@@ -25,11 +25,13 @@
GNU=http://ftp.gnu.org/pub/gnu GNU=http://ftp.gnu.org/pub/gnu
SF=http://heanet.dl.sourceforge.net/sourceforge SF=http://heanet.dl.sourceforge.net/sourceforge
VIDEOLAN=http://download.videolan.org/pub/videolan 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 AUTOCONF_URL=$(GNU)/autoconf/autoconf-$(AUTOCONF_VERSION).tar.gz
#LIBTOOL_VERSION=1.5 LIBTOOL_VERSION=1.5.6
#LIBTOOL_URL=$(GNU)/libtool/libtool-$(LIBTOOL_VERSION).tar.gz 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
AUTOMAKE_VERSION=1.7.8 AUTOMAKE_VERSION=1.7.8
AUTOMAKE_URL=$(GNU)/automake/automake-$(AUTOMAKE_VERSION).tar.gz AUTOMAKE_URL=$(GNU)/automake/automake-$(AUTOMAKE_VERSION).tar.gz
PKGCFG_VERSION=0.15.0 PKGCFG_VERSION=0.15.0
......
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