1 # Build recipe for libffcall.
3 # Copyright (c) 2017 MMPG, <mmpg@vp.pl>.
4 # Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/libs"
25 tarname=${program}-${version}.tar.gz
28 fetch=http://ftp.gnu.org/pub/gnu/libffcall/$tarname
31 Foreign function call libraries.
33 GNU libffcall is a collection of four libraries which can be used to
34 build foreign function call interfaces in embedded interpreters:
37 Calling C functions with variable arguments.
40 C functions accepting variable argument prototypes.
43 Closures as first-class C functions.
46 Closures with variable arguments as first-class C functions
47 (a reentrant combination of vacall and trampoline).
50 homepage=http://www.gnu.org/software/libffcall/
53 # Source doucmentation
54 docs="COPYING ChangeLog DEPENDENCIES NEWS README VERSION"
55 docsdir="${docdir}/${program}-${version}"
57 # Set paralell jobs to 1 for a sucessful compilation
64 unpack "${tardir}/$tarname"
68 # Set sane permissions
69 chmod -R u+w,go-w,a+rX-s .
71 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
73 --libdir=/usr/lib${libSuffix} \
76 --htmldir=${docsdir}/html \
79 --build="$(cc -dumpmachine)"
83 make -j${jobs} DESTDIR="$destdir" install
85 #strip --strip-unneeded "${destdir}/usr/lib${libSuffix}"/*.so.0
87 # Compress and link man pages (if needed)
88 if test -d "${destdir}/$mandir"
91 cd "${destdir}/$mandir"
92 find . -type f -exec lzip -9 '{}' +
93 find . -type l | while read -r file
95 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
103 mkdir -p "${destdir}${docsdir}"
105 # Move wrong HTML directory
106 mv "${destdir}/usr/share/html" "${destdir}${docsdir}/"
108 cp -p $docs "${destdir}${docsdir}/"