source: git/m4/flint-check.m4 @ 0c26a1

spielwiese
Last change on this file since 0c26a1 was 0c26a1, checked in by Hans Schoenemann <hannes@…>, 3 years ago
Revert "update configure stuff": requires autoconf 2.7.1 This reverts commit 69185ceb2807ebeacfe2824621e4b70e2ed19642.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1# Check for FLINT
2# Bradford Hovinen, 2001-06-13
3# Modified by Pascal Giorgi, 2003-12-03
4# Inspired by gnome-bonobo-check.m4 by Miguel de Icaza, 99-04-12
5# Stolen from Chris Lahey       99-2-5
6# stolen from Manish Singh again
7# stolen back from Frank Belew
8# stolen from Manish Singh
9# Shamelessly stolen from Owen Taylor
10
11dnl Test for FLINT and define
12dnl FLINT_CFLAGS and FLINT_LIBS
13
14AC_DEFUN([LB_CHECK_FLINT],
15[
16AC_REQUIRE([SING_DEFAULT_CHECKING_PATH])
17
18AC_ARG_WITH(flint,
19[  --with-flint=<path>|yes|no  Use FLINT library. By default (yes), Singular will
20                            try to find the library and use it if found.
21                            If argument is no, Singular will not use the
22                            library even if it could be found on your machine.
23                            Otherwise you can give the <path> to the directory
24                            which contains the library.
25             ],
26             [if test "x$withval" = xyes ; then
27                        FLINT_HOME_PATH="DEFAULTS ${DEFAULT_CHECKING_PATH}"
28              elif test "x$withval" != xno ; then
29                        FLINT_HOME_PATH="$withval"
30             fi],
31             [FLINT_HOME_PATH="DEFAULTS ${DEFAULT_CHECKING_PATH}"])
32
33dnl Check for existence
34BACKUP_CFLAGS=${CFLAGS}
35BACKUP_LIBS=${LIBS}
36
37AC_LANG_PUSH([C])
38
39flint_found="no"
40dnl if flint was not previously found, search FLINT_HOME_PATH
41for FLINT_HOME in ${FLINT_HOME_PATH}
42do
43        if test "$FLINT_HOME" = DEFAULTS; then
44                FLINT_CFLAGS=""
45                FLINT_LIBS="-lflint -lmpfr -lgmp"
46        else
47                FLINT_CFLAGS="-I${FLINT_HOME}/include/"
48                FLINT_LIBS="-L${FLINT_HOME}/lib -Wl,-rpath,${FLINT_HOME}/lib -lflint -lmpfr -lgmp"
49        fi
50
51        # we suppose that mpfr and mpir to be in the same place or available by default
52                CFLAGS="${FLINT_CFLAGS} ${GMP_CPPFLAGS} ${BACKUP_CFLAGS}"
53                LIBS="${FLINT_LIBS} ${GMP_LIBS} ${BACKUP_LIBS}"
54
55                AC_TRY_LINK([#include <flint/fmpz.h>
56                            ],
57                            [fmpz_t x; fmpz_init(x);], [
58                        flint_found="yes"
59                        break
60                ])
61done
62
63AC_LANG_POP([C])
64
65CFLAGS=${BACKUP_CFLAGS}
66LIBS=${BACKUP_LIBS}
67#unset LD_LIBRARY_PATH
68
69AC_MSG_CHECKING(for FLINT)
70
71if test "x$flint_found" = "xyes" ; then
72        AC_DEFINE(HAVE_FLINT,1,[Define if FLINT is installed])
73        HAVE_FLINT=yes
74        AC_MSG_RESULT(found)
75else
76        AC_MSG_RESULT(not found)
77        FLINT_CFLAGS=""
78        FLINT_LIBS=""
79        FLINT_HOME=""
80fi
81AC_SUBST(FLINT_CFLAGS)
82AC_SUBST(FLINT_LIBS)
83AC_SUBST(FLINT_HOME)
84])
85
Note: See TracBrowser for help on using the repository browser.