File: configure.ac

package info (click to toggle)
libpwquality 1.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,056 kB
  • sloc: sh: 4,892; ansic: 2,051; makefile: 100; python: 30; sed: 16
file content (169 lines) | stat: -rw-r--r-- 5,669 bytes parent folder | download
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
dnl Process this file with autoconf to produce a configure script.
AC_INIT([libpwquality], [1.4.0])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip -Wall])
AC_PREREQ(2.61)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST

dnl We don't build with srcdir != builddir at present; the Python
dnl bindings fail
echo \#buildapi-variable-no-builddir > /dev/null

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=2

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
AM_PROG_AR
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([0.18.2])
AM_GNU_GETTEXT([external])
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")

dnl PAM support
PAM_LIBS=
AC_ARG_ENABLE([pam],
  AS_HELP_STRING([--enable-pam],[build PAM module @<:@default=check@:>@]),
  [],
  [enable_pam=check])
if test "$enable_pam" != "no"; then
  if test "$enable_pam" = "check"; then
      AC_CHECK_LIB([pam], [pam_start], [enable_pam=yes], [enable_pam=no])
  else
      fail=0
      AC_CHECK_LIB([pam], [pam_start], [], [fail=1])
      test $fail = 1 &&
        AC_MSG_ERROR([You must install the PAM development package in order to compile libpwquality])
  fi
fi

if test "$enable_pam" = "yes"; then
  PAM_LIBS="${PAM_LIBS} -lpam"
fi
AC_SUBST(PAM_LIBS)
AM_CONDITIONAL(HAVE_PAM, test "$enable_pam" = "yes")

dnl options and defaults
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)

AC_ARG_ENABLE([python-bindings],
              AC_HELP_STRING([--enable-python-bindings],
                             [enable Python bindings (default: yes)]),
              [enable_python_bindings=$enableval],
              enable_python_bindings=yes)
AM_CONDITIONAL(BUILD_PYTHON_BINDINGS, test x"$enable_python_bindings" = xyes)

AC_ARG_WITH(python-binary,
            [  --with-python-binary=python3    python binary name with which modules should be built],
            PYTHONBINARY=$withval, [PYTHONBINARY=python])
AC_SUBST(PYTHONBINARY)

AC_ARG_WITH(python-rev,
            [  --with-python-rev=2.7    version of python for which modules should be built],
            PYTHONREV=$withval,[
            AC_MSG_CHECKING([python version])
            [PYTHONREV=`$PYTHONBINARY -c "import sys;sys.stdout.write('%s.%s' % (sys.version_info[0], sys.version_info[1]))"`]
            AC_MSG_RESULT($PYTHONREV)
            ])
AC_SUBST(PYTHONREV)

AC_ARG_WITH(pythonsitedir,
            [  --with-pythonsitedir=DIR    directory of the python site packages @<:@default=$libdir/python$PYTHONREV/site-packages@:>@],
            PYTHONSITEDIR=$withval,[
            AC_MSG_CHECKING([python site directory])
            [PYTHONSITEDIR=$libdir/python$PYTHONREV/site-packages]
            AC_MSG_RESULT($PYTHONSITEDIR)
            ])
AC_SUBST(PYTHONSITEDIR)

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 Check for cracklib
AC_CHECK_HEADERS([crack.h],
      AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
if test x$LIBCRACK = x ; then
    AC_MSG_ERROR([No or unusable cracklib library])
fi
AC_SUBST([LIBCRACK])

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

dnl Files to be created from when we run configure
AC_CONFIG_FILES([Makefile libpwquality.spec src/Makefile src/pwquality.pc po/Makefile.in python/Makefile
                 doc/Makefile doc/man/Makefile python/setup.py])
AC_OUTPUT