3 # Copyright (c) 2018-2019, 2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=https://github.com/ivmai/bdwgc/releases/download/v${version}/$tarname
31 #fetch=https://www.hboehm.info/gc/gc_source/$tarname
34 A garbage collector for C and C++.
36 The gc package contains the Boehm-Demers-Weiser conservative garbage
37 collector, which can be used as a garbage collecting replacement for
38 the C malloc function or C++ new operator. It allows you to allocate
39 memory basically as you normally would, without explicitly deallocating
40 memory that is no longer useful. The collector automatically recycles
41 memory when it determines that it can no longer be otherwise accessed.
43 The collector is also used by a number of programming language
44 implementations that either use C as intermediate code, want to
45 facilitate easier interoperation with C libraries, or just prefer the
46 simple collector interface. Alternatively, the garbage collector may
47 be used as a leak detector for C or C++ programs, though that is not
51 homepage=https://www.hboehm.info/gc/
54 # Source documentation
55 docs="AUTHORS ChangeLog" # To complement installed documentation.
56 docsdir="${docdir}/${program}-${version}"
60 unpack "${tardir}/$tarname"
64 # Set sane permissions
65 chmod -R u+w,go-w,a+rX-s .
67 ./configure CPPFLAGS="$QICPPFLAGS" \
68 CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
70 --libdir=/usr/lib${libSuffix} \
76 --enable-threads=posix \
77 --with-libatomic-ops=yes \
78 --build="$(gcc -dumpmachine)"
81 make -j${jobs} DESTDIR="$destdir" install-strip
83 # Compress and link man pages (if needed)
84 if test -d "${destdir}/$mandir"
87 cd "${destdir}/$mandir"
88 find . -type f -exec lzip -9 {} +
89 find . -type l | while read -r file
91 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
98 mkdir -p "${destdir}/$docsdir"
99 cp -p $docs "${destdir}/$docsdir"