Skip to content
Snippets Groups Projects
Commit 9fe4c751 authored by Claus-Justus Heine's avatar Claus-Justus Heine
Browse files

Defaults default to libdir and includedir

parent b7bb02cf
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment