~ubuntu-branches/ubuntu/lucid/ecryptfs-utils/lucid-security

1.1.3 by Daniel Baumann
Import upstream version 30
1
# Copyright (C) 2006-2007 International Business Machines Corp.
2
#  
3
# This file is free software; as a special exception the author gives
4
# unlimited permission to copy and/or distribute it, with or without 
5
# modifications, as long as this notice is preserved.
6
# 
7
# This program is distributed in the hope that it will be useful, but
8
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
9
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
11
1.1.9 by Daniel Baumann
Import upstream version 48
12
AC_PREREQ(2.59)
1.1.28 by Dustin Kirkland
Import upstream version 83
13
AC_INIT([ecryptfs-utils],[83])
1.1.3 by Daniel Baumann
Import upstream version 30
14
AC_CANONICAL_HOST
15
AC_CANONICAL_TARGET
16
AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
17
AC_CONFIG_SRCDIR([src/libecryptfs])
1.1.9 by Daniel Baumann
Import upstream version 48
18
AC_CONFIG_HEADERS([config.h])
19
AC_CONFIG_MACRO_DIR([m4])
1.1.3 by Daniel Baumann
Import upstream version 30
20
1.2.2 by Daniel Baumann
Import upstream version 64
21
AC_DISABLE_STATIC
1.2.3 by Daniel Baumann
Import upstream version 65
22
AM_PATH_PYTHON(2.5, [have_python="yes"], [have_python="no"])
1.2.2 by Daniel Baumann
Import upstream version 64
23
AC_PROG_SWIG(1.3.31)
24
SWIG_PYTHON
25
1.1.3 by Daniel Baumann
Import upstream version 30
26
LIBECRYPTFS_LT_CURRENT="0"
27
LIBECRYPTFS_LT_REVISION="0"
28
LIBECRYPTFS_LT_AGE="0"
29
AC_SUBST([LIBECRYPTFS_LT_CURRENT])
30
AC_SUBST([LIBECRYPTFS_LT_REVISION])
31
AC_SUBST([LIBECRYPTFS_LT_AGE])
32
33
AC_ARG_ENABLE(
1.3.1 by Daniel Baumann
Import upstream version 67
34
	[nss],
35
	[AS_HELP_STRING([--disable-nss],[Build against gcrypt rather than NSS])],
36
	,
37
	[enable_nss="detect"]
38
)
39
40
AC_ARG_ENABLE(
1.2.2 by Daniel Baumann
Import upstream version 64
41
	[pywrap],
1.3.1 by Daniel Baumann
Import upstream version 67
42
	[AS_HELP_STRING([--disable-pywrap],[Disable build of libecryptfs Python wrappers])],
1.2.2 by Daniel Baumann
Import upstream version 64
43
	,
44
	[enable_pywrap="detect"]
45
)
46
47
AC_ARG_ENABLE(
1.1.3 by Daniel Baumann
Import upstream version 30
48
	[openssl],
1.3.1 by Daniel Baumann
Import upstream version 67
49
	[AS_HELP_STRING([--disable-openssl],[Disable build of OpenSSL key module])],
1.1.3 by Daniel Baumann
Import upstream version 30
50
	,
51
	[enable_openssl="detect"]
52
)
53
54
AC_ARG_ENABLE(
55
	[pkcs11-helper],
1.1.9 by Daniel Baumann
Import upstream version 48
56
	[AS_HELP_STRING([--enable-pkcs11-helper],[Build pkcs11-helper key module])],
1.1.3 by Daniel Baumann
Import upstream version 30
57
	,
58
	enable_pkcs11_helper="no"
59
)
60
61
AC_ARG_ENABLE(
62
	[tspi],
1.1.9 by Daniel Baumann
Import upstream version 48
63
	[AS_HELP_STRING([--enable-tspi],[Build TrouSerS key module])],
1.1.3 by Daniel Baumann
Import upstream version 30
64
	,
65
	[enable_tspi="no"]
66
)
67
68
AC_ARG_ENABLE(
69
	[gpg],
1.1.9 by Daniel Baumann
Import upstream version 48
70
	[AS_HELP_STRING([--enable-gpg],[Build GnuPG key module])],
1.1.3 by Daniel Baumann
Import upstream version 30
71
	,
72
	[enable_gpg="no"]
73
)
74
75
AC_ARG_ENABLE(
76
	[pam],
1.3.1 by Daniel Baumann
Import upstream version 67
77
	[AS_HELP_STRING([--disable-pam],[Disable build of PAM module])],
1.1.3 by Daniel Baumann
Import upstream version 30
78
	,
79
	[enable_pam="yes"]
80
)
81
82
AC_ARG_ENABLE(
83
	[gui],
1.1.9 by Daniel Baumann
Import upstream version 48
84
	[AS_HELP_STRING([--enable-gui],[Enable building of GUI components])],
1.1.3 by Daniel Baumann
Import upstream version 30
85
	,
86
	[enable_gui="no"]
87
)
88
89
AC_ARG_ENABLE(
90
	[docs],
1.1.9 by Daniel Baumann
Import upstream version 48
91
	[AS_HELP_STRING([--enable-docs],[Enable installing document])],
1.1.3 by Daniel Baumann
Import upstream version 30
92
	,
93
	[enable_docs="no"]
94
)
95
96
AC_ARG_ENABLE(
97
	[docs-gen],
1.1.9 by Daniel Baumann
Import upstream version 48
98
	[AS_HELP_STRING([--enable-docs-gen],[Enable generating documents])],
1.1.3 by Daniel Baumann
Import upstream version 30
99
	,
100
	[enable_docs_gen="no"]
101
)
102
test "${enable_docs_gen}" = "yes" && enable_docs="yes"
103
104
AC_ARG_ENABLE(
1.1.9 by Daniel Baumann
Import upstream version 48
105
	[tests],
106
	[AS_HELP_STRING([--enable-tests],[Enable system specific tests])],
107
	,
108
	[enable_tests="no"]
109
)
110
111
AC_ARG_ENABLE(
1.1.3 by Daniel Baumann
Import upstream version 30
112
	[mudflap],
1.1.9 by Daniel Baumann
Import upstream version 48
113
	[AS_HELP_STRING([--enable-mudflap],[Build with -fmudflap gcc option])],
1.1.3 by Daniel Baumann
Import upstream version 30
114
	[
115
		if "${enableval}" = "yes"; then
116
			CFLAGS="$CFLAGS -fmudflap"
117
			LDFLAGS="$LDFLAGS -lmudflap"
118
		fi
119
	]
120
)
121
122
AC_ARG_WITH(
1.1.4 by Daniel Baumann
Import upstream version 38
123
	[gpgme-prefix],
1.1.9 by Daniel Baumann
Import upstream version 48
124
	[AS_HELP_STRING([--with-gpgme-prefix=PATH],[Specify the directory where gpgme install, default /usr])],
1.1.4 by Daniel Baumann
Import upstream version 38
125
	,
126
	[with_gpgme_prefix="/usr"]
127
)
128
129
AC_ARG_WITH(
1.1.3 by Daniel Baumann
Import upstream version 30
130
	[pamdir],
1.1.9 by Daniel Baumann
Import upstream version 48
131
	[AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored])],
