| 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | dnl $Id: configure.in,v 1.8 2008/12/18 12:08:25 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 | AC_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 | ) |
| 146 | UINT64="$int64" |
| 147 | |
| 148 | AC_DEFINE_UNQUOTED(SHA512_WORD, $UINT64, [ 64 bit data type ]) |
| 149 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 150 | AC_C_CONST |
| 151 | |
| 152 | dnl Checks for library functions. |
| 153 | AC_HEADER_STDC |
| 154 | |
| 155 | AC_OUTPUT(Makefile) |