Changeset 952bd16 in git


Ignore:
Timestamp:
Feb 19, 2020, 12:32:54 AM (4 years ago)
Author:
François Bissey <frp.bissey@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
5e781fbc9e5660907bb073083a509b84a3cb2864
Parents:
f051930c5ecfb853e0c8fdfb602c026c3727ddf9
Message:
sane detection for standard paths installation of flint
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/flint-check.m4

    rf051930 r952bd16  
    1414AC_DEFUN([LB_CHECK_FLINT],
    1515[
    16 DEFAULT_CHECKING_PATH="/usr /usr/local /sw /opt/local"
     16DEFAULT_CHECKING_PATH="/sw /opt/local"
    1717
    1818AC_ARG_WITH(flint,
     
    4141AC_LANG_PUSH([C])
    4242
    43 for FLINT_HOME in ${FLINT_HOME_PATH}
    44  do
    45  if test -r "$FLINT_HOME/include/flint/fmpz.h"; then
    46 
    47         FLINT_CFLAGS="-I${FLINT_HOME}/include/"
    48         FLINT_LIBS="-L${FLINT_HOME}/lib -lflint -lmpfr"
     43flint_found="no"
     44dnl check for system installed libraries if FLINT_HOME_PATH is the default
     45if test "$FLINT_HOME_PATH" = "$DEFAULT_CHECKING_PATH" ; then
     46        FLINT_CFLAGS=""
     47        FLINT_LIBS="-lflint -lmpfr"
    4948
    5049        # we suppose that mpfr and mpir to be in the same place or available by default
    51         CFLAGS="${BACKUP_CFLAGS} ${FLINT_CFLAGS} ${GMP_CPPFLAGS}"
     50        CFLAGS="${BACKUP_CFLAGS} ${GMP_CPPFLAGS}"
    5251        LIBS="${FLINT_LIBS} ${GMP_LIBS} ${BACKUPLIBS}"
    5352
    54         AC_CHECK_LIB(flint,fmpz_init,
    55         [flint_found="yes"],
    56         [flint_found="mo"],
    57         []
    58         )
    59 else
    60         flint_found="no"
     53        AC_CHECK_HEADER([flint/fmpz.h],
     54                [AC_CHECK_LIB(flint,fmpz_init,
     55                        [flint_found="yes"],
     56                        [],
     57                        [])],
     58                [],
     59                [])
    6160fi
    62 done
     61
     62dnl if flint was not previously found, search FLINT_HOME_PATH
     63if test "x$flint_found" = "xno" ; then
     64        for FLINT_HOME in ${FLINT_HOME_PATH}
     65        do
     66                if test -r "$FLINT_HOME/include/flint/fmpz.h"; then
     67
     68                FLINT_CFLAGS="-I${FLINT_HOME}/include/"
     69                FLINT_LIBS="-L${FLINT_HOME}/lib -lflint -lmpfr"
     70
     71        # we suppose that mpfr and mpir to be in the same place or available by default
     72                CFLAGS="${BACKUP_CFLAGS} ${FLINT_CFLAGS} ${GMP_CPPFLAGS}"
     73                LIBS="${FLINT_LIBS} ${GMP_LIBS} ${BACKUPLIBS}"
     74
     75                AC_CHECK_LIB(flint,fmpz_init,
     76                [flint_found="yes"],
     77                [],
     78                []
     79                )
     80                fi
     81        done
     82fi
     83
    6384AC_LANG_POP([C])
    6485
Note: See TracChangeset for help on using the changeset viewer.