Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/, init.d/, /
Date: Sat, 05 Feb 2011 04:39:52
Message-Id: 19037cbd83ee46f2c3510925c83cc89d27d16ac6.williamH@gentoo
1 commit: 19037cbd83ee46f2c3510925c83cc89d27d16ac6
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 2 18:10:58 2011 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 4 23:46:57 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=19037cbd
7
8 remove unnecessary shell calls
9
10 The main makefile, init.d/Makefile and src/librc/Makefile all contain
11 several shell calls which can be handled as make conditionals. This
12 switches them to conditionals.
13
14 ---
15 Makefile | 19 +++++++------------
16 init.d/Makefile | 8 +++-----
17 src/librc/Makefile | 29 +++++++++++++++++------------
18 3 files changed, 27 insertions(+), 29 deletions(-)
19
20 diff --git a/Makefile b/Makefile
21 index d2e1593..dd427d0 100644
22 --- a/Makefile
23 +++ b/Makefile
24 @@ -7,20 +7,15 @@ include Makefile.inc
25 SUBDIR= conf.d etc init.d local.d man scripts sh src
26
27 # Build our old net foo or not
28 -_OLDNET_SH= case "${MKOLDNET}" in \
29 - [Yy][Ee][Ss]) echo "net doc";; \
30 - *) echo "";; \
31 - esac
32 -_OLDNET:= $(shell ${_OLDNET_SH})
33 -SUBDIR+= ${_OLDNET}
34 +ifeq (${MKOLDNET},yes)
35 +SUBDIR+= net doc
36 +endif
37
38 # Build pkgconfig or not
39 -_PKGCONFIG_SH= case "${MKPKGCONFIG}" in \
40 - [Yy][Ee][Ss]|"") echo "pkgconfig";; \
41 - *) echo "";; \
42 - esac
43 -_PKGCONFIG:= $(shell ${_PKGCONFIG_SH})
44 -SUBDIR+= ${_PKGCONFIG}
45 +MKPKGCONFIG?= yes
46 +ifeq (${MKPKGCONFIG},yes)
47 +SUBDIR+= pkgconfig
48 +endif
49
50 # We need to ensure that runlevels is done last
51 SUBDIR+= runlevels
52
53 diff --git a/init.d/Makefile b/init.d/Makefile
54 index 29ebe59..b7490d3 100644
55 --- a/init.d/Makefile
56 +++ b/init.d/Makefile
57 @@ -5,11 +5,9 @@ SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
58 BIN= ${OBJS}
59
60 # Build our old net foo or not
61 -_OLDNET_SH= case "${MKOLDNET}" in \
62 - [Yy][Ee][Ss]) echo "net.lo";; \
63 - *) echo "";; \
64 - esac
65 -_OLDNET:= $(shell ${_OLDNET_SH})
66 +ifeq (${MKOLDNET},yes)
67 +_OLDNET= net.lo
68 +endif
69 _NET_LO= ${_OLDNET}
70
71 INSTALLAFTER= _installafter_${_NET_LO}
72
73 diff --git a/src/librc/Makefile b/src/librc/Makefile
74 index eb6f6fd..574aa2a 100644
75 --- a/src/librc/Makefile
76 +++ b/src/librc/Makefile
77 @@ -19,20 +19,25 @@ SED_CMD= -e 's:@PREFIX@:${PREFIX}:g'
78 SED_CMD+= -e 's:@LIB@:${LIBNAME}:g'
79 SED_CMD+= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
80 SED_CMD+= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
81 -_PKG_PREFIX_SH= if test -n "${PKG_PREFIX}" && test "${PKG_PREFIX}" != "/" && test "${PKG_PREFIX}" != "${PREFIX}"; then \
82 - echo "-e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'"; \
83 - else \
84 - echo "-e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'"; \
85 - fi
86 -_PKG_PREFIX:= $(shell ${_PKG_PREFIX_SH})
87 +
88 +_PKG_PREFIX= -e 's:.*@PKG_PREFIX@.*:\#undef RC_PKG_PREFIX:g'
89 +ifneq (${PKG_PREFIX},)
90 +ifneq (${PKG_PREFIX},/)
91 +ifneq (${PKG_PREFIX},${PREFIX})
92 +_PKG_PREFIX= -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g'
93 +endif
94 +endif
95 +endif
96 SED_CMD+= ${_PKG_PREFIX}
97
98 -_LCL_PREFIX_SH= if test -n "${LOCAL_PREFIX}" && test "${LOCAL_PREFIX}" != "/" && test "${LOCAL_PREFIX}" != "${PREFIX}"; then \
99 - echo "-e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'"; \
100 - else \
101 - echo "-e 's:@LOCAL_PREFIX@::g'"; \
102 - fi
103 -_LCL_PREFIX:= $(shell ${_LCL_PREFIX_SH})
104 +_LCL_PREFIX= -e 's:@LOCAL_PREFIX@::g'
105 +ifneq (${LOCAL_PREFIX},)
106 +ifneq (${LOCAL_PREFIX},/)
107 +ifneq (${LOCAL_PREFIX},${PREFIX})
108 +_LCL_PREFIX= -e 's:@LOCAL_PREFIX@:${LOCAL_PREFIX}:g'
109 +endif
110 +endif
111 +endif
112 SED_CMD+= ${_LCL_PREFIX}
113
114 .SUFFIXES: .h.in .h