File: configure.in

package info (click to toggle)
libpam-ccreds 10-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 644 kB
  • sloc: sh: 2,981; ansic: 2,066; makefile: 60
file content (83 lines) | stat: -rw-r--r-- 3,258 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
AC_INIT(cc_lib.c)
AC_CANONICAL_SYSTEM
AC_PREFIX_DEFAULT()

AM_INIT_AUTOMAKE(pam_ccreds, 10)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

AC_DEFINE_UNQUOTED(CCREDS_FILE, "/var/cache/.security.db", [Credentials cache file])
AC_DEFINE_UNQUOTED(CCREDS_VALIDATE, "/sbin/ccreds_chkpwd", [Verify password with this program])

AC_ARG_WITH(openssl-dir, [  --with-openssl-dir=DIR  base directory of OpenSSL library])
AC_ARG_WITH(ccreds-file, [  --with-ccreds-file=PATH path to cached credentials file], [AC_DEFINE_UNQUOTED(CCREDS_FILE, "$with_ccreds_file")])
AC_ARG_ENABLE(gcrypt, [  --enable-gcrypt build with gnuTLS (gcrypt) instead of OpenSSL], [use_gcrypt=yes])

if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -Wall -fPIC"; fi

case "$target_os" in
freebsd*) CPPFLAGS="$CPPFLAGS -DPIC -D_REENTRANT" ;;
aix*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
esac

case "$target_os" in
aix*) pam_ccreds_so_LD="ld"
  pam_ccreds_so_LDFLAGS="-bM:SRE -bnoentry -bE:\$(srcdir)/exports.aix"
  TARGET_OS="AIX" ;;
darwin*) pam_ccreds_so_LDFLAGS="-bundle" ;;
hpux*) pam_ccreds_so_LD="/bin/ld"
  pam_ccreds_so_LDFLAGS="-b -dynamic -G `cat exports.hpux`"
  TARGET_OS="HPUX" ;;
solaris*) pam_ccreds_so_LD="/usr/ccs/bin/ld"
  pam_ccreds_so_LDFLAGS="-B dynamic -M \$(srcdir)/exports.solaris -G -B group -lc" ;;
linux*) pam_ccreds_so_LDFLAGS="-shared -Wl,-Bdynamic -Wl,--version-script,\$(srcdir)/exports.linux" ;;
*) pam_ccreds_so_LDFLAGS="-shared" ;;
esac

AC_SUBST(pam_ccreds_so_LD)
AC_SUBST(pam_ccreds_so_LDFLAGS)

AM_CONDITIONAL(USE_NATIVE_LINKER, test -n "$pam_ccreds_so_LD")
AM_CONDITIONAL(EXTENSION_SO, test "$target_os" = "linux" -o "$target_os" = "linux-gnu")
AM_CONDITIONAL(EXTENSION_1, test "$TARGET_OS" = "HPUX")

if test -z "$use_gcrypt"; then
  if test -n "$with_openssl_dir"; then
    CPPFLAGS="$CPPFLAGS -I$with_openssl_dir/include"
    LDFLAGS="$LDFLAGS -L$with_openssl_dir/lib"
    case "$target_os" in  
    aix*) LDFLAGS="$LDFLAGS -Wl,-brtl -Wl,-blibpath:$with_openssl_dir/lib"
      pam_ccreds_so_LDFLAGS="$pam_ccreds_so_LDFLAGS -L$with_openssl_dir/lib -brtl -blibpath:$with_openssl_dir/lib" ;;
    hpux*) LDFLAGS="$LDFLAGS -Wl,+b$with_openssl_dir/lib"
      pam_ccreds_so_LDFLAGS="$pam_ccreds_so_LDFLAGS -L$with_openssl_dir/lib +b$with_openssl_dir/lib" ;;
    solaris*) LDFLAGS="$LDFLAGS -R$with_openssl_dir/lib" 
      pam_ccreds_so_LDFLAGS="$pam_ccreds_so_LDFLAGS -L$with_openssl_dir/lib -R$with_openssl_dir/lib" ;;
    *) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_openssl_dir/lib" ;;
    esac  
  fi
  AC_CHECK_HEADERS(openssl/opensslconf.h, , AC_MSG_ERROR(could not locate <openssl/opensslconf.h>))
  AC_CHECK_LIB(crypto, SHA1_Init,[LIBS="-lcrypto $LIBS"],,$LIBS)
else
  AM_PATH_LIBGCRYPT(1.2.0,:, AC_MSG_ERROR(could not locate gcrypt library))
fi

AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h security/pam_modules.h)
AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h pam/pam_modules.h)

AC_CHECK_HEADERS(db.h)

AC_CHECK_LIB(db, main,[LIBS="-ldb $LIBS" found_db_lib=yes],,$LIBS)
if test -z "$found_db_lib"; then
	AC_CHECK_LIB(db1, main,[LIBS="-ldb1 $LIBS" found_db_lib=yes],,$LIBS)
fi

AC_CHECK_LIB(pam, pam_start)
AC_CHECK_LIB(pam_misc, misc_conv)

AC_OUTPUT(Makefile)