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

Contents of /eclass/autotools.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Fri Feb 28 09:15:04 2003 UTC (11 years, 9 months ago) by vapier
Branch: MAIN
Changes since 1.8: +4 -4 lines
unfix earlier fixes

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.8 2003/02/18 09:00:45 carpaski Exp $
4 #
5 # Author: Martin Schlemmer <azarah@gentoo.org>
6 #
7 # The autotools eclass enables building of the apps that needs the latest autconf/automake.
8 #
9 # NOTES:
10 #
11 # This eclass was made to bridge the incompadibility problem of autoconf-2.13,
12 # autoconf-2.5x and automake-1.4x, automake-1.5x. Most packages needs
13 # autoconf-2.13 and automake-1.4x, but cannot work with the latest versions
14 # of these packages due to incompadibility, thus when we have a package that
15 # needs the latest versions of automake and autoconf, it begins to get a
16 # problem.
17 #
18 #
19 # Commented Example:
20 #
21 # The following is a commented template for how to use this eclass:
22 #
23 # #<cut here>
24 # # Copyright 1999-2002 Gentoo Technologies, Inc.
25 # # Distributed under the terms of the GNU General Public License, v2 or later
26 # # Maintainer: John Doe <john@foo.com>
27 # # $Header: /home/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.8 2003/02/18 09:00:45 carpaski Exp $
28 #
29 # # If you need to set the versions different from in here, it *must*
30 # # be done before inherit.eclass is sourced
31 # #ACONFVER=2.52f
32 # #AMAKEVER=1.5b
33 #
34 # # Source inherit.eclass and inherit AutoTools
35 # . /usr/portage/eclass/inherit.eclass
36 # inherit autotools
37 #
38 # # This is pretty standard.
39 # S=${WORKDIR}/${P}
40 # DESCRIPTION="My Application"
41 #
42 # # Here you *NEED* to have $SRC_URI as a source url to include the automake
43 # # and autoconf source tarballs
44 # SRC_URI="${SRC_URI}
45 # http://download.foo.com/files/${P}.tar.gz"
46 #
47 # HOMEPAGE="http://www.foo.com/"
48 #
49 # # Here you *NEED* to have "$DEPEND" as an depend to include the dependancies
50 # # of automake and autoconf.
51 # DEPEND="${DEPEND}
52 # foo-libs/libfoo"
53 #
54 # src_compile() {
55 #
56 # # This will install automake and autoconf in a tempory directory and
57 # # setup the environment. Do not forget!!!!!!!
58 # install_autotools
59 #
60 # # Now like normal
61 # ./configure --host=${CHOST} \
62 # --prefix=/usr || die
63 # emake || die
64 # }
65 #
66 # src_install() {
67 #
68 # # Still pretty standard to how you would normally do it
69 # make DESTDIR=${D} install || die
70 # dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
71 # }
72 # #<cut here>
73 #
74
75
76 ECLASS=autotools
77 INHERITED="$INHERITED $ECLASS"
78
79 #[ -z "$ACONFVER" ] && ACONFVER=2.52f
80 #[ -z "$AMAKEVER" ] && AMAKEVER=1.5b
81 [ -z "$ACONFVER" ] && die "!!! You need to set \$ACONFVER *before* inheriting the eclass !!!"
82 [ -z "$AMAKEVER" ] && die "!!! You need to set \$AMAKEVER *before* inheriting the eclass !!!"
83
84 DESCRIPTION="Based on the $ECLASS eclass"
85 #ASRC_URI="ftp://ftp.gnu.org/gnu/autoconf/autoconf-${ACONFVER}.tar.bz2
86 # ftp://alpha.gnu.org/gnu/autoconf/autoconf-${ACONFVER}.tar.bz2
87 # ftp://ftp.gnu.org/gnu/automake/automake-${AMAKEVER}.tar.bz2
88 # ftp://alpha.gnu.org/gnu/automake/automake-${AMAKEVER}.tar.bz2"
89 SRC_URI="ftp://ftp.gnu.org/gnu/autoconf/autoconf-${ACONFVER}.tar.bz2
90 ftp://alpha.gnu.org/gnu/autoconf/autoconf-${ACONFVER}.tar.bz2
91 ftp://ftp.gnu.org/gnu/automake/automake-${AMAKEVER}.tar.bz2
92 ftp://alpha.gnu.org/gnu/automake/automake-${AMAKEVER}.tar.bz2"
93
94 DEPEND="sys-devel/make
95 sys-devel/perl
96 >=sys-devel/m4-1.4o-r2"
97
98
99 AUTO_S="${WORKDIR}"
100 AUTO_D="${T}/autotools"
101
102 fetch_autotools() {
103
104 local y
105 for y in ${ASRC_URI}
106 do
107 if [ ! -e ${DISTDIR}/${y##*/} ]
108 then
109 echo ">>> Fetching ${y##*/}..."
110 echo
111 local x
112 local _SRC_URI
113 for x in ${GENTOO_MIRRORS}
114 do
115 _SRC_URI="${_SRC_URI} ${x}/distfiles/${y##*/}"
116 done
117 _SRC_URI="${_SRC_URI} `queryhost.sh "${SRC_URI}"`"
118 for x in ${_SRC_URI}
119 do
120 if [ ! -e ${DISTDIR}/${y##*/} ]
121 then
122 if [ "${y##*/}" = "${x##*/}" ]
123 then
124 echo ">>> Trying site ${x}..."
125 eval "${FETCHCOMMAND}"
126 fi
127 fi
128 done
129 if [ ! -e ${DISTDIR}/${y##*/} ]
130 then
131 echo '!!!'" Couldn't download ${y##*/} needed by autotools.eclass. Aborting."
132 exit 1
133 fi
134 echo
135 fi
136 done
137 }
138
139 unpack_autotools() {
140
141 cd ${AUTO_S}
142
143 local x
144 for x in ${ASRC_URI}
145 do
146 unpack ${x##*/} || die "!!! Could not unpack ${x##*/} needed by autotools !!!"
147 done
148 }
149
150 install_autoconf() {
151
152 cd ${AUTO_S}/autoconf-${ACONFVER} || die "!!! Failed to build autoconf !!!"
153
154 ./configure --prefix=${AUTO_D} \
155 --infodir=${AUTO_D}/share/info \
156 --mandir=${AUTO_D}/share/man \
157 --target=${CHOST} || die "!!! Failed to configure autoconf !!!"
158
159 emake || die "!!! Failed to build autoconf !!!"
160
161 make install || die "!!! Failed to install autoconf !!!"
162 }
163
164 install_automake() {
165
166 cd ${AUTO_S}/automake-${AMAKEVER} || die "!!! Failed to build automake !!!"
167
168 ./configure --prefix=${AUTO_D} \
169 --infodir=${AUTO_D}/share/info \
170 --mandir=${AUTO_D}/share/man \
171 --target=${CHOST} || die "!!! Failed to configure automake !!!"
172
173 emake || die "!!! Failed to build automake !!!"
174
175 make install || die "!!! Failed to install automake !!!"
176 }
177
178 install_autotools() {
179
180 if [ "${SRC_URI/autoconf/}" = "$SRC_URI" ] || [ "${SRC_URI/automake/}" = "$SRC_URI" ]
181 then
182 echo "!!! \$SRC_URI was not set properly !!! It needs to include \${SRC_URI}"
183 exit 1
184 fi
185
186 if [ "${DEPEND/make/}" = "$DEPEND" ] || [ "${DEPEND/perl/}" = "$DEPEND" ] || \
187 [ "${DEPEND/m4/}" = "$DEPEND" ]
188 then
189 echo "!!! \$DEPEND was not set properly !!! It needs to include \${DEPEND}"
190 exit 1
191 fi
192
193 mkdir -p ${AUTO_S}
194 mkdir -p ${AUTO_D}/{bin,etc,lib,include,share} \
195 || die "!!! Could not create needed directories for autotools !!!"
196
197 # fetch_autotools
198 # unpack_autotools
199 install_autoconf
200 install_automake
201
202 export PATH=${AUTO_D}/bin:${PATH}
203 cd ${S}
204 ln -sf ${AUTO_D}/share/automake/depcomp ${S}/depcomp
205 }

  ViewVC Help
Powered by ViewVC 1.1.20