Commit 26920341 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf Committed by Hugo Beauzée-Luyssen

Port the VLC contrib buildsystem

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent fe2f0d60
#! /bin/sh
# Copyright (C) 2003-2011 the VideoLAN team
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
# Command line handling
#
usage()
{
echo "Usage: $0 [--build=BUILD] [--host=HOST] [--prefix=PREFIX]"
echo " --build=BUILD configure for building on BUILD"
echo " --host=HOST cross-compile to build to run on HOST"
echo " --prefix=PREFIX install files in PREFIX"
echo " --disable-FOO configure to not build package FOO"
echo " --enable-FOO configure to build package FOO"
echo " --disable-disc configure to not build optical discs packages"
echo " --disable-net configure to not build networking packages"
echo " --disable-sout configure to not build stream output packages"
echo " --enable-small optimize libraries for size with slight speed decrease [DANGEROUS]"
echo " --disable-gpl configure to not build viral GPL code"
echo " --disable-optim disable optimization in libraries"
}
BUILD=
HOST=
PREFIX=
PKGS_ENABLE=
PKGS_DISABLE=
BUILD_ENCODERS="1"
BUILD_NETWORK="1"
BUILD_DISCS="1"
GPL="1"
WITH_OPTIMIZATION="1"
if test ! -f "../../contribs/src/main.mak"
then
echo "$0 must be run from a subdirectory"
exit 1
fi
while test -n "$1"
do
case "$1" in
--build=*)
BUILD="${1#--build=}"
;;
--help|-h)
usage
exit 0
;;
--host=*)
HOST="${1#--host=}"
;;
--prefix=*)
PREFIX="${1#--prefix=}"
;;
--disable-disc)
BUILD_DISCS=
;;
--disable-net)
BUILD_NETWORK=
;;
--disable-sout)
BUILD_ENCODERS=
;;
--disable-optim)
WITH_OPTIMIZATION=
;;
--enable-small)
ENABLE_SMALL=1
;;
--disable-gpl)
GPL=
;;
--disable-*)
PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
;;
--enable-*)
PKGS_ENABLE="${PKGS_ENABLE} ${1#--enable-}"
;;
*)
echo "Unrecognized options $1"
usage
exit 1
;;
esac
shift
done
if test -z "$BUILD"
then
echo -n "Guessing build system... "
BUILD="`${CC:-cc} -dumpmachine`"
if test -z "$BUILD"; then
echo "FAIL!"
exit 1
fi
echo "$BUILD"
fi
if test -z "$HOST"
then
echo -n "Guessing host system... "
HOST="$BUILD"
echo "$HOST"
fi
if test "$PREFIX"
then
# strip trailing slash
PREFIX="${PREFIX%/}"
fi
#
# Prepare files
#
echo "Creating configuration file... config.mak"
exec 3>config.mak || exit $?
cat >&3 << EOF
# This file was automatically generated.
# Any change will be overwritten if ../bootstrap is run again.
BUILD := $BUILD
HOST := $HOST
PKGS_DISABLE := $PKGS_DISABLE
PKGS_ENABLE := $PKGS_ENABLE
EOF
add_make()
{
while test -n "$1"
do
echo "$1" >&3
shift
done
}
add_make_enabled()
{
while test -n "$1"
do
add_make "$1 := 1"
shift
done
}
check_ios_sdk()
{
if test "$VLCSDKROOT"
then
SDKROOT="$VLCSDKROOT"
else
if test -z "$SDKROOT"
then
SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
echo "SDKROOT not specified, assuming $SDKROOT"
else
SDKROOT="$SDKROOT"
fi
fi
if [ ! -d "${SDKROOT}" ]
then
echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
exit 1
fi
add_make "IOS_SDK=${SDKROOT}"
}
check_macosx_sdk()
{
if [ -z "${OSX_VERSION}" ]
then
OSX_VERSION=`xcrun --show-sdk-version`
echo "OSX_VERSION not specified, assuming $OSX_VERSION"
fi
if test -z "$SDKROOT"
then
SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
echo "SDKROOT not specified, assuming $SDKROOT"
fi
if [ ! -d "${SDKROOT}" ]
then
SDKROOT_NOT_FOUND=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
SDKROOT=`xcode-select -print-path`/SDKs/MacOSX$OSX_VERSION.sdk
echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
fi
if [ ! -d "${SDKROOT}" ]
then
SDKROOT_NOT_FOUND="$SDKROOT"
SDKROOT=`xcrun --show-sdk-path`
echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
fi
if [ ! -d "${SDKROOT}" ]
then
echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
exit 1
fi
add_make "MACOSX_SDK=${SDKROOT}"
add_make "OSX_VERSION ?= ${OSX_VERSION}"
}
check_android_sdk()
{
[ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
add_make "ANDROID_NDK := ${ANDROID_NDK}"
[ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
add_make "ANDROID_ABI := ${ANDROID_ABI}"
[ -z "${ANDROID_API}" ] && echo "You should set ANDROID_API environment variable (using default android-9)" && ANDROID_API := android-9
add_make "ANDROID_API := ${ANDROID_API}"
[ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_NEON"
[ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_ARMV7A"
[ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled "HAVE_NEON"
[ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled "HAVE_ARMV8A"
[ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled "HAVE_ARMV6"
}
check_tizen_sdk()
{
[ -z "${TIZEN_SDK}" ] && echo "You must set TIZEN_SDK environment variable" && exit 1
add_make "TIZEN_SDK := ${TIZEN_SDK}"
[ -z "${TIZEN_ABI}" ] && echo "You must set TIZEN_ABI environment variable" && exit 1
add_make "TIZEN_ABI := ${TIZEN_ABI}"
[ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled "HAVE_NEON"
[ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled "HAVE_ARMV7A"
}
test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
test -z "$BUILD_NETWORK" || add_make_enabled "BUILD_NETWORK"
test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
test -z "$GPL" || add_make_enabled "GPL"
test -z "$WITH_OPTIMIZATION" || add_make_enabled "WITH_OPTIMIZATION"
#
# Checks
#
OS="${HOST#*-}" # strip architecture
case "${OS}" in
*-darwin*)
if test -z "$BUILDFORIOS"
then
check_macosx_sdk
add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
else
check_ios_sdk
add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_FPU"
case "${HOST}" in
*arm*)
add_make_enabled "HAVE_NEON" "HAVE_ARMV7A"
;;
esac;
fi
if test "$BUILDFORTVOS"
then
add_make_enabled "HAVE_TVOS"
fi
;;
*bsd*)
add_make_enabled "HAVE_BSD"
;;
*android*)
check_android_sdk
add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
case "${HOST}" in
*arm*)
add_make "PLATFORM_SHORT_ARCH := arm"
;;
*arm64*|*aarch64*)
add_make "PLATFORM_SHORT_ARCH := arm64"
;;
*i686*)
add_make "PLATFORM_SHORT_ARCH := x86"
;;
*x86_64*)
add_make "PLATFORM_SHORT_ARCH := x86_64"
;;
*mipsel*)
add_make "PLATFORM_SHORT_ARCH := mips"
;;
esac
;;
*linux*)
if [ "`${CC} -v 2>&1 | grep tizen`" ]; then
check_tizen_sdk
add_make_enabled "HAVE_TIZEN"
case "${HOST}" in
*arm*)
add_make "PLATFORM_SHORT_ARCH := arm"
;;
*i386*)
add_make "PLATFORM_SHORT_ARCH := x86"
;;
esac
fi
add_make_enabled "HAVE_LINUX"
;;
*mingw*)
add_make_enabled "HAVE_WIN32"
case "${HOST}" in
*winphone*|*windowsphone*)
add_make_enabled "HAVE_WINDOWSPHONE"
;;
esac
case "${HOST}" in
*winphone*|*windowsphone*|*winrt*|*uwp*)
add_make_enabled "HAVE_WINSTORE"
;;
esac
case "${HOST}" in
amd64*|x86_64*)
add_make_enabled "HAVE_WIN64"
;;
esac
case "${HOST}" in
armv7*)
add_make_enabled "HAVE_ARMV7A"
;;
esac
;;
*solaris*)
add_make_enabled "HAVE_SOLARIS"
;;
esac
#
# Results output
#
test -e Makefile && unlink Makefile
ln -sf ../../contribs/src/main.mak Makefile || exit $?
echo "Bootstrap completed."
make help
mkdir -p ../../contribs/tarballs || exit $?
#!/bin/sh
# ***************************************************************************
# change_prefix.sh : allow to transfer a contrib dir
# ***************************************************************************
# Copyright © 2012 VideoLAN and its authors
#
# Authors: Rafaël Carré
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# ***************************************************************************
set -e
LANG=C
export LANG
if test "$1" = "-h" -o "$1" = "--help" -o $# -gt 2; then
echo "Usage: $0 [old prefix] [new prefix]
Without arguments, this script assumes old prefix = @@CONTRIB_PREFIX@@,
and new prefix = current directory.
"
fi
if [ $# != 2 ]
then
old_prefix=@@CONTRIB_PREFIX@@
new_prefix=`pwd`
else
old_prefix=$1
new_prefix=$2
fi
# process [dir] [filemask] [text only]
process() {
for file in `find $1 \( ! -name \`basename $1\` -o -type f \) -prune -type f -name "$2"`
do
if [ -n "$3" ]
then
file $file | sed "s/^.*: //" | grep -q 'text\|shell' || continue
fi
echo "Fixing up $file"
sed -i.orig -e "s,$old_prefix,$new_prefix,g" $file
rm -f $file.orig
done
}
process bin/ "*" check
process lib/ "*.la"
process lib/pkgconfig/ "*.pc"
#! /bin/sh
HOST="$1"
if test -z "$HOST"; then
echo "Usage: $0 <target machine>" >&2
exit 1
fi
case "$HOST" in
amd64-*)
ARCH="x86_64"
;;
i[3456]86-*|x86-*)
ARCH="i386"
;;
powerpc-*|ppc-*)
ARCH="ppc"
;;
powerpc64-*|ppc64-*)
ARCH="ppc64"
;;
*-*)
ARCH="${HOST%%-*}"
;;
*)
echo "$HOST: invalid machine specification" >&2
exit 1
esac
echo $ARCH
Run "make" to start compilation.
Other targets:
* make install same as "make"
* make prebuilt fetch and install prebuilt binaries
* make list list packages
* make fetch fetch required source tarballs
* make fetch-all fetch all source tarballs
* make distclean clean everything and undo bootstrap
* make mostlyclean clean everything except source tarballs
* make clean clean everything
* make package prepare prebuilt packages
* make help show this text
# Main makefile for VLC 3rd party libraries ("contrib")
# Copyright (C) 2003-2011 the VideoLAN team
#
# This file is under the same license as the vlc package.
all: install
# bootstrap configuration
include config.mak
TOPSRC ?= ../../contribs
TOPDST ?= ..
SRC := $(TOPSRC)/src
TARBALLS := $(TOPSRC)/tarballs
PATH :=$(abspath ../../extras/tools/build/bin):$(PATH)
export PATH
PKGS_ALL := $(patsubst $(SRC)/%/rules.mak,%,$(wildcard $(SRC)/*/rules.mak))
DATE := $(shell date +%Y%m%d)
VPATH := $(TARBALLS)
# Common download locations
GNU ?= http://ftp.gnu.org/gnu
SF := http://heanet.dl.sourceforge.net/sourceforge
VIDEOLAN := http://downloads.videolan.org/pub/videolan
CONTRIB_VIDEOLAN := http://downloads.videolan.org/pub/contrib
#
# Machine-dependent variables
#
PREFIX ?= $(TOPDST)/$(HOST)
PREFIX := $(abspath $(PREFIX))
ifneq ($(HOST),$(BUILD))
HAVE_CROSS_COMPILE = 1
endif
ARCH := $(shell $(SRC)/get-arch.sh $(HOST))
ifeq ($(ARCH)-$(HAVE_WIN32),x86_64-1)
HAVE_WIN64 := 1
endif
ifdef HAVE_CROSS_COMPILE
need_pkg = 1
else
need_pkg = $(shell $(PKG_CONFIG) $(1) || echo 1)
endif
#
# Default values for tools
#
ifndef HAVE_CROSS_COMPILE
ifneq ($(findstring $(origin CC),undefined default),)
CC := gcc
endif
ifneq ($(findstring $(origin CXX),undefined default),)
CXX := g++
endif
ifneq ($(findstring $(origin LD),undefined default),)
LD := ld
endif
ifneq ($(findstring $(origin AR),undefined default),)
AR := ar
endif
ifneq ($(findstring $(origin RANLIB),undefined default),)
RANLIB := ranlib
endif
ifneq ($(findstring $(origin STRIP),undefined default),)
STRIP := strip
endif
ifneq ($(findstring $(origin WIDL),undefined default),)
WIDL := widl
endif
else
ifneq ($(findstring $(origin CC),undefined default),)
CC := $(HOST)-gcc
endif
ifneq ($(findstring $(origin CXX),undefined default),)
CXX := $(HOST)-g++
endif
ifneq ($(findstring $(origin LD),undefined default),)
LD := $(HOST)-ld
endif
ifneq ($(findstring $(origin AR),undefined default),)
AR := $(HOST)-ar
endif
ifneq ($(findstring $(origin RANLIB),undefined default),)
RANLIB := $(HOST)-ranlib
endif
ifneq ($(findstring $(origin STRIP),undefined default),)
STRIP := $(HOST)-strip
endif
ifneq ($(findstring $(origin WIDL),undefined default),)
WIDL := $(HOST)-widl
endif
endif
ifdef HAVE_ANDROID
CC := $(HOST)-gcc --sysroot=$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)
CXX := $(HOST)-g++ --sysroot=$(ANDROID_NDK)/platforms/$(ANDROID_API)/arch-$(PLATFORM_SHORT_ARCH)
endif
ifdef HAVE_MACOSX
MIN_OSX_VERSION=10.7
CC=xcrun cc
CXX=xcrun c++
AR=xcrun ar
LD=xcrun ld
STRIP=xcrun strip
RANLIB=xcrun ranlib
EXTRA_CFLAGS += -isysroot $(MACOSX_SDK) -mmacosx-version-min=$(MIN_OSX_VERSION) -DMACOSX_DEPLOYMENT_TARGET=$(MIN_OSX_VERSION)
EXTRA_CXXFLAGS += -stdlib=libc++
EXTRA_LDFLAGS += -Wl,-syslibroot,$(MACOSX_SDK) -mmacosx-version-min=$(MIN_OSX_VERSION) -isysroot $(MACOSX_SDK) -DMACOSX_DEPLOYMENT_TARGET=$(MIN_OSX_VERSION)
ifeq ($(ARCH),x86_64)
EXTRA_CFLAGS += -m64
EXTRA_LDFLAGS += -m64
else
EXTRA_CFLAGS += -m32
EXTRA_LDFLAGS += -m32
endif
XCODE_FLAGS = -sdk macosx$(OSX_VERSION)
ifeq ($(shell xcodebuild -version 2>/dev/null | tee /dev/null|head -1|cut -d\ -f2|cut -d. -f1),3)
XCODE_FLAGS += ARCHS=$(ARCH)
# XCode 3 doesn't support -arch
else
XCODE_FLAGS += -arch $(ARCH)
endif
endif
CCAS=$(CC) -c
ifdef HAVE_IOS
CC=xcrun clang
CXX=xcrun clang++
ifdef HAVE_NEON
AS=perl $(abspath ../../extras/tools/build/bin/gas-preprocessor.pl) $(CC)
CCAS=gas-preprocessor.pl $(CC) -c
else
CCAS=$(CC) -c
endif
AR=xcrun ar
LD=xcrun ld
STRIP=xcrun strip
RANLIB=xcrun ranlib
EXTRA_CFLAGS += $(CFLAGS)
EXTRA_LDFLAGS += $(LDFLAGS)
endif
ifdef HAVE_WIN32
ifneq ($(shell $(CC) $(CFLAGS) -E -dM -include _mingw.h - < /dev/null | grep -E __MINGW64_VERSION_MAJOR),)
HAVE_MINGW_W64 := 1
endif
endif
ifdef HAVE_SOLARIS
ifeq ($(ARCH),x86_64)
EXTRA_CFLAGS += -m64
EXTRA_LDFLAGS += -m64
else
EXTRA_CFLAGS += -m32
EXTRA_LDFLAGS += -m32
endif
endif
cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
EXTRA_CFLAGS += -I$(PREFIX)/include
CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)
CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) -g
CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS) -g
EXTRA_LDFLAGS += -L$(PREFIX)/lib
LDFLAGS := $(LDFLAGS) $(EXTRA_LDFLAGS)
ifndef WITH_OPTIMIZATION
CFLAGS := $(CFLAGS) -O0
CXXFLAGS := $(CXXFLAGS) -O0
else
CFLAGS := $(CFLAGS) -O2
CXXFLAGS := $(CXXFLAGS) -O2
endif
# Do not export those! Use HOSTVARS.
# Do the FPU detection, after we have figured out our compilers and flags.
ifneq ($(findstring $(ARCH),aarch64 i386 ppc ppc64 sparc sparc64 x86_64),)
# This should be consistent with include/vlc_cpu.h
HAVE_FPU = 1
else ifneq ($(findstring $(ARCH),arm),)
ifneq ($(call cppcheck, __VFP_FP__)),)
ifeq ($(call cppcheck, __SOFTFP__),)
HAVE_FPU = 1
endif
endif
else ifneq ($(call cppcheck, __mips_hard_float),)
HAVE_FPU = 1
endif
ACLOCAL_AMFLAGS += -I$(PREFIX)/share/aclocal
export ACLOCAL_AMFLAGS
#########
# Tools #
#########
PKG_CONFIG ?= pkg-config
ifdef HAVE_CROSS_COMPILE
# This inhibits .pc file from within the cross-compilation toolchain sysroot.
# Hopefully, nobody ever needs that.
PKG_CONFIG_PATH := /usr/share/pkgconfig
PKG_CONFIG_LIBDIR := /usr/$(HOST)/lib/pkgconfig
export PKG_CONFIG_LIBDIR
endif
PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):$(PREFIX)/lib/pkgconfig
export PKG_CONFIG_PATH
ifndef GIT
ifeq ($(shell git --version >/dev/null 2>&1 || echo FAIL),)
GIT = git
endif
endif
GIT ?= $(error git not found!)
ifndef SVN
ifeq ($(shell svn --version >/dev/null 2>&1 || echo FAIL),)
SVN = svn
endif
endif
SVN ?= $(error subversion client (svn) not found!)
ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl -f -L -- "$(1)" > "$@"
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = (rm -f $@.tmp && \
wget --passive -c -p -O $@.tmp "$(1)" && \
touch $@.tmp && \
mv $@.tmp $@ )
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
download = (rm -f $@.tmp && \
fetch -p -o $@.tmp "$(1)" && \
touch $@.tmp && \
mv $@.tmp $@)
else
download = $(error Neither curl nor wget found!)
endif
download_pkg = $(call download,$(CONTRIB_VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) || \
( $(call download,$(1)) && echo "Please upload this package $(lastword $(subst /, ,$(@))) to our FTP" )
ifeq ($(shell which xzcat >/dev/null 2>&1 || echo FAIL),)
XZCAT = xzcat
else
XZCAT ?= $(error xz and lzma client not found!)
endif
ifeq ($(shell which bzcat >/dev/null 2>&1 || echo FAIL),)
BZCAT = bzcat
else
BZCAT ?= $(error Bunzip2 client (bzcat) not found!)
endif
ifeq ($(shell gzcat --version >/dev/null 2>&1 || echo FAIL),)
ZCAT = gzcat
else ifeq ($(shell zcat --version >/dev/null 2>&1 || echo FAIL),)
ZCAT = zcat
else
ZCAT ?= $(error Gunzip client (zcat) not found!)
endif
ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = sha512sum --check
else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = shasum -a 512 --check
else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = openssl dgst -sha512
else
SHA512SUM = $(error SHA-512 checksumming not found!)
endif
ifeq ($(shell protoc --version >/dev/null 2>&1 || echo FAIL),)
PROTOC = protoc
else
PROTOC ?= $(error Protobuf compiler (protoc) not found!)
endif
#
# Common helpers
#
HOSTCONF := --prefix="$(PREFIX)"
HOSTCONF += --datarootdir="$(PREFIX)/share"
HOSTCONF += --includedir="$(PREFIX)/include"
HOSTCONF += --libdir="$(PREFIX)/lib"
HOSTCONF += --build="$(BUILD)" --host="$(HOST)" --target="$(HOST)"
HOSTCONF += --program-prefix=""
# libtool stuff:
HOSTCONF += --enable-static --disable-shared --disable-dependency-tracking
ifdef HAVE_WIN32
HOSTCONF += --without-pic
PIC :=
else
HOSTCONF += --with-pic
PIC := -fPIC
endif
HOSTTOOLS := \
CC="$(CC)" CXX="$(CXX)" LD="$(LD)" \
AR="$(AR)" CCAS="$(CCAS)" RANLIB="$(RANLIB)" STRIP="$(STRIP)" \
PATH="$(PREFIX)/bin:$(PATH)"
HOSTVARS := $(HOSTTOOLS) \
CPPFLAGS="$(CPPFLAGS)" \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
LDFLAGS="$(LDFLAGS)"