Commit b9b7edc6 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

bootstrap: Use an abstraction for enabling setting in config.mak.

parent 733e0bbc
...@@ -48,6 +48,11 @@ add_makefile_cfg() ...@@ -48,6 +48,11 @@ add_makefile_cfg()
echo $1 >> "${config_mak}" echo $1 >> "${config_mak}"
} }
add_enabled_makefile_cfg()
{
echo "$1=1" >> "${config_mak}"
}
error() error()
{ {
echo "[contrib] ERROR: $1" echo "[contrib] ERROR: $1"
...@@ -183,17 +188,17 @@ add_makefile_cfg "ARCH = $ARCH" ...@@ -183,17 +188,17 @@ add_makefile_cfg "ARCH = $ARCH"
# Check the HAVE_{OS} # Check the HAVE_{OS}
case $TARGET in case $TARGET in
*darwin*) *darwin*)
add_makefile_cfg "HAVE_DARWIN_OS = 1" add_enabled_makefile_cfg "HAVE_DARWIN_OS"
add_makefile_cfg "HAVE_BSD = 1" add_enabled_makefile_cfg "HAVE_BSD"
;; ;;
*linux*) *linux*)
add_makefile_cfg "HAVE_LINUX = 1" add_enabled_makefile_cfg "HAVE_LINUX"
;; ;;
*bsd*) *bsd*)
add_makefile_cfg "HAVE_BSD = 1" add_enabled_makefile_cfg "HAVE_BSD"
;; ;;
*wince*) *wince*)
add_makefile_cfg "HAVE_WINCE = 1" add_enabled_makefile_cfg "HAVE_WINCE"
;; ;;
esac esac
...@@ -221,9 +226,9 @@ case $TARGET in ...@@ -221,9 +226,9 @@ case $TARGET in
CFLAGS_TUNING=" -march=prescott -mtune=generic -arch i386 -m32" CFLAGS_TUNING=" -march=prescott -mtune=generic -arch i386 -m32"
EXTRA_LDFLAGS=" -arch i386" EXTRA_LDFLAGS=" -arch i386"
add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1" add_enabled_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL"
if test $TARGET = "i686-apple-darwin10"; then if test $TARGET = "i686-apple-darwin10"; then
add_makefile_cfg "HAVE_DARWIN_10 = 1" add_enabled_makefile_cfg "HAVE_DARWIN_10"
fi fi
;; ;;
x86_64-apple-darwin*) x86_64-apple-darwin*)
...@@ -239,10 +244,10 @@ case $TARGET in ...@@ -239,10 +244,10 @@ case $TARGET in
AR="ar" AR="ar"
STRIP="strip" STRIP="strip"
add_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL = 1" add_enabled_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL"
add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin" add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin"
if test $TARGET = "x86_64-apple-darwin10"; then if test $TARGET = "x86_64-apple-darwin10"; then
add_makefile_cfg "HAVE_DARWIN_10 = 1" add_enabled_makefile_cfg "HAVE_DARWIN_10"
fi fi
;; ;;
*mingw32ce) *mingw32ce)
...@@ -251,7 +256,7 @@ case $TARGET in ...@@ -251,7 +256,7 @@ case $TARGET in
hint_distro wince hint_distro wince
;; ;;
*64-*mingw*) *64-*mingw*)
add_makefile_cfg "HAVE_WIN32 = 1" add_enabled_makefile_cfg "HAVE_WIN32"
add_makefile_cfg "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig" add_makefile_cfg "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig"
EXTRA_CFLAGS="-O3" EXTRA_CFLAGS="-O3"
hint_distro win64 hint_distro win64
...@@ -262,7 +267,7 @@ case $TARGET in ...@@ -262,7 +267,7 @@ case $TARGET in
hint_distro win32 hint_distro win32
;; ;;
i686-pc-cygwin) i686-pc-cygwin)
add_makefile_cfg "HAVE_CYGWIN = 1" add_enabled_makefile_cfg "HAVE_CYGWIN"
CC="gcc -mno-cygwin -isystem /usr/include/mingw" CC="gcc -mno-cygwin -isystem /usr/include/mingw"
CXX="g++ -mno-cygwin -isystem /usr/include/mingw" CXX="g++ -mno-cygwin -isystem /usr/include/mingw"
TARGET=`$CC -dumpmachine` TARGET=`$CC -dumpmachine`
...@@ -278,8 +283,8 @@ case $TARGET in ...@@ -278,8 +283,8 @@ case $TARGET in
hint_distro wince hint_distro wince
;; ;;
armeb-linux-uclibc) armeb-linux-uclibc)
add_makefile_cfg "HAVE_UCLIBC = 1" add_enabled_makefile_cfg "HAVE_UCLIBC"
add_makefile_cfg "HAVE_BIGENDIAN = 1" add_enabled_makefile_cfg "HAVE_BIGENDIAN"
EXTRA_CFLAGS="-Os -march=armv5 -msoft-float" EXTRA_CFLAGS="-Os -march=armv5 -msoft-float"
;; ;;
arm-none-linux-gnueabi) arm-none-linux-gnueabi)
...@@ -370,7 +375,7 @@ EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS $CPPFLAGS" ...@@ -370,7 +375,7 @@ EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS $CPPFLAGS"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CXXFLAGS" EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CXXFLAGS"
uppercase_distro=`echo "$DISTRO" | tr '[:lower:]' '[:upper:]'` uppercase_distro=`echo "$DISTRO" | tr '[:lower:]' '[:upper:]'`
add_makefile_cfg "HAVE_${uppercase_distro} = 1" add_enabled_makefile_cfg "HAVE_${uppercase_distro}"
add_makefile_cfg "BUILD = $BUILD" add_makefile_cfg "BUILD = $BUILD"
add_makefile_cfg "HOST = $TARGET" add_makefile_cfg "HOST = $TARGET"
add_makefile_cfg "SRCDIR = `pwd`" add_makefile_cfg "SRCDIR = `pwd`"
...@@ -435,14 +440,14 @@ if test -z "$CONTRIBS_RELEASE"; then ...@@ -435,14 +440,14 @@ if test -z "$CONTRIBS_RELEASE"; then
fi fi
if test $HAVE_DARWIN_9; then if test $HAVE_DARWIN_9; then
add_makefile_cfg "HAVE_DARWIN_9 = 1" add_enabled_makefile_cfg "HAVE_DARWIN_9"
if ! /usr/bin/gcc-4.2 --version>/dev/null 2>&1; then if ! /usr/bin/gcc-4.2 --version>/dev/null 2>&1; then
error "You do not have GCC-4.2 installed in /usr/bin, compilation WILL FAIL." error "You do not have GCC-4.2 installed in /usr/bin, compilation WILL FAIL."
fi fi
fi fi
if test $HAVE_DARWIN_32; then if test $HAVE_DARWIN_32; then
add_makefile_cfg "HAVE_DARWIN_32 = 1" add_enabled_makefile_cfg "HAVE_DARWIN_32"
info "*****************************************************************" info "*****************************************************************"
info "* VLC will be compiled in 32bit mode. *" info "* VLC will be compiled in 32bit mode. *"
info "* *" info "* *"
...@@ -454,7 +459,7 @@ if test $HAVE_DARWIN_32; then ...@@ -454,7 +459,7 @@ if test $HAVE_DARWIN_32; then
fi fi
if test $HAVE_DARWIN_64; then if test $HAVE_DARWIN_64; then
add_makefile_cfg "HAVE_DARWIN_64 = 1" add_enabled_makefile_cfg "HAVE_DARWIN_64"
info info
info "*****************************************************************" info "*****************************************************************"
info "* VLC will be compiled in 64bit mode using the 10.5 SDK. *" info "* VLC will be compiled in 64bit mode using the 10.5 SDK. *"
......
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