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

Diff of /eclass/autotools.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.21 Revision 1.27
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.27 2005/12/09 10:42:09 azarah 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
58 eautoreconf 60 eautoreconf
59 cd "${pwd}" 61 cd "${pwd}"
60 fi 62 fi
61 done 63 done
62 64
65 einfo "Running eautoreconf in '$(pwd)' ..."
63 eaclocal 66 eaclocal
64 _elibtoolize --copy --force 67 _elibtoolize --copy --force
65 eautoconf 68 eautoconf
66 eautoheader 69 eautoheader
67 eautomake 70 eautomake ${AM_OPTS}
68 71
69 # Normally run by econf() 72 # Normally run by econf()
70 [[ ${AT_GNUCONF_UPDATE} == "yes" ]] && gnuconfig_update 73 [[ ${AT_GNUCONF_UPDATE} == "yes" ]] && gnuconfig_update
71 74
72 return 0 75 return 0
99 ;; 102 ;;
100 esac 103 esac
101 done 104 done
102 fi 105 fi
103 106
104 [[ -f aclocal.m4 && -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ 107 [[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \
105 autotools_run_tool aclocal "$@" ${aclocal_opts} 108 autotools_run_tool aclocal "$@" ${aclocal_opts}
106} 109}
107 110
108_elibtoolize() { 111_elibtoolize() {
109 local opts 112 local opts
136 139
137 autotools_run_tool autoconf "$@" 140 autotools_run_tool autoconf "$@"
138} 141}
139 142
140eautomake() { 143eautomake() {
144 local extra_opts
145
141 [[ -f Makefile.am ]] || return 0 146 [[ -f Makefile.am ]] || return 0
147
148 [[ -f INSTALL && -f AUTHORS && -f ChangeLog ]] \
149 || extra_opts="${extra_opts} --foreign"
150
142 # --force-missing seems not to be recognized by some flavours of automake 151 # --force-missing seems not to be recognized by some flavours of automake
143 autotools_run_tool automake --add-missing --copy "$@" 152 autotools_run_tool automake --add-missing --copy ${extra_opts} "$@"
144} 153}
145 154
146 155
147 156
148# Internal function to run an autotools' tool 157# Internal function to run an autotools' tool
152 local ris 161 local ris
153 162
154 echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 163 echo "***** $1 *****" > ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
155 echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 164 echo >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/}
156 165
157 ebegin "Running $1" 166 ebegin "Running $@"
158 $@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1 167 $@ >> ${STDERR_TARGET%/*}/$1-${STDERR_TARGET##*/} 2>&1
159 ris=$? 168 ris=$?
160 eend ${ris} 169 eend ${ris}
161 170
162 if [[ ${ris} != 0 ]]; then 171 if [[ ${ris} != 0 ]]; then
185 subdirs_scan_out=$(autotools_check_macro "AC_CONFIG_SUBDIRS") 194 subdirs_scan_out=$(autotools_check_macro "AC_CONFIG_SUBDIRS")
186 [[ -n ${subdirs_scan_out} ]] || return 0 195 [[ -n ${subdirs_scan_out} ]] || return 0
187 196
188 echo "${subdirs_scan_out}" | gawk \ 197 echo "${subdirs_scan_out}" | gawk \
189 '($0 !~ /^[[:space:]]*(#|dnl)/) { 198 '($0 !~ /^[[:space:]]*(#|dnl)/) {
190 if (match($0, "AC_CONFIG_SUBDIRS\\(\\[?([^\\])]*)", res)) { 199 if (match($0, /AC_CONFIG_SUBDIRS:(.*)$/, res))
191 split(res[1], DIRS, /[\])]/)
192 print DIRS[1] 200 print res[1]
193 }
194 }' | uniq 201 }' | uniq
195 202
196 return 0 203 return 0
197} 204}
198 205

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20