#15697: Upgrade MPC to latest upstream
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  closed
       Priority:  minor              |    Milestone:  sage-6.2
      Component:  packages:          |   Resolution:  fixed
  standard                           |    Merged in:
       Keywords:                     |    Reviewers:  François Bissey
        Authors:  Jeroen Demeyer     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  00a5937b33cd8ad6f1eafbccfbab1d4f73321bf3
  u/jdemeyer/ticket/15697            |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by leif):

 P.S.:  From `m4/mpc.m4`:

 {{{
 #!sh
 #
 # SYNOPSIS
 #
 #
 # MPC_GMP_CC_CFLAGS
 #
 # DESCRIPTION
 #
 # Checks if CC and CFLAGS can be extracted from gmp.h
 # essentially copied from mpfr
 #
 AC_DEFUN([MPC_GMP_CC_CFLAGS], [
    AC_MSG_CHECKING(for CC and CFLAGS in gmp.h)
    # AC_PROG_CPP triggers the search for a C compiler; use hack instead
    for cpp in /lib/cpp gcc cc c99
    do
       test $cpp = /lib/cpp || cpp="$cpp -E"
       echo foo > conftest.c
       if $cpp $CPPFLAGS conftest.c > /dev/null 2> /dev/null ; then
          # Get CC
          echo "#include \"gmp.h\"" >  conftest.c
          echo "MPFR_OPTION __GMP_CC"           >> conftest.c
          GMP_CC=`$cpp $CPPFLAGS conftest.c 2> /dev/null | $EGREP
 MPFR_OPTION | $SED -e 's/MPFR_OPTION //g;s/ *" *//g'`
          # Get CFLAGS
          echo "#include \"gmp.h\"" >  conftest.c
          echo "MPFR_OPTION __GMP_CFLAGS"           >> conftest.c
          GMP_CFLAGS=`$cpp $CPPFLAGS conftest.c 2> /dev/null | $EGREP
 MPFR_OPTION | $SED -e 's/MPFR_OPTION //g;s/ *" *//g'`
          break
       fi
    done

    if test "x$GMP_CFLAGS" = "x__GMP_CFLAGS" -o "x$GMP_CC" = "x__GMP_CC" ;
 then
       AC_MSG_RESULT(no)
       GMP_CC=
       GMP_CFLAGS=
    else
       AC_MSG_RESULT(yes [CC=$GMP_CC CFLAGS=$GMP_CFLAGS])
    fi

    # Check for validity of CC and CFLAGS obtained from gmp.h
    if test -n "$GMP_CC$GMP_CFLAGS" ; then
       AC_MSG_CHECKING(for CC=$GMP_CC and CFLAGS=$GMP_CFLAGS)
       echo "int main (void) { return 0; }" > conftest.c
       if $GMP_CC $GMP_CFLAGS -o conftest conftest.c 2> /dev/null ; then
          AC_MSG_RESULT(yes)
          CC=$GMP_CC
          CFLAGS=$GMP_CFLAGS
       else
          AC_MSG_RESULT(no)
       fi
    fi

    rm -f conftest*
 ])
 }}}

 I don't exactly recall what went wrong, but `configure` gave me something
 like

 {{{
 checking for CC and CFLAGS in gmp.h ... yes CC= CFLAGS=
 }}}

 and finally `gcc` was used (instead of `$CC`, while the same setting was
 recorded in `gmp.h`).

--
Ticket URL: <http://trac.sagemath.org/ticket/15697#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to