File: configure.in

package info (click to toggle)
libpam-unix2 1%3A2.4.1-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,860 kB
  • ctags: 185
  • sloc: sh: 4,637; ansic: 3,308; makefile: 105; sed: 16
file content (102 lines) | stat: -rw-r--r-- 2,966 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
dnl Process this file with autoconf to produce a configure script.
AC_INIT(pam_unix2, 2.4.1, http://www.suse.de/feedback, pam_unix2)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/support.c])
AM_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(/usr)

dnl Set of available languages.

dnl Some hacks for correct paths ...
test "${prefix}" = "NONE" && prefix="/usr"
if test ${prefix} = '/usr'
then
dnl If we use /usr as prefix, use /etc for sysconfdir
        if test ${sysconfdir} = '${prefix}/etc'
        then
           sysconfdir="/etc"
        fi
dnl Change libdir to /lib
	if test ${libdir} = '${exec_prefix}/lib'
	then
	  libdir='/lib'
	fi
dnl If we use /usr as prefix, use /usr/share/man for manual pages
        if test ${mandir} = '${prefix}/man'
        then
           mandir='${prefix}/share/man'
        fi
fi

dnl Try to set usefull CFLAGS
test "$CFLAGS" = "" && CFLAGS="-O2 -Wall"
CFLAGS="$CFLAGS -fPIC -DPIC"

dnl Check for programs
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_INSTALL

AC_GNU_SOURCE

AC_SEARCH_LIBS(crypt, xcrypt crypt)
AC_CHECK_LIB(dl, dlerror)
AC_CHECK_LIB(nsl, yp_get_default_domain)
AC_CHECK_LIB(pam, pam_start)

dnl Should we compile with SELinux support? default: yes
AC_ARG_ENABLE([selinux],
   AC_HELP_STRING([--disable-selinux],[Enable SELinux support (default=yes)]),
   WITH_SELINUX=$enableval, WITH_SELINUX=yes)
if test "$WITH_SELINUX" == "yes" ; then
   AC_CHECK_LIB(selinux,is_selinux_enabled,
        [AC_DEFINE(WITH_SELINUX,1,
                [Define if you want to compile in SELinux support])
         LIBS="$LIBS -lselinux"])
fi

dnl Check standard headers
AC_HEADER_STDC
AC_CHECK_HEADERS(xcrypt.h crypt.h)
AC_CHECK_HEADERS(stdlib.h pwd.h sys/types.h syslog.h sys/syslog.h string.h strings.h, , AC_MSG_ERROR(some basic headers are missing))
AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h, , AC_MSG_ERROR(broken libpam installation))

dnl Check for Linux-PAM 0.99.x
AC_CHECK_HEADERS(security/pam_ext.h)
AC_CHECK_FUNCS(pam_vprompt pam_prompt pam_syslog)

AC_CHECK_HEADERS([sys/xattr.h attr/xattr.h],[break])
if test x$ac_cv_header_attr_xattr_h = xyes
then
  AC_CHECK_LIB(attr, main)
fi
AC_CHECK_FUNCS(llistxattr lgetxattr lsetxattr)

dnl Various function checking
AC_CHECK_FUNCS(fprintf snprintf syslog strncmp, , AC_MSG_ERROR(some basic C functions cannot be found))
AC_CHECK_FUNCS(getline getdelim)

dnl Function check for blowfish crypt
AC_CHECK_FUNCS(crypt crypt_r crypt_rn crypt_gensalt_rn bigcrypt)

dnl Check against -G linker flag
hold_ldflags=$LDFLAGS
AC_MSG_CHECKING(for the ld -shared flag)
LDFLAGS="${LDFLAGS} -shared"
AC_TRY_LINK([#include <stdio.h>], [void blahblah(){fprintf(stderr, "");}],
found=yes, found=no)
LDFLAGS=$hold_ldflags
AC_MSG_RESULT($found)
if test "$found" = "yes"; then
  LDFLAGS="${LDFLAGS} -shared"
else
  LDFLAGS="${LDFLAGS} -G"
fi

AM_GNU_GETTEXT_VERSION
AM_GNU_GETTEXT([external])

AC_SUBST(LIBPAM)

AC_OUTPUT([doc/Makefile etc/Makefile src/Makefile Makefile po/Makefile.in
	m4/Makefile])