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

Diff of /eclass/confutils.eclass

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

Revision 1.12 Revision 1.13
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/confutils.eclass,v 1.12 2004/08/24 20:55:43 stuart Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/confutils.eclass,v 1.13 2005/02/21 14:52:05 stuart Exp $
4# 4#
5# eclass/confutils.eclass 5# eclass/confutils.eclass
6# Utility functions to help with configuring a package 6# Utility functions to help with configuring a package
7# 7#
8# Based on Stuart's work for the PHP 5 eclass 8# Based on Stuart's work for the PHP 5 eclass
10# Author(s) Stuart Herbert 10# Author(s) Stuart Herbert
11# <stuart@gentoo.org> 11# <stuart@gentoo.org>
12# 12#
13# ======================================================================== 13# ========================================================================
14 14
15IUSE="$IUSE shared" 15IUSE="$IUSE sharedext"
16 16
17# ======================================================================== 17# ========================================================================
18 18
19# list of USE flags that need deps that aren't yet in Portage 19# list of USE flags that need deps that aren't yet in Portage
20# this list was originally added for PHP 20# this list was originally added for PHP
21 21
22CONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix ingres interbase mnogosearch msession msql oci8 oracle7 ovrimos pfpro sapdb solid sybase sybase-ct" 22CONFUTILS_MISSING_DEPS="adabas aolserver birdstep caudium continuity db2 dbmaker empress empress-bcs esoob frontbase hyperwave-api informix ingres interbase isapi mnogosearch msession msql nsapi oci8 oracle7 ovrimos pfpro phttpd pi3web sapdb solid sybase sybase-ct tux"
23 23
24# ======================================================================== 24# ========================================================================
25# confutils_init () 25# confutils_init ()
26# 26#
27# Call this function from your src_compile() function to initialise 27# Call this function from your src_compile() function to initialise
28# this eclass first 28# this eclass first
29 29
30confutils_init () { 30confutils_init () {
31 if useq shared ; then 31 if useq sharedext ; then
32 shared="=shared" 32 shared="=shared"
33 else 33 else
34 shared= 34 shared=
35 fi 35 fi
36} 36}
165# This is provided for those rare configure scripts that don't support 165# This is provided for those rare configure scripts that don't support
166# a --enable for the corresponding --disable 166# a --enable for the corresponding --disable
167# 167#
168# $1 - extension name 168# $1 - extension name
169# $2 - USE flag 169# $2 - USE flag
170# $3 - optional message to einfo() to the user
170 171
171enable_extension_disable () { 172enable_extension_disable () {
172 if ! useq "$2" ; then 173 if ! useq "$2" ; then
173 my_conf="${my_conf} --disable-$1" 174 my_conf="${my_conf} --disable-$1"
175 [ -n "$3" ] && einfo " Disabling $3"
176 else
177 [ -n "$3" ] && einfo " Enabling $3"
174 fi 178 fi
175} 179}
176 180
177# ======================================================================== 181# ========================================================================
178# enable_extension_enable () 182# enable_extension_enable ()
183# 187#
184# $1 - extension name 188# $1 - extension name
185# $2 - USE flag 189# $2 - USE flag
186# $3 - 1 = support shared, 0 = never support shared 190# $3 - 1 = support shared, 0 = never support shared
187# $4 - additional setting for configure 191# $4 - additional setting for configure
192# $5 - additional message to einfo out to the user
188 193
189enable_extension_enable () { 194enable_extension_enable () {
190 local my_shared 195 local my_shared
191 196
192 if [ "$3" == "1" ]; then 197 if [ "$3" == "1" ]; then
204 fi 209 fi
205 fi 210 fi
206 211
207 if useq $2 ; then 212 if useq $2 ; then
208 my_conf="${my_conf} --enable-$1$my_shared" 213 my_conf="${my_conf} --enable-$1$my_shared"
214 [ -n "$5" ] && einfo " Enabling $5"
209 else 215 else
210 my_conf="${my_conf} --disable-$1" 216 my_conf="${my_conf} --disable-$1"
217 [ -n "$5" ] && einfo " Disabling $5"
211 fi 218 fi
212} 219}
213 220
214# ======================================================================== 221# ========================================================================
215# enable_extension_without () 222# enable_extension_enableonly ()
216# 223#
217# Use this function to disable an extension that is enabled by default 224# This function is like use_enable(), except that it knows about
218# This function is provided for those rare configure scripts that support 225# enabling modules as shared libraries, and it supports passing
219# --without but not the corresponding --with 226# additional data with the switch
220# 227#
221# $1 - extension name
222# $2 - USE flag
223
224enable_extension_without () {
225 if ! useq "$2" ; then
226 my_conf="${my_conf} --without-$1"
227 fi
228}
229
230# ========================================================================
231# enable_extension_with ()
232#
233# This function is a replacement for use_with. It supports building
234# extensions as shared libraries,
235
236# $1 - extension name 228# $1 - extension name
237# $2 - USE flag 229# $2 - USE flag
238# $3 - 1 = support shared, 0 = never support shared 230# $3 - 1 = support shared, 0 = never support shared
239# $4 - additional setting for configure 231# $4 - additional setting for configure
232# $5 - additional message to einfo out to the user
240 233
241enable_extension_with () { 234enable_extension_enableonly () {
242 local my_shared 235 local my_shared
243 236
244 if [ "$3" == "1" ]; then 237 if [ "$3" == "1" ]; then
245 if [ "$shared+" != "+" ]; then 238 if [ "$shared+" != "+" ]; then
246 my_shared="${shared}" 239 my_shared="${shared}"
255 my_shared="=$4" 248 my_shared="=$4"
256 fi 249 fi
257 fi 250 fi
258 251
259 if useq $2 ; then 252 if useq $2 ; then
253 my_conf="${my_conf} --enable-$1$my_shared"
254 [ -n "$5" ] && einfo " Enabling $5"
255 else
256 # note: we deliberately do *not* use a --disable switch here
257 [ -n "$5" ] && einfo " Disabling $5"
258 fi
259}
260# ========================================================================
261# enable_extension_without ()
262#
263# Use this function to disable an extension that is enabled by default
264# This function is provided for those rare configure scripts that support
265# --without but not the corresponding --with
266#
267# $1 - extension name
268# $2 - USE flag
269# $3 - optional message to einfo() to the user
270
271enable_extension_without () {
272 if ! useq "$2" ; then
273 my_conf="${my_conf} --without-$1"
274 [ -n "$3" ] && einfo " Disabling $3"
275 else
276 [ -n "$3" ] && einfo " Enabling $3"
277 fi
278}
279
280# ========================================================================
281# enable_extension_with ()
282#
283# This function is a replacement for use_with. It supports building
284# extensions as shared libraries,
285
286# $1 - extension name
287# $2 - USE flag
288# $3 - 1 = support shared, 0 = never support shared
289# $4 - additional setting for configure
290# $5 - optional message to einfo() out to the user
291
292enable_extension_with () {
293 local my_shared
294
295 if [ "$3" == "1" ]; then
296 if [ "$shared+" != "+" ]; then
297 my_shared="${shared}"
298 if [ "$4+" != "+" ]; then
299 my_shared="${my_shared},$4"
300 fi
301 elif [ "$4+" != "+" ]; then
302 my_shared="=$4"
303 fi
304 else
305 if [ "$4+" != "+" ]; then
306 my_shared="=$4"
307 fi
308 fi
309
310 if useq $2 ; then
260 my_conf="${my_conf} --with-$1$my_shared" 311 my_conf="${my_conf} --with-$1$my_shared"
312 [ -n "$5" ] && einfo " Enabling $5"
261 else 313 else
262 my_conf="${my_conf} --without-$1" 314 my_conf="${my_conf} --without-$1"
315 [ -n "$5" ] && einfo " Disabling $5"
316 fi
317}
318
319# ========================================================================
320# enable_extension_withonly ()
321#
322# This function is a replacement for use_with. It supports building
323# extensions as shared libraries,
324
325# $1 - extension name
326# $2 - USE flag
327# $3 - 1 = support shared, 0 = never support shared
328# $4 - additional setting for configure
329# $5 - optional message to einfo() out to the user
330
331enable_extension_withonly () {
332 local my_shared
333
334 if [ "$3" == "1" ]; then
335 if [ "$shared+" != "+" ]; then
336 my_shared="${shared}"
337 if [ "$4+" != "+" ]; then
338 my_shared="${my_shared},$4"
339 fi
340 elif [ "$4+" != "+" ]; then
341 my_shared="=$4"
342 fi
343 else
344 if [ "$4+" != "+" ]; then
345 my_shared="=$4"
346 fi
347 fi
348
349 if useq $2 ; then
350 my_conf="${my_conf} --with-$1$my_shared"
351 [ -n "$5" ] && einfo " Enabling $5"
352 else
353 # note - we deliberately do *not* use --without here
354 [ -n "$5" ] && einfo " Disabling $5"
263 fi 355 fi
264} 356}
265 357
266# ======================================================================== 358# ========================================================================
267# confutils_warn_about_external_deps 359# confutils_warn_about_external_deps

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20