File: configure.ac

package info (click to toggle)
btcheck 1.9-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 768 kB
  • sloc: sh: 3,806; ansic: 1,493; makefile: 11
file content (68 lines) | stat: -rw-r--r-- 2,310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([btcheck], [1.9], [Jean Diraison <jean.diraison@ac-rennes.fr>])
AM_INIT_AUTOMAKE([-Wall])
AC_INCLUDES_DEFAULT([])
AC_CONFIG_HEADER([src/config.h:src/config.h.in])

# Build system type
AC_CANONICAL_HOST
#AC_SUBST(host)
AS_IF([test "x$host" != "x"],
      [AC_DEFINE_UNQUOTED(CANONICAL_HOST, ["$host"], [Define canonical host type.])],
      [AC_DEFINE_UNQUOTED(CANONICAL_HOST, ["unknown"], [Define canonical host type.])])

# Macro version to substitute
OPENSSL_MINIMUM=0.9.4
AC_SUBST(OPENSSL_MINIMUM)

# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET

# Activate large file support
#AC_DEFINE(_LARGEFILE_SOURCE, [1], [Define to 1 for large file support])
#AC_DEFINE(_FILE_OFFSET_BITS, [64], [Offsets bits in files])
AC_SYS_LARGEFILE

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h limits.h errno.h fcntl.h time.h sys/types.h sys/stat.h])

# Checks for typedefs, structures, and compiler characteristics.
#AC_TYPE_INT64_T
AC_TYPE_LONG_LONG_INT
AC_TYPE_SIZE_T

# Checks endianness
AC_C_BIGENDIAN([AC_DEFINE(WORDS_BIGENDIAN)], [], [AC_MSG_WARN([Endianness unkown.])])

# Checks for library functions and libraries.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_CHECK_FUNCS(getopt, [], [AC_MSG_ERROR([The getopt function is not available.])])
AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)], [AC_MSG_WARN([The fchdir function is not available.])])

# Checks for OpenSSL library or Windows CryptoAPI
AC_ARG_WITH([openssl], AS_HELP_STRING([--without-openssl], [Do not use OpenSSL crypto library to compute hash.]))
AS_IF([test "x$with_openssl" != "xno"],
      [AC_CHECK_HEADERS([openssl/sha.h],
			[AC_SEARCH_LIBS(SHA1, crypto,
			 		[AC_DEFINE(WITH_OPENSSL, [1], [Use OpenSSL crypto library to compute hash.])],
					[AC_MSG_WARN([The OpenSSL crypto library is missing.])])
			])
      ],
      [AC_CHECK_HEADERS([windows.h wincrypt.h],
					[AC_DEFINE(WITH_WINDOWS_CRYPTOAPI, [1], [Use Windows CryptoAPI.])],
					[],
					[[#if HAVE_WINDOWS_H
					  #include <windows.h>
					  #endif
					]])
      ])

# Final step
AC_CONFIG_FILES([Makefile src/Makefile docs/Makefile package/btcheck.spec])
AC_OUTPUT()