From 9fe4c751acb33b9b1dfdb9003cfa74c9ad6bef1b Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine <Claus-Justus.Heine@IANS.Uni-Stuttgart.DE> Date: Sat, 14 Jun 2003 18:44:00 +0000 Subject: [PATCH] Defaults default to libdir and includedir --- m4/check-package.m4 | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/m4/check-package.m4 b/m4/check-package.m4 index 174e6a8..3330f3d 100644 --- a/m4/check-package.m4 +++ b/m4/check-package.m4 @@ -9,12 +9,19 @@ dnl $2: library name (base name, lib$2[.so|.a] dnl $3: library path (-L$3) dnl $4: additional libraries needed (e.g. -lm -lGL) dnl $5: header name -dnl $6: include path (-I$6 +dnl $6: include path (-I$6) dnl $7 \in \{optional, required\}, bail out if required, warning otherwise dnl AC_DEFUN(ALBERT_CHECK_PKG, -[AC_ARG_WITH($1-lib, -[ --with-$1-lib=DIR use $1 library below directory DIR (default: $3)], +[AC_REQUIRE([AC_SET_PREFIX]) +if test -z "$3"; then + DEFAULT_LIBDIR=${libdir} +else + DEFAULT_LIBDIR=$3 +fi +AC_ARG_WITH($1-lib, +[ --with-$1-lib=DIR use $1 library below directory DIR + (default: $DEFAULT_LIBDIR)], [case "$withval" in yes) AC_MSG_ERROR("option \"--with-$1-lib\" requires an argument") ;; @@ -23,10 +30,18 @@ AC_DEFUN(ALBERT_CHECK_PKG, *) $1_DIR=$withval ;; esac], -$1_DIR=$3) +$1_DIR=$DEFAULT_LIBDIR) +dnl +dnl now for the header file +dnl +if test -z "$6"; then + DEFAULT_INCDIR=${libdir} +else + DEFAULT_INCDIR=$6 +fi AC_ARG_WITH($1-headers, [ --with-$1-headers=DIR use $1 include files below directory DIR - (default: $6)], + (default: $DEFAULT_INCDIR)], [case "$withval" in yes) AC_MSG_ERROR("option \"--with-$1-headers\" requires an argument") ;; @@ -35,7 +50,7 @@ AC_ARG_WITH($1-headers, *) $1_INCS=$withval ;; esac], -$1_INCLUDES=$6) +$1_INCLUDES=$DEFAULT_INCDIR) dnl dnl now check if the library and header files exist dnl -- GitLab