[vlc-commits] Detect new contrib and pass path through --with-contrib
Rémi Denis-Courmont
git at videolan.org
Mon Aug 1 17:22:56 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 1 14:37:49 2011 +0300| [3458cafb0dda161aa9845c172db9b116cbdda1ad] | committer: Rémi Denis-Courmont
Detect new contrib and pass path through --with-contrib
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3458cafb0dda161aa9845c172db9b116cbdda1ad
---
configure.ac | 106 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 65 insertions(+), 41 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3d87a9b..bec69a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,52 +104,76 @@ dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
- [AS_HELP_STRING([--without-contrib],
- [do not use the libraries in CONTRIB_DIR])])
-AC_ARG_VAR([CONTRIB_DIR], [directory containing pre-built contrib, overriding extras/contrib])
-AS_IF([test "${with_contrib}" != "no"],[
- AS_IF([test -z "$CONTRIB_DIR"], [
- topdir="`dirname $0`"
- if test "`echo \"$topdir\" | cut -c 1`" != "/"; then
- topdir="`pwd`/$topdir"
- fi
- CONTRIB_DIR="${topdir}/extras/contrib/hosts/${host}"
- if ! test -d "$CONTRIB_DIR"
- then
- gccmachine=`$CC -dumpmachine`
- CONTRIB_DIR="${topdir}/extras/contrib/hosts/${gccmachine}"
- fi
+ [AS_HELP_STRING([--with-contrib[=DIR]],
+ [search for 3rd party libraries in DIR/include and DIR/lib])
+])
+AC_MSG_CHECKING([for 3rd party libraries path])
+AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
+ CONTRIB_DIR="${srcdir}/contrib/hosts/${host}"
+ AS_IF([test ! -d "${CONTRIB_DIR}"], [
+ echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+ CONTRIB_DIR="${srcdir}/contrib/hosts/`$CC -dumpmachine`"
+ AS_IF([test ! -d "${CONTRIB_DIR}"], [
+ echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+ CONTRIB_DIR="${srcdir}/extras/contrib/hosts/${host}"
+ AS_IF([test ! -d "${CONTRIB_DIR}"], [
+ echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+ CONTRIB_DIR="${srcdir}/extras/contrib/hosts/`$CC -dumpmachine`"
+ AS_IF([test ! -d "${CONTRIB_DIR}"], [
+ echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
+ CONTRIB_DIR=""
+ AC_MSG_RESULT([not found])
+ ])
+ ])
+ ])
])
- AC_MSG_CHECKING([for libs in ${CONTRIB_DIR}])
+], [
+ AS_IF([test "${with_contrib}" != "no"], [
+ CONTRIB_DIR="${with_contrib}"
+ ], [
+ CONTRIB_DIR=""
+ AC_MSG_RESULT([disabled])
+ ])
+])
+AS_IF([test -n "${CONTRIB_DIR}"], [
AS_IF([test -d "${CONTRIB_DIR}/lib"],[
- AC_MSG_RESULT([yes])
- AC_SUBST(CONTRIB_DIR)
- export PATH=${CONTRIB_DIR}/bin:$PATH
- CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
- CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
- CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
- CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
- CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
- CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
- OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
- OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
- if test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"; then
- export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
- else
- export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
- fi
- LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
- LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
-
- if test "${SYS}" = "darwin"; then
- export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
- export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
- fi
- ],[
- AC_MSG_RESULT([no])
+ CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
+ ], [
+ echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
+ AC_MSG_RESULT([not usable])
+ ])
+
+])
+AS_IF([test -n "${CONTRIB_DIR}"], [
+ AC_MSG_RESULT([${CONTRIB_DIR}])
+ export PATH=${CONTRIB_DIR}/bin:$PATH
+ CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
+ CPPFLAGS_save="${CPPFLAGS_save} -I${CONTRIB_DIR}/include"
+ CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
+ CFLAGS_save="${CFLAGS_save} -I${CONTRIB_DIR}/include"
+ CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
+ CXXFLAGS_save="${CXXFLAGS_save} -I${CONTRIB_DIR}/include"
+ OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
+ OBJCFLAGS_save="${OBJCFLAGS_save} -I${CONTRIB_DIR}/include"
+ AS_IF([test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"], [
+ export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
+ ], [
+ export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
+ ])
+ LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
+ LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
+
+ AS_IF([test "${SYS}" = "darwin"], [
+ export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
+ export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
+ ])
+], [
+ AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
+ AC_MSG_ERROR([Third party libraries not found!])
])
])
+AC_SUBST(CONTRIB_DIR)
dnl
dnl Set default values
More information about the vlc-commits
mailing list