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

Contents of /eclass/bsdmk.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sat Apr 22 21:14:50 2006 UTC (8 years, 6 months ago) by flameeyes
Branch: MAIN
Changes since 1.3: +3 -1 lines
Make sure BSD'ish sed is used by default.

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

  ViewVC Help
Powered by ViewVC 1.1.20