Bump zlib to 1.3.1, 1.3 is no longer available.
[harbours.git] / libmpc / HARBOUR
blob9e85fe9fd38dd09f4b36400553990b8e3d29b4ac
2 # Copyright (c) 2013 Vojtech Horky
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
9 # - Redistributions of source code must retain the above copyright
10 #   notice, this list of conditions and the following disclaimer.
11 # - Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # - The name of the author may not be used to endorse or promote products
15 #   derived from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 shipname=libmpc
30 shipname_=mpc
31 shipversion=1.0.1
32 shipsources="ftp://ftp.gnu.org/gnu/${shipname_}/${shipname_}-${shipversion}.tar.gz"
33 shiptugs="libgmp libmpfr"
34 shipfunnels=4
36 build() {
37         run tar xzf ${shipname_}-${shipversion}.tar.gz
38         cd ${shipname_}-${shipversion}
39         
40         cp $HSCT_CONFIG_SUB .
41         run ./configure \
42                 $HSCT_CONFIGURE_ARGS \
43                 --disable-shared \
44                 || return 1
45         
46         msg "Building the library..."
47         run make -j$shipfunnels STATIC_ONLY=y
48         
49         msg "Building the tests..."
50         run make check || true
51         
52         (
53                 cd tests
54                 find tabs tacos tacosh tadd tadd_fr tadd_si tadd_ui targ tasin    \
55                         tasinh tatan tatanh tconj tcos tcosh tdiv tdiv_2si tdiv_2ui tdiv_fr tdiv_ui   \
56                         texp tfma tfr_div tfr_sub timag tio_str tlog tlog10                           \
57                         tmul tmul_2si tmul_2ui tmul_fr tmul_i tmul_si tmul_ui                         \
58                         tneg tnorm tpow tpow_ld tpow_d tpow_fr tpow_si tpow_ui tpow_z                 \
59                         tprec tproj treal treimref tset tsin tsin_cos tsinh tsqr tsqrt tstrtoc tsub   \
60                         tsub_fr tsub_ui tswap ttan ttanh tui_div tui_ui_sub tget_version
61                 exit $?
62         )
65 package() {
66         cd ${shipname_}-${shipversion}
67         
68         msg "Pretending standard Unix installation..."
69         run make install DESTDIR=$PWD/PKG
70         
71         # Copy the headers and static library
72         msg "Copying relevant files to the coast..."
73         run cp PKG/usr/local/include/mpc.h "$HSCT_INCLUDE_DIR/"
74         run cp PKG/usr/local/lib/libmpc.a "$HSCT_LIB_DIR/"
75         
76         run mkdir -p "$HSCT_MY_DIR/inc/c"
77         run cp PKG/usr/local/include/mpc.h "$HSCT_MY_DIR/inc/c"
78         
79         run mkdir -p "$HSCT_MY_DIR/lib"
80         run cp PKG/usr/local/lib/libmpc.a "$HSCT_MY_DIR/lib"
81         
82         # Copy the tests
83         (
84                 msg "Preparing tests..."
85                 run mkdir -p "$HSCT_MY_DIR/tests/${shipname}/"
86                 cd tests
87                 echo "echo Running ${shipname} tests..." >"$HSCT_MY_DIR/tests/run_${shipname}.bdsh"
88                 find . -executable -type f | while read testname; do
89                         run cp "$testname" "$HSCT_MY_DIR/tests/${shipname}/$testname" || exit 1
90                         echo "/tests/${shipname}/$testname" | sed 's#\./##' >>"$HSCT_MY_DIR/tests/run_${shipname}.bdsh"
91                 done || exit 1
92         )