Commit 701bf708 authored by David Flynn's avatar David Flynn Committed by Christophe Mutricy

build: Add CONTRIB_DIR variable, default is extras/contrib

If you build your contrib out of tree (somehow), then a way
is needed to say where it is:

 configure CONTRIB_DIR=wherever
Signed-off-by: default avatarDavid Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: default avatarChristophe Mutricy <xtophe@videolan.org>
parent c8a1d50d
...@@ -111,15 +111,20 @@ dnl ...@@ -111,15 +111,20 @@ dnl
dnl Check for the contrib directory dnl Check for the contrib directory
dnl dnl
AC_ARG_WITH(contrib, AC_ARG_WITH(contrib,
[ --without-contrib do not use the libraries in extras/contrib],[],[]) [ --without-contrib do not use the libraries in CONTRIB_DIR],[],[])
AS_IF([test "${with_contrib}" != "no"],[ AS_IF([test "${with_contrib}" != "no"],[
AC_MSG_CHECKING([for libs in extras/contrib]) AC_ARG_VAR([CONTRIB_DIR], [directory containing pre-built contrib, overriding extras/contrib])
topdir="`dirname $0`" if test -z "$CONTRIB_DIR"
if test "`echo \"$topdir\" | cut -c 1`" != "/"; then then
topdir="`pwd`/$topdir" topdir="`dirname $0`"
if test "`echo \"$topdir\" | cut -c 1`" != "/"; then
topdir="`pwd`/$topdir"
fi
CONTRIB_DIR=${topdir}/extras/contrib
fi fi
AS_IF([test -d ${topdir}/extras/contrib/lib],[ AC_MSG_CHECKING([for libs in ${CONTRIB_DIR}])
AS_IF([test "`grep HOST ${topdir}/extras/contrib/config.mak 2>/dev/null|awk '{print $3}'`" != "`$CC -dumpmachine`"],[ AS_IF([test -d ${CONTRIBDIR}/lib],[
AS_IF([test "`grep HOST ${CONTRIB_DIR}/config.mak 2>/dev/null|awk '{print $3}'`" != "`$CC -dumpmachine`"],[
if test "${with_contrib}" = "yes"; then if test "${with_contrib}" = "yes"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_MSG_ERROR([ not using the libs in extras/contrib as it is not the same host]) AC_MSG_ERROR([ not using the libs in extras/contrib as it is not the same host])
...@@ -129,36 +134,36 @@ AC_ARG_WITH(contrib, ...@@ -129,36 +134,36 @@ AC_ARG_WITH(contrib,
fi fi
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
export PATH=${topdir}/extras/contrib/bin:$PATH export PATH=${CONTRIBDIR}/bin:$PATH
CPPFLAGS="${CPPFLAGS} -I${topdir}/extras/contrib/include" CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
CPPFLAGS_save="${CPPFLAGS_save} -I${topdir}/extras/contrib/include" CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
CFLAGS="${CFLAGS} -I${topdir}/extras/contrib/include" CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CFLAGS_save="${CFLAGS_save} -I${topdir}/extras/contrib/include" CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${topdir}/extras/contrib/include" CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS_save="${CXXFLAGS_save} -I${topdir}/extras/contrib/include" CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${topdir}/extras/contrib/include" OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS_save="${OBJCFLAGS_save} -I${topdir}/extras/contrib/include" OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
if test $build = $host -o "$PKG_CONFIG_LIBDIR"; then if test $build = $host -o "$PKG_CONFIG_LIBDIR"; then
export PKG_CONFIG_PATH=${topdir}/extras/contrib/lib/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH
else else
export PKG_CONFIG_LIBDIR=${topdir}/extras/contrib/lib/pkgconfig export PKG_CONFIG_LIBDIR=${CONTRIB_DIR}/lib/pkgconfig
fi fi
LDFLAGS="${LDFLAGS} -L${topdir}/extras/contrib/lib" LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
LDFLAGS_save="${LDFLAGS_save} -L${topdir}/extras/contrib/lib" LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
if test -z $with_mozilla_sdk_path; then if test -z $with_mozilla_sdk_path; then
with_mozilla_sdk_path=${topdir}/extras/contrib/gecko-sdk with_mozilla_sdk_path=${CONTRIB_DIR}/gecko-sdk
fi fi
if test -z $with_cyberlink_tree; then if test -z $with_cyberlink_tree; then
with_cyberlink_tree=${topdir}/extras/contrib/src/clinkcc with_cyberlink_tree=${CONTRIB_DIR}/src/clinkcc
fi fi
if test ".`uname -s`" = ".Darwin"; then if test ".`uname -s`" = ".Darwin"; then
export LD_LIBRARY_PATH=${topdir}/extras/contrib/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${topdir}/extras/contrib/lib:$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH
elif test ".`uname -s`" = ".BeOS"; then elif test ".`uname -s`" = ".BeOS"; then
export LIBRARY_PATH=${topdir}/extras/contrib/lib:$LIBRARY_PATH export LIBRARY_PATH=${CONTRIB_DIR}/lib:$LIBRARY_PATH
export BELIBRARIES=${topdir}/extras/contrib/lib:$BELIBRARIES export BELIBRARIES=${CONTRIB_DIR}/lib:$BELIBRARIES
fi fi
]) ])
],[ ],[
......
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