|
| 1 | +#!/bin/bash -ex |
| 2 | +# Copyright (c) 2014-2016 Arduino LLC |
| 3 | +# |
| 4 | +# This program is free software; you can redistribute it and/or |
| 5 | +# modify it under the terms of the GNU General Public License |
| 6 | +# as published by the Free Software Foundation; either version 2 |
| 7 | +# of the License, or (at your option) any later version. |
| 8 | +# |
| 9 | +# This program is distributed in the hope that it will be useful, |
| 10 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | +# GNU General Public License for more details. |
| 13 | +# |
| 14 | +# You should have received a copy of the GNU General Public License |
| 15 | +# along with this program; if not, write to the Free Software |
| 16 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | + |
| 18 | +mkdir -p objdir |
| 19 | +cd objdir |
| 20 | +PREFIX=`pwd` |
| 21 | +cd - |
| 22 | + |
| 23 | +if [[ ! -f ncurses-6.0.tar.gz ]] ; |
| 24 | +then |
| 25 | + wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz |
| 26 | +fi |
| 27 | + |
| 28 | +tar xfv ncurses-6.0.tar.gz |
| 29 | + |
| 30 | +cd ncurses-6.0 |
| 31 | +CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" |
| 32 | +if [[ $CROSS_COMPILE != "" ]] ; then |
| 33 | + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" |
| 34 | + # solve bug with --host not being effective on second level directory |
| 35 | + export CC=$CROSS_COMPILE_HOST-gcc |
| 36 | + export AR=$CROSS_COMPILE_HOST-ar |
| 37 | + export RANLIB=$CROSS_COMPILE_HOST-ranlib |
| 38 | +fi |
| 39 | +CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS |
| 40 | +make -j 4 |
| 41 | +make install |
| 42 | +cd .. |
| 43 | + |
| 44 | +if [[ ! -f readline-7.0.tar.gz ]] ; |
| 45 | +then |
| 46 | + wget https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz |
| 47 | +fi |
| 48 | + |
| 49 | +tar xfv readline-7.0.tar.gz |
| 50 | + |
| 51 | +cd readline-7.0 |
| 52 | +CONFARGS="--prefix=$PREFIX --disable-shared" |
| 53 | +if [[ $CROSS_COMPILE != "" ]] ; then |
| 54 | + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" |
| 55 | + # solve bug with --host not being effective on second level directory |
| 56 | + export CC=$CROSS_COMPILE_HOST-gcc |
| 57 | + export AR=$CROSS_COMPILE_HOST-ar |
| 58 | + export RANLIB=$CROSS_COMPILE_HOST-ranlib |
| 59 | +fi |
| 60 | +CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS |
| 61 | +make -j 4 |
| 62 | +make install |
| 63 | +cd .. |
| 64 | + |
0 commit comments