source: trunk/configure.ac @ 60

Revision 60, 4.4 KB checked in by alonbl, 3 years ago (diff)

Add PACKAGE_SUFFIX

  • Property svn:keywords set to Author Date Id Revision
Line 
1
2AC_PREREQ(2.60)
3
4define([PACKAGE_VERSION_MAJOR], [0])
5define([PACKAGE_VERSION_MINOR], [1])
6define([PACKAGE_VERSION_FIX], [5])
7define([PACKAGE_SUFFIX], [-svn])
8
9AC_INIT([pam_p11],[PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX[]PACKAGE_SUFFIX])
10AC_CONFIG_AUX_DIR([.])
11AM_CONFIG_HEADER([config.h])
12AC_CONFIG_MACRO_DIR([m4])
13AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
14
15AC_CONFIG_SRCDIR([src/pam_p11.c])
16
17AC_CANONICAL_HOST
18AC_PROG_CC
19PKG_PROG_PKG_CONFIG
20AC_C_BIGENDIAN
21
22AC_MSG_CHECKING([svn checkout])
23if test -e "${srcdir}/packaged"; then
24        svn_checkout="no"
25else
26        svn_checkout="yes"
27fi
28AC_MSG_RESULT([${svn_checkout}])
29
30AC_ARG_ENABLE(
31        [strict],
32        [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@disabled@:>@])],
33        ,
34        [enable_strict="no"]
35)
36
37AC_ARG_ENABLE(
38        [pedantic],
39        [AS_HELP_STRING([--enable-pedantic],[enable pedantic compile mode @<:@disabled@:>@])],
40        ,
41        [enable_pedantic="no"]
42)
43
44AC_ARG_ENABLE(
45        [doc],
46        [AS_HELP_STRING([--enable-doc],[enable installation of documents @<:@disabled@:>@])],
47        ,
48        [enable_doc="no"]
49)
50
51AC_ARG_WITH(
52        [pamdir],
53        [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored])],
54        [pamdir="${withval}"],
55        [
56                if test "${prefix}" = "/usr"; then
57                        pamdir="/lib${libdir##*/lib}/security"
58                else
59                        pamdir="\$(libdir)/security"
60                fi
61        ]
62)
63
64dnl Checks for programs.
65AC_PROG_CPP
66AC_PROG_INSTALL
67AC_PROG_LN_S
68AC_PROG_MKDIR_P
69AC_PROG_SED
70AC_PROG_MAKE_SET
71
72dnl Add libtool support.
73ifdef(
74        [LT_INIT],
75        [LT_INIT],
76        [AC_PROG_LIBTOOL]
77)
78
79dnl Checks for header files.
80AC_HEADER_STDC
81AC_HEADER_SYS_WAIT
82AC_CHECK_HEADERS([ \
83        string.h syslog.h fcntl.h unistd.h security/pam_ext.h \
84])
85AC_TYPE_SIZE_T
86AC_FUNC_MALLOC
87AC_FUNC_REALLOC
88AC_FUNC_STAT
89AC_FUNC_VPRINTF
90AC_CHECK_FUNCS([memset strdup strerror])
91
92PKG_CHECK_MODULES([LIBP11], [libp11 >= 0.2.4],, [AC_MSG_ERROR([libp11 is required])])
93PKG_CHECK_MODULES(
94        [OPENSSL],
95        [libcrypto >= 0.9.7],
96        ,
97        [PKG_CHECK_MODULES(
98                [OPENSSL],
99                [openssl >= 0.9.7],
100                ,
101                [AC_CHECK_LIB(
102                        [crypto],
103                        [RSA_version],
104                        [OPENSSL_LIBS="-lcrypto"],
105                        [AC_MSG_ERROR([Cannot find OpenSSL])]
106                )]
107        )]
108)
109
110dnl These required for svn checkout
111AC_ARG_VAR([XSLTPROC], [xsltproc utility])
112AC_ARG_VAR([SVN], [subversion utility])
113AC_ARG_VAR([WGET], [wget utility])
114AC_ARG_VAR([WGET_OPTS], [wget options])
115AC_ARG_VAR([TR], [tr utility])
116AC_CHECK_PROGS([XSLTPROC],[xsltproc])
117AC_CHECK_PROGS([SVN],[svn])
118AC_CHECK_PROGS([WGET],[wget])
119AC_CHECK_PROGS([TR],[tr])
120test -z "${WGET_OPTS}" && WGET_OPTS="-nv"
121
122dnl svn checkout dependencies
123if test "${svn_checkout}" = "yes"; then
124        AC_MSG_CHECKING([XSLTPROC requirement])
125        if test -n "${XSLTPROC}"; then
126                AC_MSG_RESULT([ok])
127        else
128                if test "${enable_doc}" = "yes"; then
129                        AC_MSG_ERROR([Missing XSLTPROC svn build with doc])
130                else
131                        AC_MSG_WARN(["make dist" will not work])
132                fi
133        fi
134
135        AC_MSG_CHECKING([svn doc build dependencies])
136        if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then
137                AC_MSG_RESULT([ok])
138        else
139                if test "${enable_doc}" = "yes"; then
140                        AC_MSG_ERROR([Missing SVN, TR or WGET for svn doc build])
141                else
142                        AC_MSG_WARN(["make dist" will not work])
143                fi
144        fi
145fi
146
147if test -z "${PAM_LIBS}"; then
148        AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
149        AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
150        AC_CHECK_LIB(
151                [pam],
152                [pam_authenticate],
153                [PAM_LIBS="-lpam"],
154                [AC_MSG_ERROR([Cannot find pam])]
155        )
156fi
157
158AC_SUBST([pamdir])
159
160AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"])
161AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"])
162
163if test "${enable_pedantic}" = "yes"; then
164        enable_strict="yes";
165        CFLAGS="${CFLAGS} -pedantic"
166fi
167if test "${enable_strict}" = "yes"; then
168        CFLAGS="${CFLAGS} -Wall -Wextra"
169fi
170
171AC_CONFIG_FILES([
172        Makefile
173        doc/Makefile
174        doc/nonpersistent/Makefile
175        src/Makefile
176])
177AC_OUTPUT
178
179cat <<EOF
180
181pam_p11 has been configured with the following options:
182
183
184Version:                 ${PACKAGE_VERSION}
185Libraries:               $(eval eval eval echo "${libdir}")
186
187doc support:             ${enable_doc}
188
189Host:                    ${host}
190Compiler:                ${CC}
191Preprocessor flags:      ${CPPFLAGS}
192Compiler flags:          ${CFLAGS}
193Linker flags:            ${LDFLAGS}
194Libraries:               ${LIBS}
195
196pamdir                   ${pamdir}
197
198PAM_CFLAGS:              ${PAM_CFLAGS}
199PAM_LIBS:                ${PAM_LIBS}
200LIBP11_CFLAGS:           ${LIBP11_CFLAGS}
201LIBP11_LIBS:             ${LIBP11_LIBS}
202OPENSSL_CFLAGS:          ${OPENSSL_CFLAGS}
203OPENSSL_LIBS:            ${OPENSSL_LIBS}
204
205EOF
Note: See TracBrowser for help on using the repository browser.