source: git/m4/flint-check.m4 @ 2e7e3dc

fieker-DuValspielwiese
Last change on this file since 2e7e3dc was 151154, checked in by Hans Schoenemann <hannes@…>, 4 years ago
add rpath for FLINT in non-default location
  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[97a059]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[
[effb43]16DEFAULT_CHECKING_PATH="/usr /usr/local /sw /opt/local"
[97a059]17
18AC_ARG_WITH(flint,
19[  --with-flint=<path>|yes|no  Use FLINT library. If argument is no, you do not have
[75f460]20                            the library installed on your machine (set as
21                            default). If argument is yes or <empty> that means
22                            the library is reachable with the standard search
23                            path (/usr or /usr/local). Otherwise you give the
24                            <path> to the directory which contain the library.
[97a059]25             ],
[416af8]26             [if test "x$withval" = xyes ; then
[97a059]27                        FLINT_HOME_PATH="${DEFAULT_CHECKING_PATH}"
[416af8]28              elif test "x$withval" != xno ; then
[97a059]29                        FLINT_HOME_PATH="$withval"
[4979482]30             fi],
31             [FLINT_HOME_PATH="${DEFAULT_CHECKING_PATH}"])
[97a059]32
33dnl Check for existence
34BACKUP_CFLAGS=${CFLAGS}
35BACKUP_LIBS=${LIBS}
36
[f30df9]37AC_LANG_PUSH([C])
38
[952bd16]39flint_found="no"
40dnl check for system installed libraries if FLINT_HOME_PATH is the default
41if test "$FLINT_HOME_PATH" = "$DEFAULT_CHECKING_PATH" ; then
42        FLINT_CFLAGS=""
[04975c]43        FLINT_LIBS="-lflint -lmpfr -lgmp"
[75f460]44
[246bbb]45        # we suppose that mpfr and mpir to be in the same place or available by default
[952bd16]46        CFLAGS="${BACKUP_CFLAGS} ${GMP_CPPFLAGS}"
[6ed33f]47        LIBS="${FLINT_LIBS} ${GMP_LIBS} ${BACKUP_LIBS}"
[97a059]48
[952bd16]49        AC_CHECK_HEADER([flint/fmpz.h],
50                [AC_CHECK_LIB(flint,fmpz_init,
51                        [flint_found="yes"],
52                        [],
53                        [])],
54                [],
55                [])
[cee403]56fi
[952bd16]57
58dnl if flint was not previously found, search FLINT_HOME_PATH
59if test "x$flint_found" = "xno" ; then
60        for FLINT_HOME in ${FLINT_HOME_PATH}
61        do
62                if test -r "$FLINT_HOME/include/flint/fmpz.h"; then
63
64                FLINT_CFLAGS="-I${FLINT_HOME}/include/"
[151154]65                FLINT_LIBS="-L${FLINT_HOME}/lib -Wl,-rpath -Wl,${FLINT_HOME}/lib -lflint -lmpfr -lgmp"
[952bd16]66
67        # we suppose that mpfr and mpir to be in the same place or available by default
68                CFLAGS="${BACKUP_CFLAGS} ${FLINT_CFLAGS} ${GMP_CPPFLAGS}"
[6ed33f]69                LIBS="${FLINT_LIBS} ${GMP_LIBS} ${BACKUP_LIBS}"
[952bd16]70
71                AC_CHECK_LIB(flint,fmpz_init,
72                [flint_found="yes"],
73                [],
74                []
75                )
76                fi
77        done
78fi
79
[f30df9]80AC_LANG_POP([C])
81
82CFLAGS=${BACKUP_CFLAGS}
83LIBS=${BACKUP_LIBS}
84#unset LD_LIBRARY_PATH
85
[6b44a8]86AC_MSG_CHECKING(for FLINT)
[97a059]87
[75f460]88if test "x$flint_found" = "xyes" ; then
[97a059]89        AC_DEFINE(HAVE_FLINT,1,[Define if FLINT is installed])
90        HAVE_FLINT=yes
[416af8]91        AC_MSG_RESULT(found)
92else
[97a059]93        AC_MSG_RESULT(not found)
[b8d464]94        FLINT_CFLAGS=""
95        FLINT_LIBS=""
96        FLINT_HOME=""
[75f460]97fi
[b8d464]98AC_SUBST(FLINT_CFLAGS)
99AC_SUBST(FLINT_LIBS)
100AC_SUBST(FLINT_HOME)
[97a059]101])
102
Note: See TracBrowser for help on using the repository browser.