conf/178068: [PATCH] simplify _libraries by filtering out <lib>__L targets with associated commands

Garrett Cooper yaneurabeya at gmail.com
Tue Apr 23 03:10:01 UTC 2013


>Number:         178068
>Category:       conf
>Synopsis:       [PATCH] simplify _libraries by filtering out <lib>__L targets with associated commands
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 23 03:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD gran-tourismo.west.isilon.com 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r+ba9afe9: Fri Apr 19 20:29:10 PDT 2013     gcooper at gran-tourismo.west.isilon.com:/usr/obj/usr/src/sys/GRAN-TOURISMO  amd64
>Description:
In the event that someone wishes to hook in a separate library today (say ${LOCAL_LIB_DIRS}), they have to go about some degree of magic in order to filter out their manually created target.

libpam already skates by this requirement by being filtered out, so the best way to handle this is to check for a target being already defined beforehand with a series of commands associated with it, and instead of automatically generating said commands, just skip it because it's assumed that the user knows what they're doing and wish to bypass the autogeneration logic.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

>From eb5946a80a4e6103a7236b23e65cbebd85c82e5c Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi at gmail.com>
Date: Mon, 22 Apr 2013 18:15:55 -0700
Subject: [PATCH 2/3] Instead of specially filtering out lib/pam, use the
 commands macro to determine whether or not a rule should be generated.

Signed-off-by: Garrett Cooper <yanegomi at gmail.com>
---
 Makefile.inc1 | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 27e0d1b..5175b5e 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1528,18 +1528,6 @@ ${_lib}__PL: .PHONY
 .endif
 .endfor
 
-.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
-${_lib}__L: .PHONY
-.if exists(${.CURDIR}/${_lib})
-	${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
-		cd ${.CURDIR}/${_lib}; \
-		${MAKE} DIRPRFX=${_lib}/ obj; \
-		${MAKE} DIRPRFX=${_lib}/ depend; \
-		${MAKE} DIRPRFX=${_lib}/ all; \
-		${MAKE} DIRPRFX=${_lib}/ install
-.endif
-.endfor
-
 # libpam is special: we need to build static PAM modules before
 # static PAM library, and dynamic PAM library before dynamic PAM
 # modules.
@@ -1551,6 +1539,20 @@ lib/libpam__L: .PHONY
 		${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
 		${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
 
+.for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
+.if !commands(${_lib}__L)
+${_lib}__L: .PHONY
+.if exists(${.CURDIR}/${_lib})
+	${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
+		cd ${.CURDIR}/${_lib}; \
+		${MAKE} DIRPRFX=${_lib}/ obj; \
+		${MAKE} DIRPRFX=${_lib}/ depend; \
+		${MAKE} DIRPRFX=${_lib}/ all; \
+		${MAKE} DIRPRFX=${_lib}/ install
+.endif
+.endif
+.endfor
+
 _prereq_libs: ${_prereq_libs:S/$/__PL/}
 _startup_libs: ${_startup_libs:S/$/__L/}
 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
-- 
1.8.2



>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list