/[gentoo-x86]/eclass/bsdmk.eclass
Gentoo

Contents of /eclass/bsdmk.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Apr 1 15:24:18 2006 UTC (8 years, 8 months ago) by flameeyes
Branch: MAIN
Add bsdmk and freebsd eclass needed for Gentoo/FreeBSD.

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4 #
5 # Otavio R. Piske "AngusYoung" <angusyoung@gentoo.org>
6 # Diego Pettenò <flameeyes@gentoo.org>
7 # Benigno B. Junior <bbj@gentoo.org>
8
9 inherit toolchain-funcs portability
10
11 EXPORT_FUNCTIONS src_compile src_install
12
13 # this should actually be BDEPEND, but this works.
14 DEPEND="!userland_BSD? ( sys-devel/pmake )"
15
16 #### append-opt <options>
17 # append options to enable or disable features
18 #
19 ###########################################################################
20 append-opt() {
21 mymakeopts="${mymakeopts} $@"
22 }
23
24 #### mkmake <options>
25 # calls bsd-make command with the given options, passing ${mymakeopts} to
26 # enable ports to useflags bridge.
27 #
28 ###########################################################################
29 mkmake() {
30 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
31
32 tc-export CC CXX LD RANLIB
33
34 ${BMAKE} ${MAKEOPTS} ${EXTRA_EMAKE} ${mymakeopts} NO_WERROR= "$@"
35 }
36
37 mkinstall() {
38 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
39
40 ${BMAKE} ${mymakeopts} NO_WERROR= DESTDIR="${D}" "$@" install
41 }
42
43 #### dummy_mk <dirnames>
44 # removes the specified subdirectories and creates a dummy makefile in them
45 # useful to remove the need for "minimal" patches
46 #
47 ############################################################################
48 dummy_mk() {
49 for dir in $@; do
50 echo ".include <bsd.lib.mk>" > ${dir}/Makefile
51 done
52 }
53
54 #### fix_lazy_bindings <dirnames>
55 # set LDFLAGS in order to fix lazy binding warnings in binaries
56 #
57 ############################################################################
58 fix_lazy_bindings() {
59 for dir in $@; do
60 echo "LDFLAGS+= -Wl,-z,now" >> ${dir}/Makefile
61 done
62 }
63
64 bsdmk_src_compile() {
65 cd ${S}
66 mkmake || die "make failed"
67 }
68
69 bsdmk_src_install() {
70 cd ${S}
71 mkinstall || die "install failed"
72 }

  ViewVC Help
Powered by ViewVC 1.1.20