| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.21 2005/09/08 15:04:47 flameeyes Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.24 2005/10/09 12:00:34 flameeyes Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Diego Pettenò <flameeyes@gentoo.org> |
5 | # Author: Diego Pettenò <flameeyes@gentoo.org> |
| 6 | # Enhancements: Martin Schlemmer <azarah@gentoo.org> |
6 | # Enhancements: Martin Schlemmer <azarah@gentoo.org> |
| 7 | # |
7 | # |
| 8 | # This eclass is for handling autotooled software packages that |
8 | # This eclass is for handling autotooled software packages that |
| … | |
… | |
| 21 | # Variables: |
21 | # Variables: |
| 22 | # |
22 | # |
| 23 | # AT_M4DIR - Additional director(y|ies) aclocal should search |
23 | # AT_M4DIR - Additional director(y|ies) aclocal should search |
| 24 | # AT_GNUCONF_UPDATE - Should gnuconfig_update() be run (normally handled by |
24 | # AT_GNUCONF_UPDATE - Should gnuconfig_update() be run (normally handled by |
| 25 | # econf()) [yes|no] |
25 | # econf()) [yes|no] |
|
|
26 | # AM_OPTS - Additional options to pass to automake during |
|
|
27 | # eautoreconf call. |
| 26 | |
28 | |
| 27 | # Functions: |
29 | # Functions: |
| 28 | # |
30 | # |
| 29 | # eautoreconf() - Should do a full autoreconf - normally what most people |
31 | # eautoreconf() - Should do a full autoreconf - normally what most people |
| 30 | # will be interested in. Also should handle additional |
32 | # will be interested in. Also should handle additional |
| … | |
… | |
| 62 | |
64 | |
| 63 | eaclocal |
65 | eaclocal |
| 64 | _elibtoolize --copy --force |
66 | _elibtoolize --copy --force |
| 65 | eautoconf |
67 | eautoconf |
| 66 | eautoheader |
68 | eautoheader |
| 67 | eautomake |
69 | eautomake ${AM_OPTS} |
| 68 | |
70 | |
| 69 | # Normally run by econf() |
71 | # Normally run by econf() |
| 70 | [[ ${AT_GNUCONF_UPDATE} == "yes" ]] && gnuconfig_update |
72 | [[ ${AT_GNUCONF_UPDATE} == "yes" ]] && gnuconfig_update |
| 71 | |
73 | |
| 72 | return 0 |
74 | return 0 |
| … | |
… | |
| 99 | ;; |
101 | ;; |
| 100 | esac |
102 | esac |
| 101 | done |
103 | done |
| 102 | fi |
104 | fi |
| 103 | |
105 | |
| 104 | [[ -f aclocal.m4 && -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ |
106 | [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ |
| 105 | autotools_run_tool aclocal "$@" ${aclocal_opts} |
107 | autotools_run_tool aclocal "$@" ${aclocal_opts} |
| 106 | } |
108 | } |
| 107 | |
109 | |
| 108 | _elibtoolize() { |
110 | _elibtoolize() { |
| 109 | local opts |
111 | local opts |
| … | |
… | |
| 136 | |
138 | |
| 137 | autotools_run_tool autoconf "$@" |
139 | autotools_run_tool autoconf "$@" |
| 138 | } |
140 | } |
| 139 | |
141 | |
| 140 | eautomake() { |
142 | eautomake() { |
|
|
143 | local extra_opts |
|
|
144 | |
| 141 | [[ -f Makefile.am ]] || return 0 |
145 | [[ -f Makefile.am ]] || return 0 |
|
|
146 | |
|
|
147 | [[ -f INSTALL && -f AUTHORS && -f ChangeLog ]] \ |
|
|
148 | || extra_opts="${extra_opts} --foreign" |
|
|
149 | |
| 142 | # --force-missing seems not to be recognized by some flavours of automake |
150 | # --force-missing seems not to be recognized by some flavours of automake |
| 143 | autotools_run_tool automake --add-missing --copy "$@" |
151 | autotools_run_tool automake --add-missing --copy ${extra_opts} "$@" |
| 144 | } |
152 | } |
| 145 | |
153 | |
| 146 | |
154 | |
| 147 | |
155 | |
| 148 | # Internal function to run an autotools' tool |
156 | # Internal function to run an autotools' tool |