2 dnl ***** BEGIN LICENSE BLOCK *****
3 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 dnl The contents of this file are subject to the Mozilla Public License Version
6 dnl 1.1 (the "License"); you may not use this file except in compliance with
7 dnl the License. You may obtain a copy of the License at
8 dnl http://www.mozilla.org/MPL/
10 dnl Software distributed under the License is distributed on an "AS IS" basis,
11 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 dnl for the specific language governing rights and limitations under the
15 dnl The Original Code is a trivial PKCS#11 test program.
17 dnl The Initial Developer of the Original Code is
18 dnl Netscape Communications Corp.
19 dnl Portions created by the Initial Developer are Copyright (C) 2000
20 dnl the Initial Developer. All Rights Reserved.
24 dnl Alternatively, the contents of this file may be used under the terms of
25 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
26 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 dnl in which case the provisions of the GPL or the LGPL are applicable instead
28 dnl of those above. If you wish to allow use of your version of this file only
29 dnl under the terms of either the GPL or the LGPL, and not to allow others to
30 dnl use your version of this file under the terms of the MPL, indicate your
31 dnl decision by deleting the provisions above and replace them with the notice
32 dnl and other provisions required by the GPL or the LGPL. If you do not delete
33 dnl the provisions above, a recipient may use your version of this file under
34 dnl the terms of any one of the MPL, the GPL or the LGPL.
36 dnl ***** END LICENSE BLOCK *****
38 dnl My revision info: "@(#) $RCSfile: configure.in,v $ $Revision: 1.3 $ $Date: 2006/03/02 22:48:55 $"
39 dnl Don't use AC_REVISION; it's broken
42 AC_CONFIG_HEADER(config.h)
45 AC_ARG_WITH(nspr, [ --with-nspr[=path] specify location of NSPR],
48 AC_MSG_ERROR(NSPR is required);;
50 NSPR_INCLUDE="$includedir"
51 NSPR_LIBPATH="$libdir"
54 NSPR_INCLUDE="$withval/include"
55 NSPR_LIBPATH="$withval/lib"
58 [ NSPR_INCLUDE="$includedir"
59 NSPR_LIBPATH="$libdir" ]
62 NSPR_CFLAGS="-I$NSPR_INCLUDE"
63 NSPR_LDFLAGS="-L$NSPR_LIBPATH -lnspr4 -lplc4 -lplds4"
65 dnl This isn't optimum, but the mozilla build system and autoconf don't really mesh well..
67 AC_ARG_WITH(nss-dist, [ --with-nss-dist[=path] specify path to NSS dist directory],
74 AC_MSG_ERROR(You have to specify a path for --with-nss-dist)
77 NSS_CFLAGS="-I$withval/private/security -I$withval/public/security"
82 AC_ARG_WITH(nss-hdrs, [ --with-nss-hdrs[=path] or, specify path to installed NSS headers],
83 [ if test "x$nss" != "x"; then
84 AC_MSG_ERROR(Only specify --with-nss-hdrs or --with-nss-dist, not both)
92 NSS_CFLAGS="-I$includedir"
96 NSS_CFLAGS="-I$withval"
101 AC_ARG_WITH(rsa-hdrs, [ --with-rsa-hdrs[=path] if not using NSS, specify path to RSA headers],
102 [ if test "x$nss" != "x"; then
103 AC_MSG_ERROR(Only specify --with-nss-{hdrs,dist} or --with-rsa-hdrs, not both)
110 RSA_INCLUDE="$includedir"
114 RSA_INCLUDE="$withval"
119 if test "x$nss" = "x"; then
120 if test "x$rsa" = "x"; then
121 RSA_INCLUDE="$includedir"
123 RSA_CFLAGS="-I$RSA_INCLUDE"
126 if test "x$nss" = "x1"; then
127 AC_DEFINE(WITH_NSS,1)
132 if test "x$rsa" = "x1"; then
133 RSA_CFLAGS-"-I$RSA_INCLUDE"
136 AC_ARG_ENABLE(debug, [ --disable-debug default is enabled],
137 [ case "$enableval" in
141 DEBUG_CFLAGS="-DDEBUG";;
143 DEBUG_CFLAGS="-DDEBUG";;
144 esac ], DEBUG_CFLAGS="-DDEBUG")
146 dnl Checks for programs.
151 AC_CHECK_PROG(AR, ar, ar)
152 AC_CHECK_PROG(LD, ld, ld)
153 AC_CHECK_PROG(RM, rm, rm)
154 AC_CHECK_PROG(TAR, tar, tar)
155 AC_SUBST(CC INSTALL RANLIB AR LD RM TAR)
157 CPPFLAGS="$CFLAGS $NSPR_CFLAGS $NSS_CFLAGS $RSA_CFLAGS $DEBUG_CFLAGS"
158 LIBS="$NSPR_LDFLAGS $LIBS"
162 dnl Checks for libraries.
163 AC_CHECK_LIB(nspr4, PR_Init)
165 dnl Checks for header files.
166 AC_CHECK_HEADERS(nspr.h)
167 AC_SUBST(HAVE_NSPR_H)
169 if test "x$nss" = "x1"; then
170 AC_CHECK_HEADERS(ck.h)
173 if test "x$rsa" = "x1"; then
174 AC_CHECK_HEADERS(pkcs11t.h pkcs11.h)
177 AC_SUBST(HAVE_CK_H HAVE_PKCS11T_H HAVE_PKCS11_H)
179 dnl Checks for typedefs, structures, and compiler characteristics.
183 AC_CHECK_FUNCS(memset strlen)
184 AC_SUBST(HAVE_MEMSET HAVE_STRLEN)
185 AC_OUTPUT(Makefile, [echo timestamp > stamp-h])