1 dnl Autoconf macros for libntlm
2 dnl Copyright (C) 2002 Free Software Foundation, Inc.
4 dnl This file is free software; as a special exception the author gives
5 dnl unlimited permission to copy and/or distribute it, with or without
6 dnl modifications, as long as this notice is preserved.
8 dnl This file is distributed in the hope that it will be useful, but
9 dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10 dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 dnl AM_PATH_LIBNTLM([MINIMUM-VERSION,
14 dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
15 dnl Test for liblibntlm and define LIBNTLM_CFLAGS and LIBNTLM_LIBS
17 AC_DEFUN(AM_PATH_LIBNTLM,
18 [ AC_ARG_WITH(libntlm-prefix,
19 AC_HELP_STRING([--with-libntlm-prefix=PFX],
20 [prefix where LIBNTLM is installed (optional)]),
21 libntlm_config_prefix="$withval", libntlm_config_prefix="")
22 if test x$libntlm_config_prefix != x ; then
23 libntlm_config_args="$libntlm_config_args --prefix=$libntlm_config_prefix"
24 if test x${LIBNTLM_CONFIG+set} != xset ; then
25 LIBNTLM_CONFIG=$libntlm_config_prefix/bin/libntlm-config
29 AC_PATH_PROG(LIBNTLM_CONFIG, libntlm-config, no)
30 min_libntlm_version=ifelse([$1], ,0.3.0,$1)
31 AC_MSG_CHECKING(for LIBNTLM - version >= $min_libntlm_version)
33 if test "$LIBNTLM_CONFIG" != "no" ; then
34 req_major=`echo $min_libntlm_version | \
35 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
36 req_minor=`echo $min_libntlm_version | \
37 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
38 req_micro=`echo $min_libntlm_version | \
39 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
40 libntlm_config_version=`$LIBNTLM_CONFIG $libntlm_config_args --version`
41 major=`echo $libntlm_config_version | \
42 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
43 minor=`echo $libntlm_config_version | \
44 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
45 micro=`echo $libntlm_config_version | \
46 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
47 if test "$major" -gt "$req_major"; then
50 if test "$major" -eq "$req_major"; then
51 if test "$minor" -gt "$req_minor"; then
54 if test "$minor" -eq "$req_minor"; then
55 if test "$micro" -ge "$req_micro"; then
63 if test $ok = yes; then
64 LIBNTLM_CFLAGS=`$LIBNTLM_CONFIG $libntlm_config_args --cflags`
65 LIBNTLM_LIBS=`$LIBNTLM_CONFIG $libntlm_config_args --libs`
67 ifelse([$2], , :, [$2])
72 ifelse([$3], , :, [$3])
74 AC_SUBST(LIBNTLM_CFLAGS)
75 AC_SUBST(LIBNTLM_LIBS)