1.1.3 by Daniel Baumann
Import upstream version 30
132
	[pamdir="${withval}"],
133
	[
1.1.4 by Daniel Baumann
Import upstream version 38
134
		if test "${prefix}" = "/usr"; then
135
			pamdir="/lib${libdir##*/lib}/security"
136
		else
137
			pamdir="\$(libdir)/security"
138
		fi
1.1.3 by Daniel Baumann
Import upstream version 30
139
	]
140
)
141
142
AC_ARG_WITH(
143
	[ecryptfskeymoddir],
1.1.9 by Daniel Baumann
Import upstream version 48
144
	[AS_HELP_STRING([--with-ecryptfskeymoddir=PATH],[Specify the directory where key modules are stored])],
1.1.3 by Daniel Baumann
Import upstream version 30
145
	[
146
		ecryptfskeymoddir="${withval}"
147
		full_ecryptfskeymoddir="${ecryptfskeymoddir}"
148
	],
149
	[
150
		full_ecryptfskeymoddir=`eval eval eval eval eval echo "${libdir}/ecryptfs" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
151
		ecryptfskeymoddir="\$(libdir)/ecryptfs"
152
	]
153
)
154
AC_DEFINE_UNQUOTED([ECRYPTFS_DEFAULT_KEY_MOD_DIR], ["$full_ecryptfskeymoddir"], "Location of key modules")
155
1.1.9 by Daniel Baumann
Import upstream version 48
156
AC_GNU_SOURCE
157
1.1.3 by Daniel Baumann
Import upstream version 30
158
AC_PROG_CC
159
AC_MINIX
160
AM_PROG_CC_C_O
1.1.10 by Daniel Baumann
Import upstream version 50
161
AC_PROG_LN_S
1.1.3 by Daniel Baumann
Import upstream version 30
162
PKG_PROG_PKG_CONFIG
1.1.9 by Daniel Baumann
Import upstream version 48
163
164
ifdef(
165
	[LT_INIT],
166
	[LT_INIT],
167
	[AC_PROG_LIBTOOL]
168
)
169
1.1.3 by Daniel Baumann
Import upstream version 30
170
AC_PATH_PROGS([POD2MAN], [pod2man])
171
test -z "${POD2MAN}" && AC_MSG_ERROR([I couldn't find pod2man; make sure it's installed and in your path])
172
173
AC_PATH_PROGS([TAR], [tar])
174
AC_PATH_PROGS([PS2PDF], [ps2pdf])
175
AC_PATH_PROGS([DVIPS], [dvips])
176
AC_PATH_PROGS([LATEX2HTML], [latex2html])
177
AC_PATH_PROGS([LATEX], [latex])
178
if test "${enable_docs_gen}" = "yes"; then
179
	test -z "${TAR}" && AC_MSG_ERROR([Couldn't find tar])
180
	test -z "${PS2PDF}" && AC_MSG_ERROR([Couldn't find ps2pdf])
181
	test -z "${DVIPS}" && AC_MSG_ERROR([Couldn't find dvips])
182
	test -z "${LATEX2HTML}" && AC_MSG_ERROR([Couldn't find latex2html])
183
	test -z "${LATEX}" && AC_MSG_ERROR([Couldn't find latex])
184
fi
185
186
AC_ISC_POSIX
1.1.9 by Daniel Baumann
Import upstream version 48
187
AC_HEADER_STDC
1.1.3 by Daniel Baumann
Import upstream version 30
188
AC_CHECK_LIB([dl], [dlopen])
189
190
# Verify keyutils version 1.0 or higher
191
if test -z "${KEYUTILS_LIBS}"; then
192
	AC_ARG_VAR([KEYUTILS_CFLAGS], [C compiler flags for keyutils])
193
	AC_ARG_VAR([KEYUTILS_LIBS], [linker flags for keyutils])
194
	AC_CHECK_LIB(
195
		[keyutils],
196
		[keyctl_search],
197
		[KEYUTILS_LIBS="-lkeyutils"],
198
		[AC_MSG_ERROR([eCryptfs userspace tools require Keyutils version 1.0 or higher.
199
You might find the package at:
200
http://people.redhat.com/~dhowells/keyutils/
201
])
202
		]
203
	)
204
fi
205
206
if test -z "${OPENSSL_LIBS}"; then
207
	PKG_CHECK_MODULES(
208
		[OPENSSL],
209
		[libcrypto >= 0.9.7],
210
		[have_openssl="yes"],
211
		[PKG_CHECK_MODULES(
212
			[OPENSSL],
213
			[openssl >= 0.9.7],
214
			[have_openssl="yes"],
215
			[AC_CHECK_LIB(
216
				[crypto],
217
				[RSA_version],
218
				[
219
					have_openssl="yes"
220
					OPENSSL_LIBS="-lcrypto"
221
				],
222
				[have_openssl="no"]
223
			)]
224
		)]
225
	)
226
else
227
	have_openssl="yes"
228
fi
229
1.3.1 by Daniel Baumann
Import upstream version 67
230
#Verify nss
231
NSS_LIBS=`nss-config --libs`
232
if test "x${NSS_LIBS}" != "x" ; then
233
        NSS_CFLAGS=`nss-config --cflags`
234
        NSPR_CFLAGS=`nspr-config --cflags`
235
        NSS_CFLAGS="${NSS_CFLAGS} -DENABLE_NSS ${NSPR_CFLAGS}"
236
        have_nss="yes"
237
else
238
        NSS_CFLAGS=""
239
        have_nss="no"
240
fi
241
242
if test "${enable_nss}" = "detect" ; then
243
        if test "$have_nss" == "yes" ; then
244
                enable_nss="yes"
245
        else
246
                enable_nss="no"
247
        fi
248
fi
249
1.1.3 by Daniel Baumann
Import upstream version 30
250
OLD_CFLAGS="${CFLAGS}"
251
CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
252
AC_CHECK_HEADER([openssl/rsa.h],, [have_openssl="no"])
253
CFLAGS="${OLD_CFLAGS}"
254
1.2.2 by Daniel Baumann
Import upstream version 64
255
if test "x${SWIG}" != "x" ; then
256
   have_swig="yes"
1.2.3 by Daniel Baumann
Import upstream version 65
257
else
258
   have_swig="no"
1.2.2 by Daniel Baumann
Import upstream version 64
259
fi
260
261
if test "${enable_pywrap}" = "detect" ; then
262
        if test "${have_python}" = "yes" ; then
263
                if test "${have_swig}" = "yes" ; then
264
                        enable_pywrap="yes"
265
                fi
266
        fi
267
fi
268
269
if test "${enable_pywrap}" = "yes" ; then
270
        test "${have_python}" != "yes" && AC_MSG_ERROR([Python not found])
271
        test "${have_swig}" != "yes" && AC_MSG_ERROR([SWIG not found])
272
fi
273
1.1.3 by Daniel Baumann
Import upstream version 30
274
test "${enable_openssl}" = "detect" && enable_openssl="${have_openssl}"
275
276
if test "${enable_openssl}" = "yes" ; then
277
	test "${have_openssl}" != "yes" && AC_MSG_ERROR([OpenSSL not found])
278
fi
279
280
if test "${enable_pkcs11_helper}" = "yes" ; then
281
	test "${have_openssl}" != "yes" && AC_MSG_ERROR([OpenSSL not found])
282
	PKG_CHECK_MODULES([PKCS11_HELPER], [libpkcs11-helper-1 >= 1.04],, [AC_MSG_ERROR([Cannot locate pkcs11-helper])])
283
fi
284
285
if test "${enable_tspi}" = "yes" ; then
286
	if test -z "${TSPI_LIBS}"; then
287
		AC_ARG_VAR([TSPI_CFLAGS], [C compiler flags for tspi])
288
		AC_ARG_VAR([TSPI_LIBS], [linker flags for tspi])
289
		AC_CHECK_LIB(
290
			[tspi],
291
			[Tspi_Context_Create],
292
			[TSPI_LIBS="-ltspi"],
293
			[AC_MSG_ERROR([Cannot find tspi])]
294
		)
295
	fi
296
fi
297
298
if test "${enable_gpg}" = "yes" ; then
1.1.4 by Daniel Baumann
Import upstream version 38
299
	AC_MSG_CHECKING([for gpgme])
300
	if ! test -x "${with_gpgme_prefix}/bin/gpgme-config"; then
301
		AC_MSG_ERROR([Cannot locate gpgme])
302
	else
303
		AC_MSG_RESULT([found])
304
		GPGME_CFLAGS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --cflags`"
305
		GPGME_LIBS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --libs`"
1.1.3 by Daniel Baumann
Import upstream version 30
306
	fi
307
fi
308
309
if test "${enable_pam}" = "yes" ; then
310
	if test -z "${PAM_LIBS}"; then
311
		AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
312
		AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
313
		AC_CHECK_LIB(
314
			[pam],
315
			[pam_authenticate],
316
			[PAM_LIBS="-lpam"],
317
			[AC_MSG_ERROR([Cannot find pam])]
318
		)
319
		AC_CHECK_LIB(
320
			[pam_misc],
321
			[pam_misc_setenv],
1.1.22 by Dustin Kirkland
Import upstream version 77
322
			[PAM_LIBS="${PAM_LIBS} ${TSPI_LIBS} -lpam_misc"],
1.1.3 by Daniel Baumann
Import upstream version 30
323
			[AC_MSG_ERROR([Cannot find pam_misc])]
324
		)
325
	fi
326
fi
327
328
if test "${enable_gui}" = "yes"; then
1.1.4 by Daniel Baumann
Import upstream version 38
329
	PKG_CHECK_MODULES(
330
		[GTK],
331
		[gtk+-2.0 >= 2.0],
332
		,
333
		PKG_CHECK_MODULES(
334
			[GTK],
335
			[gtk+ >= 1.0],,
336
			AC_MSG_ERROR([Cannot locate gtk+])
337
		)
338
	)
1.1.3 by Daniel Baumann
Import upstream version 30
339
fi
340
341
pkgconfigdir="\$(libdir)/pkgconfig"
342
if test "${prefix}" = "/usr"; then
343
	rootsbindir="/sbin"
344
else
345
	rootsbindir="\$(sbindir)"
346
fi
1.1.9 by Daniel Baumann
Import upstream version 48
347
1.1.28 by Dustin Kirkland
Import upstream version 83
348
GETTEXT_PACKAGE=ecryptfs-utils
349
AC_SUBST(GETTEXT_PACKAGE)
350
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
351
                   [the gettext translation domain])
352
353
AM_GLIB_GNU_GETTEXT
354
355
IT_PROG_INTLTOOL([0.41.0])
356
357
LOCALEDIR='${prefix}/${datadir}/locale'
358
AC_SUBST(LOCALEDIR)
359
360
1.1.21 by Dustin Kirkland
Import upstream version 76
361
CRYPTO_CFLAGS=${NSS_CFLAGS}
362
CRYPTO_LIBS=${NSS_LIBS}
1.3.1 by Daniel Baumann
Import upstream version 67
363
1.1.3 by Daniel Baumann
Import upstream version 30
364
AC_SUBST([pamdir])
365
AC_SUBST([pamlibdir])
366
AC_SUBST([pkgconfigdir])
367
AC_SUBST([rootsbindir])
368
AC_SUBST([ecryptfskeymoddir])
1.1.4 by Daniel Baumann
Import upstream version 38
369
AC_SUBST([GPGME_CFLAGS])
370
AC_SUBST([GPGME_LIBS])
1.3.1 by Daniel Baumann
Import upstream version 67
371
AC_SUBST([CRYPTO_CFLAGS])
372
AC_SUBST([CRYPTO_LIBS])
1.1.3 by Daniel Baumann
Import upstream version 30
373
AM_CONDITIONAL([BUILD_OPENSSL], [test "${enable_openssl}" = "yes"])
374
AM_CONDITIONAL([BUILD_PKCS11_HELPER], [test "${enable_pkcs11_helper}" = "yes"])
375
AM_CONDITIONAL([BUILD_TSPI], [test "${enable_tspi}" = "yes"])
376
AM_CONDITIONAL([BUILD_GPG], [test "${enable_gpg}" = "yes"])
377
AM_CONDITIONAL([BUILD_PAM], [test "${enable_pam}" = "yes"])
1.2.2 by Daniel Baumann
Import upstream version 64
378
AM_CONDITIONAL([BUILD_PYWRAP], [test "${enable_pywrap}" = "yes"])
1.3.1 by Daniel Baumann
Import upstream version 67
379
AM_CONDITIONAL([BUILD_NSS], [test "${enable_nss}" = "yes"])
1.1.3 by Daniel Baumann
Import upstream version 30
380
AM_CONDITIONAL([BUILD_GUI], [test "${enable_gui}" = "yes"])
381
AM_CONDITIONAL([BUILD_DOCS], [test "${enable_docs}" = "yes"])
382
AM_CONDITIONAL([BUILD_DOCS_GEN], [test "${enable_docs_gen}" = "yes"])
1.1.9 by Daniel Baumann
Import upstream version 48
383
AM_CONDITIONAL([ENABLE_TESTS], [test "${enable_tests}" = "yes"])
1.1.3 by Daniel Baumann
Import upstream version 30
384
385
# workaround for <autoconf-2.60
386
if test -z "${docdir}"; then
387
	docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
388
	AC_SUBST([docdir])
389
fi
390
if test -z "${htmldir}"; then
391
	htmldir="\$(docdir)"
392
	AC_SUBST([htmldir])
393
fi
394
# end workaround
1.1.9 by Daniel Baumann
Import upstream version 48
395
# workaround for <automake-1.10
396
if test -z "${MKDIR_P}"; then
397
	MKDIR_P="\$(mkdir_p)"
398
	AC_SUBST([MKDIR_P])
399
fi
400
# end workaround
1.1.3 by Daniel Baumann
Import upstream version 30
401
402
AC_CONFIG_FILES([
403
	Makefile
404
	doc/Makefile
405
	src/Makefile
406
	src/libecryptfs/Makefile
407
	src/utils/Makefile
408
	src/key_mod/Makefile
409
	src/daemon/Makefile
1.1.20 by Dustin Kirkland
Import upstream version 75
410
	src/desktop/Makefile
1.1.28 by Dustin Kirkland
Import upstream version 83
411
	src/desktop/ecryptfs-mount-private.desktop
412
	src/desktop/ecryptfs-setup-private.desktop
1.1.3 by Daniel Baumann
Import upstream version 30
413
	src/include/Makefile
414
	doc/manpage/Makefile
415
	src/pam_ecryptfs/Makefile
416
	src/libecryptfs/libecryptfs.pc
1.2.2 by Daniel Baumann
Import upstream version 64
417
	src/libecryptfs-swig/Makefile
1.1.28 by Dustin Kirkland
Import upstream version 83
418
	po/Makefile.in
1.1.3 by Daniel Baumann
Import upstream version 30
419
])
420
AC_OUTPUT
421
422
if test "${prefix}" != "/usr"; then
423
	echo
424
	echo "Warning: install prefix is $prefix"
425
	echo
426
	echo "Most mount applications expect the mount helper to install to"
427
	echo "/sbin. You can install the mount helper to that location by "
428
	echo "running the configure script again with --prefix=/usr:"
429
	echo
430
	echo "./configure --prefix=/usr"
431
	echo
432
fi