Ignore:
Timestamp:
02/07/17 16:15:55 (8 years ago)
Author:
Edwin Eefting <edwin@datux.nl>
Branches:
master, perl-5.22
Children:
a9c55d3
Parents:
d2a077a
Message:

upgrade glibc/gcc to gcc 5.4.0 and glibc 2.24

File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/system/gmp/gmp.SlackBuild

    rd2a077a r1a19ecd  
    1 #!/bin/sh
     1#!/bin/bash
     2#
     3# Automaticly created by importpackage v1.0
     4# Imported from: http://mirrors.slackware.com/slackware/slackware-current/source/l/gmp/
     5# Created at Mon Jan 30 23:49:35 CET 2017
    26
    3 # Copyright 2008, 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
    4 # All rights reserved.
    5 #
    6 # Redistribution and use of this script, with or without modification, is
    7 # permitted provided that the following conditions are met:
    8 #
    9 # 1. Redistributions of this script must retain the above copyright
    10 #    notice, this list of conditions and the following disclaimer.
    11 #
    12 #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
    13 #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    14 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
    15 #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    16 #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    17 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    18 #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    19 #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    20 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    21 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    227
    23 # Modified 2011 by Eric Hameleers <alien at slackware.com> for ARM port.
    24 
    25 VERSION=${VERSION:-$(echo gmp-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
    26 BUILD=${BUILD:-1}
    27 
    28 # Automatically determine the architecture we're building on:
    29 MARCH=$( uname -m )
    30 if [ -z "$ARCH" ]; then
    31   case "$MARCH" in
    32     i?86)    export ARCH=i486 ;;
    33     armv7hl) export ARCH=$MARCH ;;
    34     arm*)    export ARCH=arm ;;
    35     # Unless $ARCH is already set, use uname -m for all other archs:
    36     *)       export ARCH=$MARCH ;;
    37   esac
    38 fi
    39 
    40 NUMJOBS=${NUMJOBS:-" -j7 "}
    41 
    42 CWD=$(pwd)
    43 TMP=${TMP:-/tmp}
    44 PKG=/$TMP/package-gmp
    45 rm -rf $PKG
    46 mkdir -p $TMP $PKG/usr
    47 
    48 if [ "$ARCH" = "i486" ]; then
    49   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
    50   LIBDIRSUFFIX=""
    51 elif [ "$ARCH" = "s390" ]; then
    52   SLKCFLAGS="-O2"
    53   LIBDIRSUFFIX=""
    54 elif [ "$ARCH" = "x86_64" ]; then
    55   SLKCFLAGS="-O2 -fPIC"
    56   LIBDIRSUFFIX="64"
    57 elif [ "$ARCH" = "armv7hl" ]; then
    58   SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
    59   LIBDIRSUFFIX=""
    60 else
    61   SLKCFLAGS="-O2"
    62   LIBDIRSUFFIX=""
    63 fi
    64 
    65 case "$ARCH" in
    66     arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
    67     *)    TARGET=$ARCH-slackware-linux ;;
    68 esac
    69 
    70 cd $TMP
    71 rm -rf gmp-$VERSION
    72 tar xvf $CWD/gmp-$VERSION.tar.xz || exit 1
    73 cd gmp-$VERSION
    74 chown -R root:root .
    75 find . \
    76   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
    77   -exec chmod 755 {} \; -o \
    78   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
    79   -exec chmod 644 {} \;
    80 
    81 # End of preparations
    82 if echo "$*" | grep -qw -- --prep ; then
    83   exit 0
    84 fi
    85 
    86 CFLAGS="$SLKCFLAGS" \
    87 ./configure \
    88   --prefix=/usr \
    89   --libdir=/usr/lib${LIBDIRSUFFIX} \
    90   --infodir=/usr/info \
    91   --with-gnu-ld \
    92   --enable-cxx \
    93   --build=$TARGET
    94 
    95 make $NUMJOBS || make || exit 1
    96 make install DESTDIR=$PKG || exit 1
    97 
    98 rm $PKG/usr/info/dir
    99 gzip -9 $PKG/usr/info/*
    100 
    101 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
    102   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
    103 
    104 mkdir -p $PKG/usr/doc/gmp-$VERSION
    105 cp -a \
    106   AUTHORS COPYING* NEWS README \
    107   $PKG/usr/doc/gmp-$VERSION
    108 
    109 # If there's a ChangeLog, installing at least part of the recent history
    110 # is useful, but don't let it get totally out of control:
    111 if [ -r ChangeLog ]; then
    112   DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
    113   cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
    114   touch -r ChangeLog $DOCSDIR/ChangeLog
    115 fi
    116 
    117 mkdir -p $PKG/install
    118 cat $CWD/slack-desc > $PKG/install/slack-desc
    119 
    120 cd /$TMP/package-gmp
    121 /sbin/makepkg -l y -c n $TMP/gmp-$VERSION-$ARCH-$BUILD.txz
    122 
    123 ############ syn3 patches
    124 
    125 ln -s libgmp.so.10 /tmp/package-gmp/usr/lib/libgmp.so.3 || exit 1
     8########### source original slackbuild (hopefully we dont need to modify it)
     9CWD=`pwd`
     10set -e
     11source ./gmp.SlackBuild.orig
    12612
    12713
     
    12915cd $CWD
    13016for PKG in /tmp/package-*; do
    131         NAME=`echo $PKG| sed 's/.*-//'`
     17        NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/g'`
    13218
    13319        #seperate dev-package
Note: See TracChangeset for help on using the changeset viewer.