source: git/m4/flint-check.m4 @ 69185ce

spielwiese
Last change on this file since 69185ce was 69185ce, checked in by Hans Schoenemann <hannes@…>, 3 years ago
update configure stuff
  • 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_LINK_IFELSE([AC_LANG_PROGRAM([[#include <flint/fmpz.h>
56                            ]], [[fmpz_t x; fmpz_init(x);]])],[
57                        flint_found="yes"
58                        break
59                ],[])
60done
61
62AC_LANG_POP([C])
63
64CFLAGS=${BACKUP_CFLAGS}
65LIBS=${BACKUP_LIBS}
66#unset LD_LIBRARY_PATH
67
68AC_MSG_CHECKING(for FLINT)
69
70if test "x$flint_found" = "xyes" ; then
71        AC_DEFINE(HAVE_FLINT,1,[Define if FLINT is installed])
72        HAVE_FLINT=yes
73        AC_MSG_RESULT(found)
74else
75        AC_MSG_RESULT(not found)
76        FLINT_CFLAGS=""
77        FLINT_LIBS=""
78        FLINT_HOME=""
79fi
80AC_SUBST(FLINT_CFLAGS)
81AC_SUBST(FLINT_LIBS)
82AC_SUBST(FLINT_HOME)
83])
84
Note: See TracBrowser for help on using the repository browser.