1 AC_DEFUN([AUTHORITY_INIT],
4 AC_SUBST(AUTHORITYLALIB)
6 AC_SUBST(AUTHORITYVERSION)
9 AC_ARG_WITH(auth, [ --with-auth=DIR use authority-config-0.0 in DIR (example /home/frbr-0.0)], [authpath=$withval])
10 if test "x$authpath" != "xNONE"; then
11 authconfig=$authpath/authority-config-0.0
13 if test "x$srcdir" = "x"; then
18 for i in ${authsrcdir}/../../frbr ${authsrcdir}/../frbr-* ${authsrcdir}/../frbr; do
20 if test -r $i/authority-config-0.0; then
21 authconfig=$i/authority-config-0.0
25 if test "x$authconfig" = "xNONE"; then
26 AC_PATH_PROG(authconfig, authority-config-0.0, NONE)
29 AC_MSG_CHECKING(for AUTHORITY)
30 if $authconfig --version >/dev/null 2>&1; then
31 AUTHORITYLIB=`$authconfig --libs $1`
32 AUTHORITYLALIB=`$authconfig --lalibs $1`
33 AUTHORITYINC=`$authconfig --cflags $1`
34 AUTHORITYVERSION=`$authconfig --version`
35 AC_MSG_RESULT([$authconfig])
37 AC_MSG_RESULT(Not found)
40 if test "X$AUTHORITYVERSION" != "XNONE"; then
41 AC_MSG_CHECKING([for AUTHORITY version])
42 AC_MSG_RESULT([$AUTHORITYVERSION])
44 have_auth_version=`echo "$AUTHORITYVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
45 req_auth_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`
46 if test "$have_auth_version" -lt "$req_auth_version"; then
47 AC_MSG_ERROR([$AUTHORITYVERSION. Requires AUTHORITY $2 or later])