scripts/build/companion_libs/mpfr.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 27 21:16:01 2009 +0000 (2009-05-27)
branchgcc-4.4
changeset 1393 b432bd628b10
parent 1376 c4be9b880304
child 1422 ff866c9faad2
permissions -rw-r--r--
/devel/gcc-4.4:
- add gcc-4.4.0 patches, vampirised from the Gentoo patchset
- gcc-4.4.0 auto-selects and uses appropriate companion linraries

-------- diffstat follows --------
/devel/gcc-4.4/scripts/build/cc/gcc.sh | 20 18 2 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/280-freebsd.patch | 188 188 0 0 ++++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/140-default-format-security.patch | 98 98 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/290-freebsd.patch | 128 128 0 0 +++++++
/devel/gcc-4.4/patches/gcc/4.4.0/310-uclibc-conf.patch | 70 70 0 0 ++++
/devel/gcc-4.4/patches/gcc/4.4.0/240-libstdc++-pic.patch | 106 106 0 0 ++++++
/devel/gcc-4.4/patches/gcc/4.4.0/260-sh-libgcc-stacks.patch | 50 50 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/100-alpha-mieee-default.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/180-libgomp-no-werror.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/170-sparc64-bsd.patch | 58 58 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/200-libiberty.h-asprintf.patch | 30 30 0 0 ++
/devel/gcc-4.4/patches/gcc/4.4.0/220-libiberty-pic.patch | 22 22 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/110-trampolinewarn.patch | 54 54 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/160-netbsd-symbolic.patch | 22 22 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/190-flatten-switch-stmt-00.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/150-default-fortify-source.patch | 52 52 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/340-libmudflap-susv3-legacy.patch | 96 96 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/120-java-nomulti.patch | 92 92 0 0 +++++
/devel/gcc-4.4/patches/gcc/4.4.0/270-sh-pr24836.patch | 48 48 0 0 +++
/devel/gcc-4.4/patches/gcc/4.4.0/330-c99-snprintf.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/230-superh-default-multilib.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/250-ia64-noteGNUstack.patch | 158 158 0 0 +++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/300-pr40105.patch | 360 360 0 0 ++++++++++++++++++++
/devel/gcc-4.4/patches/gcc/4.4.0/210-arm-unbreak-armv4t.patch | 24 24 0 0 +
/devel/gcc-4.4/patches/gcc/4.4.0/130-cross-compile.patch | 78 78 0 0 ++++
/devel/gcc-4.4/patches/gcc/4.4.0/320-missing-execinfo_h.patch | 24 24 0 0 +
/devel/gcc-4.4/config/cc/gcc.in | 1 1 0 0 +
27 files changed, 1945 insertions(+), 2 deletions(-)
     1 # This file adds the functions to build the MPFR library
     2 # Copyright 2008 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 do_mpfr_get() { :; }
     6 do_mpfr_extract() { :; }
     7 do_mpfr() { :; }
     8 do_mpfr_target() { :; }
     9 
    10 # Overide function depending on configuration
    11 if [ "${CT_GMP_MPFR}" = "y" ]; then
    12 
    13 # Download MPFR
    14 do_mpfr_get() {
    15     CT_GetFile "mpfr-${CT_MPFR_VERSION}" http://www.mpfr.org/mpfr-current/  \
    16                                  http://www.mpfr.org/mpfr-${CT_MPFR_VERSION}/
    17 }
    18 
    19 # Extract MPFR
    20 do_mpfr_extract() {
    21     CT_Extract "mpfr-${CT_MPFR_VERSION}"
    22     CT_Patch "mpfr-${CT_MPFR_VERSION}"
    23 
    24     # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    25     # same version number. Unfortunately, some tarballs of MPFR are not
    26     # built sanely, and thus ./configure fails on Gentoo.
    27     # See: http://sourceware.org/ml/crossgcc/2008-05/msg00080.html
    28     # and: http://sourceware.org/ml/crossgcc/2008-06/msg00005.html
    29     # This hack is not bad per se, but the MPFR guys would be better not to
    30     # do that in the future...
    31     # It seems that MPFR >= 2.4.0 do not need this...
    32     case "${CT_MPFR_VERSION}" in
    33         1.*|2.0.*|2.1.*|2.2.*|2.3.*)
    34             CT_Pushd "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}"
    35             if [ ! -f .autotools.ct-ng ]; then
    36                 CT_DoLog DEBUG "Re-building autotools files"
    37                 CT_DoExecLog ALL autoreconf -fi
    38                 # Starting with libtool-1.9f, config.{guess,sub} are no longer
    39                 # installed without -i, but starting with libtool-2.2.6, they
    40                 # are no longer removed without -i. Sight... Just use -i with
    41                 # libtool >=2
    42                 # See: http://sourceware.org/ml/crossgcc/2008-11/msg00046.html
    43                 # and: http://sourceware.org/ml/crossgcc/2008-11/msg00048.html
    44                 libtoolize_opt=
    45                 case "$(libtoolize --version |head -n 1 |awk '{ print $(NF); }')" in
    46                     0.*)    ;;
    47                     1.*)    ;;
    48                     *)      libtoolize_opt=-i;;
    49                 esac
    50                 CT_DoExecLog ALL libtoolize -f ${libtoolize_opt}
    51                 touch .autotools.ct-ng
    52             fi
    53             CT_Popd
    54             ;;
    55     esac
    56 }
    57 
    58 do_mpfr() {
    59     mkdir -p "${CT_BUILD_DIR}/build-mpfr"
    60     cd "${CT_BUILD_DIR}/build-mpfr"
    61 
    62     CT_DoStep INFO "Installing MPFR"
    63 
    64     mpfr_opt=
    65     # Under Cygwin, we can't build a thread-safe library
    66     case "${CT_HOST}" in
    67         *-cygwin)   mpfr_opt="--disable-thread-safe";;
    68         *)          mpfr_opt="--enable-thread-safe";;
    69     esac
    70 
    71     CT_DoLog EXTRA "Configuring MPFR"
    72     CC="${CT_HOST}-gcc"                                 \
    73     CFLAGS="${CT_CFLAGS_FOR_HOST}"                      \
    74     CT_DoExecLog ALL                                    \
    75     "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure"   \
    76         --build=${CT_BUILD}                             \
    77         --host=${CT_HOST}                               \
    78         --prefix="${CT_PREFIX_DIR}"                     \
    79         ${mpfr_opt}                                     \
    80         --enable-shared                                 \
    81         --disable-static                                \
    82         --with-gmp="${CT_PREFIX_DIR}"
    83 
    84     CT_DoLog EXTRA "Building MPFR"
    85     CT_DoExecLog ALL make ${PARALLELMFLAGS}
    86 
    87     if [ "${CT_COMP_LIBS_CHECK}" = "y" ]; then
    88         CT_DoLog EXTRA "Checking MPFR"
    89         CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
    90     fi
    91 
    92     CT_DoLog EXTRA "Installing MPFR"
    93     CT_DoExecLog ALL make install
    94 
    95     CT_EndStep
    96 }
    97 
    98 if [ "${CT_COMP_LIBS_TARGET}" = "y" ]; then
    99 
   100 do_mpfr_target() {
   101     mkdir -p "${CT_BUILD_DIR}/build-mpfr-target"
   102     cd "${CT_BUILD_DIR}/build-mpfr-target"
   103 
   104     CT_DoStep INFO "Installing MPFR for the target"
   105 
   106     mpfr_opt=
   107     # Under Cygwin, we can't build a thread-safe library
   108     case "${CT_TARGET}" in
   109         *-cygwin)   mpfr_opt="--disable-thread-safe";;
   110         *)          mpfr_opt="--enable-thread-safe";;
   111     esac
   112 
   113     CT_DoLog EXTRA "Configuring MPFR"
   114     CC="${CT_TARGET}-gcc"                               \
   115     CFLAGS="${CT_CFLAGS_FOR_TARGET}"                    \
   116     CT_DoExecLog ALL                                    \
   117     "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure"   \
   118         --build=${CT_BUILD}                             \
   119         --host=${CT_TARGET}                             \
   120         --prefix=/usr                                   \
   121         ${mpfr_opt}                                     \
   122         --disable-shared                                \
   123         --enable-static                                 \
   124         --with-gmp="${CT_SYSROOT_DIR}/usr"
   125 
   126     CT_DoLog EXTRA "Building MPFR"
   127     CT_DoExecLog ALL make ${PARALLELMFLAGS}
   128 
   129     # Not possible to check MPFR while X-compiling
   130 
   131     CT_DoLog EXTRA "Installing MPFR"
   132     CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" install
   133 
   134     CT_EndStep
   135 }
   136 
   137 fi # CT_GMP_MPFR_TARGET == y
   138 
   139 fi # CT_GMP_MPFR == y