-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
135 lines (117 loc) · 3.11 KB
/
configure.ac
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([rdecay], [1.1.2], [jargon@molb.org])
AM_SILENT_RULES([yes])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
case $host_os in
*linux*)
platform="linux"
AC_DEFINE_UNQUOTED([OS_LINUX], [1], [OS is Linux.])
;;
*msdos* | *go32* | *mingw* | *cygwin* | *windows*)
platform="windows"
AC_DEFINE_UNQUOTED([OS_WINDOWS], [1], [OS is Windows.])
;;
*)
platform=""
;;
esac
# Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
if test "$GCC" = yes ; then
if test "$platform" = "windows" ; then
WARN_FLAGS=""
else
WARN_FLAGS="-W -Wall"
fi
fi
AC_SUBST([WARN_FLAGS])
AC_PROG_INSTALL
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19])
# Checks for libraries.
PKG_CHECK_MODULES([GTK], [gtk+-2.0])
if test "$platform" = "windows" ; then
GTK_CFLAGS="$GTK_CFLAGS -mms-bitfields -mwindows"
fi
PKG_CHECK_MODULES([GSL], [gsl])
# Checks for header files.
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/time.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
if test "$platform" = "windows" ; then
rnd_device=no
else
rnd_device=yes
fi
AC_ARG_ENABLE([rnd-device],
AC_HELP_STRING([--enable-rnd-device=DEVICE],
[path to random device (default is /dev/urandom)]),
[rnd_device=$enableval])
if test "$rnd_device" = yes ; then
rnd_device="/dev/urandom"
fi
if test "$rnd_device" != no ; then
AC_MSG_CHECKING([for random device $rnd_device])
if test -r "$rnd_device" ; then
AC_DEFINE_UNQUOTED([RND_DEVICE], ["$rnd_device"], [Path to random device.])
AC_MSG_RESULT([yes])
else
rnd_device=no
AC_MSG_RESULT([no])
fi
else
AC_MSG_NOTICE([Random device disabled])
fi
if test "$platform" = "windows" ; then
crypto_api=yes
else
crypto_api=no
fi
AC_ARG_ENABLE([cryptoapi],
AC_HELP_STRING([--disable-cryptoapi],
[don't use the Microsoft Crypto API (default is yes)]),
[crypto_api=$enableval])
if test "$crypto_api" = yes ; then
AC_CHECK_HEADERS([windows.h], [], [crypto_api=no])
AC_CHECK_HEADERS([wincrypt.h], [], [crypto_api=no],
[#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif])
AC_MSG_CHECKING([for MS Crypto API])
if test "$crypto_api" = yes ; then
AC_DEFINE_UNQUOTED([MS_CRYPTO_API], [1], [Use the Microsoft Crypto API.])
AC_MSG_RESULT([yes])
else
crypto_api=no
AC_MSG_RESULT([no])
fi
else
AC_MSG_NOTICE([Microsoft Crypto API disabled])
fi
AC_CONFIG_FILES([Makefile
po/Makefile.in
lib/Makefile
src/Makefile
doc/Makefile
doc/de/Makefile])
AC_OUTPUT
echo
echo "summary"
echo
echo -n "random seed: "
if test "$rnd_device" != no ; then
echo "device ($rnd_device)"
elif test "$crypto_api" = yes ; then
echo "Microsoft Crypto-API"
else
echo "time"
fi
echo