forked from lbfm-rwth/carat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
81 lines (68 loc) · 1.55 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
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl
dnl Setup autoconf
dnl
AC_PREREQ([2.68])
AC_INIT([carat], [TODO_VERSION], [https://github.com/lbfm-rwth/carat/issues], [carat], [https://lbfm-rwth.github.io/carat/])
AC_CONFIG_SRCDIR([src/autgrp.c])
AC_CONFIG_HEADER([include/config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([cnf])
dnl
dnl Get canonical host info
dnl
AC_CANONICAL_HOST
dnl
dnl C is the language
dnl
AC_PROG_CC
AC_LANG([C])
dnl
dnl Setup automake
dnl
AC_PROG_RANLIB
AM_INIT_AUTOMAKE([1.11 -Wall foreign subdir-objects])
AM_SILENT_RULES([yes])
AM_PROG_AR
dnl
dnl Detect GMP
dnl
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--with-gmp@<:@=builtin|PREFIX@:>@],
[prefix of GMP installation. e.g. /usr/local])],
[],[with_gmp=yes])
GMP_CPPFLAGS=
GMP_LDFLAGS=
GMP_LIBS="-lgmp"
AS_CASE([$with_gmp],
[no],[
AC_MSG_ERROR([Building without GMP is not supported])
],
[yes],[],
[*],[
GMP_CPPFLAGS="-I${with_gmp}/include"
GMP_LDFLAGS="-L${with_gmp}/lib"
]
)
AX_CHECK_LIBRARY([GMP], [gmp.h], [gmp], [__gmpz_init],
[],
[AC_MSG_ERROR([GMP not found at prefix $with_gmp])])
AC_SUBST([GMP_CPPFLAGS])
AC_SUBST([GMP_LDFLAGS])
AC_SUBST([GMP_LIBS])
dnl
dnl Other checks
dnl
dnl check for functions dealing with strings and integers
AC_CHECK_FUNCS([strlcpy strlcat])
dnl check whether libm / -lm is available and necessary
AC_SEARCH_LIBS([floor], [m], [], [
AC_MSG_ERROR([unable to find the floor() function])
])
dnl
dnl Finally, generate the Makefiles and output everything
dnl
AC_CONFIG_FILES([Makefile])
AC_OUTPUT