File: configure.ac

package info (click to toggle)
cysignals 1.3.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 504 kB
  • sloc: ansic: 485; python: 442; makefile: 300; sh: 41
file content (54 lines) | stat: -rw-r--r-- 1,679 bytes parent folder | download | duplicates (2)
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
dnl Not sure which autoconf version we need, but 2.69 (from 2012)
dnl is widely available.
AC_PREREQ([2.69])

AC_DEFUN([VERSION], m4_esyscmd_s(cat VERSION))

AC_INIT([cysignals], VERSION, [https://github.com/sagemath/cysignals/issues])
AC_COPYRIGHT([GNU Lesser General Public License version 3 or later])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([src/config.h src/cysignals/debug.h])

AC_ARG_ENABLE(debug,
        AS_HELP_STRING([--enable-debug], [enable debug output]))

if test "$enable_debug" = yes; then
    AC_DEFINE([ENABLE_DEBUG_CYSIGNALS], 1, [Enable debug output])
fi

AC_LANG(C)

AC_CHECK_HEADERS([execinfo.h sys/prctl.h])
AC_CHECK_FUNCS([backtrace])

AM_PATH_PARI([2.9],
	[AC_DEFINE(HAVE_PARI, 1, [Define to 1 if PARI is fully supported.])],
	[AC_MSG_WARN([no suitable PARI library found])])

AC_MSG_CHECKING([for emms instruction])
# We add the "leal" instruction to reduce false positives in case some
# non-x86 architecture also has an "emms" instruction.
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [asm("leal (%eax), %eax; emms");])],
    dnl YES
    [AC_MSG_RESULT([yes])]
    AC_DEFINE(HAVE_EMMS, 1, [Define to 1 if your processor understands the "emms" instruction.])
    ,
    dnl NO
    [AC_MSG_RESULT([no])]
)


AC_CONFIG_COMMANDS([src/cysignals/__init__.pxd],
    # Generate a file __init__.pxd to set correct compiler options.
    [[
			echo "# distutils: extra_compile_args = $EXTRACOMPILEARGS" > src/cysignals/__init__.pxd
			echo "# distutils: extra_link_args = $EXTRALINKARGS" >> src/cysignals/__init__.pxd
		]],
    [
			EXTRACOMPILEARGS="$PARI_CPPFLAGS $PARI_CFLAGS"
			EXTRALINKARGS="$PARI_LDFLAGS $PARI_LIBS"
		])

AC_OUTPUT()

dnl vim:syntax=m4