File: configure.ac

package info (click to toggle)
ratpoints 1:2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 572 kB
  • ctags: 230
  • sloc: ansic: 4,201; makefile: 155
file content (75 lines) | stat: -rw-r--r-- 2,036 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
69
70
71
72
73
74
75
AC_INIT(ratpoints, 2.1.3)
AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE([])

AC_MSG_NOTICE([Configuring ratpoints...])

dnl use "make V=1" if you want to see the long awful lines
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

dnl the following will make sure we can compile C code
dnl (and with various options for the same file depending on the target)
AC_LANG(C)
AC_PROG_CC_C99
AM_PROG_CC_C_O

AC_PROG_INSTALL

dnl handle compiler flags
if test ".$ac_cv_c_compiler_gnu" = .yes; then
   CFLAGS="$CFLAGS -Wall -O2 -fomit-frame-pointer -funroll-loops"
   case $target_os in
   darwin*)
	CFLAGS="$CFLAGS -fnested-functions"
	;;
   esac
fi

dnl libtool will take care of building libraries
LT_INIT
dnl the following will add -lm to link lines if needed:
LT_LIB_M

dnl ********************************
dnl Find the gmp library
dnl ********************************

dnl let the user tell where it is if (s)he wants
AC_ARG_WITH(gmp,
	[AS_HELP_STRING([--with-gmp=<path>],
			[prefix of GMP installation, e.g. /usr/local or /usr])],
	with_gmp_dir="$withval",
	with_gmp_dir="/usr")

dnl allow for GMP headers in a non-standard location
AC_ARG_WITH(gmp-headers,
	[AS_HELP_STRING([--with-gmp-headers=<path>],
			[location of the GMP headers, the default is ${gmp_dir}/include])],
	with_gmp_header_dir="$withval",
	with_gmp_header_dir="${with_gmp_dir}/include")

dnl see if the header is available
AC_MSG_CHECKING(for GMP includes in ${with_gmp_header_dir}/)
if test -f ${with_gmp_header_dir}/gmp.h; then
  GMP_CFLAGS="-I${with_gmp_header_dir}"
  AC_MSG_RESULT(found)
else
  AC_MSG_RESULT(not found)
  AC_MSG_ERROR([You need the GMP headers to compile ratpoints])
fi

dnl see if the library is available
LIBS_save="${LIBS}"
LIBS="${LIBS} -L${with_gmp_dir}/${libname}/ -lgmp"
AC_CHECK_LIB(gmp, __gmpz_init, gmp_libs="yes", gmp_libs="no")
LIBS="${LIBS_save}"
if test "x${gmp_libs}" != "xno"; then
  GMP_LIBS="-lgmp"
else
  AC_MSG_ERROR([You need the GMP libraries to compile ratpoints])
fi
AC_SUBST(GMP_CFLAGS)
AC_SUBST(GMP_LIBS)

AC_OUTPUT(Makefile)