summaryrefslogtreecommitdiff
path: root/configure.in
blob: b797a9a2984b06980c26fbb2fca520a9d9e5d88a (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
dnl Process this file with autoconf to produce a configure script.
AC_INIT([libpwquality], [0.9])
AM_INIT_AUTOMAKE([-Wall])
AC_PREREQ(2.61)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST

dnl LT Version numbers, remember to change them *before* a release.
dnl   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
dnl   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
dnl   (No interfaces changed:                   REVISION++)
PWQUALITY_LT_CURRENT=1
PWQUALITY_LT_AGE=0
PWQUALITY_LT_REVISION=0

AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PWQUALITY_LT_CURRENT)
AC_SUBST(PWQUALITY_LT_AGE)
AC_SUBST(PWQUALITY_LT_REVISION)

dnl Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL

dnl and some hacks to use /etc
test "${prefix}" = "NONE" && prefix="/usr"
if test ${prefix} = '/usr'
then
dnl If we use /usr as prefix, use /etc for config files
        if test ${sysconfdir} = '${prefix}/etc'
        then
                sysconfdir="/etc"
        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 Localization support
AM_GNU_GETTEXT_VERSION
AM_GNU_GETTEXT([external])
AC_CHECK_FUNCS(dngettext)
AH_BOTTOM([#ifdef ENABLE_NLS
#include <libintl.h>
#define _(msgid) dgettext(PACKAGE, msgid)
#define N_(msgid) msgid
#else   
#define _(msgid) (msgid)
#define N_(msgid) msgid
#endif /* ENABLE_NLS */])

dnl Library version scripts

dnl For some systems we know that we have ld_version scripts.
dnl Use it then as default.
have_ld_version_script=no
case "${host}" in
    *-*-linux*)
        have_ld_version_script=yes
        ;;
    *-*-gnu*)
        have_ld_version_script=yes
        ;;
esac
AC_ARG_ENABLE([ld-version-script],
              AC_HELP_STRING([--enable-ld-version-script],
                             [enable/disable use of linker version script.
                              (default is system dependent)]),
              [have_ld_version_script=$enableval],
              [ : ] )
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")

AC_ARG_WITH(securedir,
        AS_HELP_STRING([--with-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
        SECUREDIR=$withval, SECUREDIR=$libdir/security)
AC_SUBST(SECUREDIR)

AC_ARG_WITH(sconfigdir,
	AS_HELP_STRING([--with-sconfigdir=DIR],[path to PAM conf files @<:@default=$sysconfdir/security@:>@]),
	SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
AC_SUBST(SCONFIGDIR)

dnl options and defaults

dnl Check for cracklib
AC_CHECK_HEADERS([crack.h],
      AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
if test x$LIBCRACK = xno ; then
    AC_MSG_ERROR([No or unusable cracklib library])
fi
AC_SUBST(LIBCRACK)

AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes)],[use specified random device instead of /dev/urandom]), opt_randomdev=$withval)
if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
       opt_randomdev="/dev/urandom"
fi
AC_DEFINE_UNQUOTED(CONF_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.])

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST

dnl Checks for library functions.
AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol)

dnl Files to be created from when we run configure
AC_CONFIG_FILES([Makefile libpwquality.spec src/Makefile po/Makefile.in])
AC_OUTPUT