d9898ee8 |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl $Id: configure.in,v 1.7 2005/04/03 16:22:09 mrsam Exp $ |
3 | dnl |
4 | dnl Copyright 2001-2004 Double Precision, Inc. |
5 | dnl See COPYING for distribution information. |
6 | |
7 | AC_PREREQ(2.59) |
8 | AC_INIT(libsha1, 1.21, courier-users@lists.sourceforge.net) |
9 | |
10 | >confdefs.h # Kill PACKAGE_ macros |
11 | |
12 | AC_CONFIG_SRCDIR([hmac.c]) |
13 | AM_CONFIG_HEADER([config.h]) |
14 | AM_INIT_AUTOMAKE([foreign no-define]) |
15 | |
16 | AM_CONDITIONAL(HMACC, test -d ${srcdir}/../libhmac) |
17 | |
18 | dnl Checks for programs. |
19 | AC_PROG_CC |
20 | AC_PROG_INSTALL |
21 | AC_PROG_LN_S |
22 | AC_PROG_LIBTOOL |
23 | |
24 | if test "$GCC" = yes |
25 | then |
26 | CFLAGS="-Wall $CFLAGS" |
27 | fi |
28 | CFLAGS="$CFLAGS -I$srcdir/.. -I.." |
29 | |
30 | dnl Checks for libraries. |
31 | |
32 | dnl Checks for header files. |
33 | |
34 | AC_CHECK_HEADERS(sys/types.h) |
35 | |
36 | AC_ARG_WITH(int32, |
37 | [ --with-int32='type' use 'type' for an unsigned 32 bit integer type |
38 | ( default is 'unsigned')], |
39 | int32="$withval", [ |
40 | |
41 | AC_MSG_CHECKING(for uint32_t) |
42 | |
43 | AC_TRY_COMPILE([ |
44 | #if HAVE_SYS_TYPES_H |
45 | #include <sys/types.h> |
46 | #endif |
47 | ],[ |
48 | uint32_t i=0; |
49 | ], [ AC_MSG_RESULT(yes) ; int32="uint32_t"], [ |
50 | |
51 | AC_MSG_RESULT(no) |
52 | AC_MSG_CHECKING(for u_int_32_t) |
53 | |
54 | AC_TRY_COMPILE([ |
55 | #if HAVE_SYS_TYPES_H |
56 | #include <sys/types.h> |
57 | #endif |
58 | ],[ |
59 | u_int32_t i=0; |
60 | ], [AC_MSG_RESULT(yes); int32="u_int32_t"],[ |
61 | |
62 | AC_MSG_RESULT(no) |
63 | |
64 | AC_CHECK_SIZEOF(unsigned, 0) |
65 | if test "$ac_cv_sizeof_unsigned" != 4 |
66 | then |
67 | AC_CHECK_SIZEOF(unsigned long, 0) |
68 | if test "$ac_cv_sizeof_unsigned_long" != 4 |
69 | then |
70 | AC_CHECK_SIZEOF(unsigned short, 0) |
71 | if test "$ac_cv_sizeof_unsigned_short" != 4 |
72 | then |
73 | AC_ERROR(--with-int32 option is required) |
74 | fi |
75 | int32="unsigned short" |
76 | else |
77 | int32="unsigned long" |
78 | fi |
79 | else |
80 | int32="unsigned" |
81 | fi |
82 | ]) |
83 | ]) |
84 | ] |
85 | ) |
86 | UINT32="$int32" |
87 | |
88 | AC_DEFINE_UNQUOTED(SHA1_WORD, $UINT32, [ 32 bit data type ]) |
89 | |
90 | dnl Checks for typedefs, structures, and compiler characteristics. |
91 | AC_C_CONST |
92 | |
93 | dnl Checks for library functions. |
94 | AC_HEADER_STDC |
95 | |
96 | AC_OUTPUT(Makefile) |