summaryrefslogtreecommitdiff
path: root/cracklib/configure.in
blob: e31a8dc47666d4e0bfc8478fd129578cf743fcd5 (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
dnl Process this file with autoconf to produce a configure script.
AC_INIT([lib/crack.h])
AM_INIT_AUTOMAKE(cracklib, 2.8.23)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])

dnl Set of available languages.
ALL_LINGUAS="as bn_IN cs da de el es fi fr gu hi hu it ja kn ko lt nb nl ml mr or pa pl pt_BR pt ru sl_SI sk ta te tr uk zh_CN zh_TW"

dnl Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AC_PATH_XTRA

AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(inttypes.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(zlib.h, AC_DEFINE(HAVE_ZLIB_H, [], [found zlib]))

AC_SEARCH_LIBS(gzopen, z)

dnl Cygwin workaround
AC_MSG_CHECKING(if LINE_MAX is defined)
AC_EGREP_CPP(yes,
[#include <limits.h>
#ifdef LINE_MAX
yes
#endif
], line_max_defined=yes, line_max_defined=no)
AC_MSG_RESULT($line_max_defined)

if test "$line_max_defined" = "no"; then
   CFLAGS="$CFLAGS -DLINE_MAX=2048"
fi

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

dnl Check for utility functions that may need to be replaced
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(getpwuid_r)

dnl internationalization macros
AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])

dnl Control default dictname
AC_MSG_CHECKING(default dict filename)
AC_ARG_WITH(default-dict,
AC_HELP_STRING(--with-default-dict,[Specify default dict filename]),
default_cracklib_dict=$withval,
default_cracklib_dict='$(pkgdatadir)/pw_dict')
AC_SUBST(DEFAULT_CRACKLIB_DICT, $default_cracklib_dict)
AC_MSG_RESULT($default_cracklib_dict)

dnl Check for python, unless we were told to not try to build a python module
AC_ARG_WITH(python,
AC_HELP_STRING(--without-python,[Build a python module @<:@default=auto@:>@]),
build_python=$withval,build_python=auto)
if test "$build_python" != no ; then
   AM_PATH_PYTHON(,,
                  [if test "$build_python" != yes ; then
                      AC_MSG_WARN([python was not found, continuing])
                      build_python=no
                   else
                      AC_MSG_ERROR([python was required but not found])
                   fi])
   if test "$build_python" != no ; then
      AC_CHECK_HEADERS(python${PYTHON_VERSION}/Python.h,,
		       [if test "$build_python" != yes ; then
		           AC_MSG_WARN([python headers not found, continuing])
			   build_python=no
			else
		           AC_MSG_ERROR([python headers not found])
			fi])
   fi
   if test "$build_python" != no ; then
      build_python=yes
   fi
fi
AM_CONDITIONAL(BUILD_PYTHON,[test "$build_python" = "yes"])

dnl Handle local dict compiling properly
AC_SUBST(CROSS_COMPILING, $cross_compiling)

AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \
		python/setup.py \
		po/Makefile.in m4/Makefile dicts/Makefile cracklib.spec)