Merge branch 'debian'
[hcoop/debian/courier-authlib.git] / libs / sha1 / configure.ac
CommitLineData
d9898ee8 1dnl Process this file with autoconf to produce a configure script.
d9898ee8 2dnl
3dnl Copyright 2001-2004 Double Precision, Inc.
4dnl See COPYING for distribution information.
5
6AC_PREREQ(2.59)
7AC_INIT(libsha1, 1.21, courier-users@lists.sourceforge.net)
8
9>confdefs.h # Kill PACKAGE_ macros
10
11AC_CONFIG_SRCDIR([hmac.c])
b0322a85 12AC_CONFIG_AUX_DIR(../..)
d9898ee8 13AM_CONFIG_HEADER([config.h])
14AM_INIT_AUTOMAKE([foreign no-define])
15
16AM_CONDITIONAL(HMACC, test -d ${srcdir}/../libhmac)
17
18dnl Checks for programs.
19AC_PROG_CC
20AC_PROG_INSTALL
21AC_PROG_LN_S
22AC_PROG_LIBTOOL
23
24if test "$GCC" = yes
25then
26 CFLAGS="-Wall $CFLAGS"
27fi
28CFLAGS="$CFLAGS -I$srcdir/.. -I.."
29
30dnl Checks for libraries.
31
32dnl Checks for header files.
33
34AC_CHECK_HEADERS(sys/types.h)
35
36AC_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)
86UINT32="$int32"
87
88AC_DEFINE_UNQUOTED(SHA1_WORD, $UINT32, [ 32 bit data type ])
89
8d138742
CE
90AC_ARG_WITH(int64,
91[ --with-int64='type' use 'type' for an unsigned 64 bit integer type
92 ( default is 'unsigned')],
93 int64="$withval", [
94
95 AC_MSG_CHECKING(for uint64_t)
96
97 AC_TRY_COMPILE([
98#if HAVE_SYS_TYPES_H
99#include <sys/types.h>
100#endif
101 ],[
102 uint64_t i=0;
103 ], [ AC_MSG_RESULT(yes) ; int64="uint64_t"], [
104
105 AC_MSG_RESULT(no)
106 AC_MSG_CHECKING(for u_int_64_t)
107
108 AC_TRY_COMPILE([
109#if HAVE_SYS_TYPES_H
110#include <sys/types.h>
111#endif
112 ],[
113 u_int64_t i=0;
114 ], [AC_MSG_RESULT(yes); int64="u_int64_t"],[
115
116 AC_MSG_RESULT(no)
117
118 AC_CHECK_SIZEOF(unsigned, 0)
119 if test "$ac_cv_sizeof_unsigned" != 8
120 then
121 AC_CHECK_SIZEOF(unsigned long, 0)
122 if test "$ac_cv_sizeof_unsigned_long" != 8
123 then
124 AC_CHECK_SIZEOF(unsigned long long, 0)
125 if test "$ac_cv_sizeof_unsigned_long_long" != 8
126 then
127 AC_CHECK_SIZEOF(unsigned short, 0)
128 if test "$ac_cv_sizeof_unsigned_short" != 8
129 then
130 AC_ERROR(--with-int64 option is required)
131 fi
132 int64="unsigned short"
133 else
134 int64="unsigned long long"
135 fi
136 else
137 int64="unsigned long"
138 fi
139 else
140 int64="unsigned"
141 fi
142 ])
143 ])
144 ]
145)
146UINT64="$int64"
147
148AC_DEFINE_UNQUOTED(SHA512_WORD, $UINT64, [ 64 bit data type ])
d9898ee8 149dnl Checks for typedefs, structures, and compiler characteristics.
150AC_C_CONST
b0322a85 151AC_SYS_LARGEFILE
d9898ee8 152
153dnl Checks for library functions.
154AC_HEADER_STDC
155
156AC_OUTPUT(Makefile)