-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
92 lines (76 loc) · 2.38 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
## LibRdRand:
## an example of using Automake and Libtool to build a shared librar
AC_INIT([LibRdRand], [1.2.0], [[email protected]], [librdrand],
[https://github.com/BroukPytlik/RdRand])
AC_PREREQ([2.59])
AM_INIT_AUTOMAKE([1.10 -Wall no-define])
AC_CONFIG_MACRO_DIR([m4])
# Generate two configuration headers; one for building the library itself with
# an autogenerated template, and a second one that will be installed alongside
# the library.
AC_CONFIG_HEADERS([config.h rdrandconfig.h])
AC_PROG_CXX
## Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([stddef.h])
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([omp.h])
AC_CHECK_HEADERS([stdio.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([cpuid.h])
AC_CHECK_HEADERS([x86intrin.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([time.h])
AC_CHECK_HEADERS([math.h])
AC_CHECK_HEADERS([inttypes.h])
AC_CHECK_HEADERS([errno.h])
AC_CHECK_HEADERS([openssl/rand.h])
AC_CHECK_HEADERS([openssl/evp.h])
###################
# Check for OpenMP
AC_OPENMP
AC_SUBST(OPENMP_CFLAGS)
##################
###########
# -mrdrnd
AC_MSG_CHECKING([whether CC supports -mrdrnd])
my_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -mrdrnd"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[AC_MSG_RESULT([yes])]
[cc_supports_rdrnd=yes],
[AC_MSG_RESULT([no])]
[cc_supports_rdrnd=no])
CFLAGS="$my_save_cflags"
unset my_save_cflags
if test -z "$RDRND_FLAGS"
then
RDRND_TESTS='rdrnd${EXEEXT}'
if test "$cc_supports_rdrnd" = "yes"
then
RDRND_FLAGS="-mrdrnd"
else
RDRND_FLAGS=""
fi
else
RDRND_TESTS=""
fi
AC_SUBST([RDRND_FLAGS])
###########
LT_INIT([disable-static])
# Define these substitions here to keep all version information in one place.
# For information on how to properly maintain the library version information,
# refer to the libtool manual, section "Updating library version information":
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AC_SUBST([RDRAND_SO_VERSION], [1:2:0])
AC_SUBST([RDRAND_API_VERSION], [1.2.0])
# Override the template file name of the generated .pc file, so that there
# is no need to rename the template file when the API version changes.
#rdrand-${RDRAND_API_VERSION}.pc:rdrand.pc.in])
AC_CONFIG_FILES([Makefile
librdrand.pc:librdrand.pc.in])
AC_OUTPUT