Merge lp:~macslow/notify-osd/shave-support into lp:notify-osd/trunk
- shave-support
- Merge into main
Status: | Merged |
---|---|
Approved by: | Mirco Müller |
Approved revision: | 383 |
Merged at revision: | not available |
Proposed branch: | lp:~macslow/notify-osd/shave-support |
Merge into: | lp:notify-osd/trunk |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~macslow/notify-osd/shave-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Approve | ||
Mirco Müller (community) | Needs Information | ||
Review via email: mp+10630@code.launchpad.net |
Commit message
Description of the change
Mirco Müller (macslow) wrote : | # |
Neil J. Patel (njpatel) wrote : | # |
I don't think you should use shave anymore.
m4_ifdef(
to the configure.ac (directly below AM_INIT_
Custom silent rules are done using AM_V_GEN and AM_V_CC (see http://
I currently use Shave across most of the UNR projects, but I'm aiming to move completely to automake's version soon.
- 383. By Mirco Müller <mirco@VBox-HAL9000>
-
removed shave-support and replaced it with plain silent-output support of automake 1.11
Mirco Müller (macslow) wrote : | # |
> I don't think you should use shave anymore.
> and it supports silent make by just adding:
>
> m4_ifdef(
>
> to the configure.ac (directly below AM_INIT_
> the normal output if the user is using < automake 1.11.
>
> Custom silent rules are done using AM_V_GEN and AM_V_CC (see
> http://
>
> I currently use Shave across most of the UNR projects, but I'm aiming to move
> completely to automake's version soon.
I replaced shave-support with automake-1.11's plain silent-output support in r383.
Neil J. Patel (njpatel) wrote : | # |
Works perfectly with autotools1.11 and falls-back fine with 1.10. Approved :)
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2009-08-04 15:27:20 +0000 |
3 | +++ .bzrignore 2009-08-24 21:33:58 +0000 |
4 | @@ -197,3 +197,5 @@ |
5 | tests/*.gcno |
6 | tests/*.gcda |
7 | tests/*.gcov |
8 | +build/autotools/shave |
9 | +build/autotools/shave-libtool |
10 | |
11 | === modified file 'Makefile.am' |
12 | --- Makefile.am 2009-08-04 17:34:48 +0000 |
13 | +++ Makefile.am 2009-08-24 21:33:58 +0000 |
14 | @@ -1,5 +1,9 @@ |
15 | EXTRA_DIST = icons |
16 | |
17 | +V = @ |
18 | +Q = $(V:1=) |
19 | +QUIET_GEN = $(Q:@=@echo ' GEN '$@;) |
20 | + |
21 | SUBDIRS = src tests data examples |
22 | |
23 | test: check |
24 | |
25 | === added directory 'build' |
26 | === added file 'build/Makefile.am' |
27 | --- build/Makefile.am 1970-01-01 00:00:00 +0000 |
28 | +++ build/Makefile.am 2009-08-24 21:33:58 +0000 |
29 | @@ -0,0 +1,1 @@ |
30 | +SUBDIRS = autotools |
31 | |
32 | === added directory 'build/autotools' |
33 | === added file 'build/autotools/Makefile.am' |
34 | --- build/autotools/Makefile.am 1970-01-01 00:00:00 +0000 |
35 | +++ build/autotools/Makefile.am 2009-08-24 21:33:58 +0000 |
36 | @@ -0,0 +1,3 @@ |
37 | +EXTRA_DIST = shave-libtool.in shave.in shave.m4 |
38 | + |
39 | +DISTCLEANFILES = shave-libtool shave |
40 | |
41 | === added file 'build/autotools/shave-libtool.in' |
42 | --- build/autotools/shave-libtool.in 1970-01-01 00:00:00 +0000 |
43 | +++ build/autotools/shave-libtool.in 2009-08-24 21:33:58 +0000 |
44 | @@ -0,0 +1,109 @@ |
45 | +#!/bin/sh |
46 | +# |
47 | +# Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com> |
48 | +# |
49 | +# Permission is hereby granted, free of charge, to any person |
50 | +# obtaining a copy of this software and associated documentation |
51 | +# files (the "Software"), to deal in the Software without |
52 | +# restriction, including without limitation the rights to use, |
53 | +# copy, modify, merge, publish, distribute, sublicense, and/or sell |
54 | +# copies of the Software, and to permit persons to whom the |
55 | +# Software is furnished to do so, subject to the following |
56 | +# conditions: |
57 | +# |
58 | +# The above copyright notice and this permission notice shall be |
59 | +# included in all copies or substantial portions of the Software. |
60 | +# |
61 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
62 | +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
63 | +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
64 | +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
65 | +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
66 | +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
67 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
68 | +# OTHER DEALINGS IN THE SOFTWARE. |
69 | + |
70 | +# we need sed |
71 | +SED=@SED@ |
72 | +if test -z "$SED" ; then |
73 | +SED=sed |
74 | +fi |
75 | + |
76 | +lt_unmangle () |
77 | +{ |
78 | + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` |
79 | +} |
80 | + |
81 | +# the real libtool to use |
82 | +LIBTOOL="$1" |
83 | +shift |
84 | + |
85 | +# if 1, don't print anything, the underlaying wrapper will do it |
86 | +pass_though=0 |
87 | + |
88 | +# scan the arguments, keep the right ones for libtool, and discover the mode |
89 | +preserved_args= |
90 | + |
91 | +# have we seen the --tag option of libtool in the command line ? |
92 | +tag_seen=0 |
93 | + |
94 | +while test "$#" -gt 0; do |
95 | + opt="$1" |
96 | + shift |
97 | + |
98 | + case $opt in |
99 | + --mode=*) |
100 | + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` |
101 | + preserved_args="$preserved_args $opt" |
102 | + ;; |
103 | + -o) |
104 | + lt_output="$1" |
105 | + preserved_args="$preserved_args $opt" |
106 | + ;; |
107 | + --tag=*) |
108 | + tag_seen=1 |
109 | + preserved_args="$preserved_args $opt" |
110 | + ;; |
111 | + *) |
112 | + preserved_args="$preserved_args $opt" |
113 | + ;; |
114 | + esac |
115 | +done |
116 | + |
117 | +case "$mode" in |
118 | +compile) |
119 | + # shave will be called and print the actual CC/CXX/LINK line |
120 | + preserved_args="$preserved_args --shave-mode=$mode" |
121 | + pass_though=1 |
122 | + ;; |
123 | +link) |
124 | + preserved_args="$preserved_args --shave-mode=$mode" |
125 | + Q=" LINK " |
126 | + ;; |
127 | +*) |
128 | + # let's u |
129 | + # echo "*** libtool: Unimplemented mode: $mode, fill a bug report" |
130 | + ;; |
131 | +esac |
132 | + |
133 | +lt_unmangle "$lt_output" |
134 | +output=$last_result |
135 | + |
136 | +# automake does not add a --tag switch to its libtool invocation when |
137 | +# assembling a .s file and rely on libtool to infer the right action based |
138 | +# on the compiler name. As shave is using CC to hook a wrapper, libtool gets |
139 | +# confused. Let's detect these cases and add a --tag=CC option. |
140 | +tag="" |
141 | +if test $tag_seen -eq 0 -a x"$mode" = xcompile; then |
142 | + tag="--tag=CC" |
143 | +fi |
144 | + |
145 | +if test -z $V; then |
146 | + if test $pass_though -eq 0; then |
147 | + echo "$Q$output" |
148 | + fi |
149 | + $LIBTOOL --silent $tag $preserved_args |
150 | +else |
151 | + echo $LIBTOOL $tag $preserved_args |
152 | + $LIBTOOL $tag $preserved_args |
153 | +fi |
154 | |
155 | === added file 'build/autotools/shave.in' |
156 | --- build/autotools/shave.in 1970-01-01 00:00:00 +0000 |
157 | +++ build/autotools/shave.in 2009-08-24 21:33:58 +0000 |
158 | @@ -0,0 +1,109 @@ |
159 | +#!/bin/sh |
160 | +# |
161 | +# Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com> |
162 | +# |
163 | +# Permission is hereby granted, free of charge, to any person |
164 | +# obtaining a copy of this software and associated documentation |
165 | +# files (the "Software"), to deal in the Software without |
166 | +# restriction, including without limitation the rights to use, |
167 | +# copy, modify, merge, publish, distribute, sublicense, and/or sell |
168 | +# copies of the Software, and to permit persons to whom the |
169 | +# Software is furnished to do so, subject to the following |
170 | +# conditions: |
171 | +# |
172 | +# The above copyright notice and this permission notice shall be |
173 | +# included in all copies or substantial portions of the Software. |
174 | +# |
175 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
176 | +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
177 | +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
178 | +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
179 | +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
180 | +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
181 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
182 | +# OTHER DEALINGS IN THE SOFTWARE. |
183 | + |
184 | +# we need sed |
185 | +SED=@SED@ |
186 | +if test -z "$SED" ; then |
187 | +SED=sed |
188 | +fi |
189 | + |
190 | +lt_unmangle () |
191 | +{ |
192 | + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` |
193 | +} |
194 | + |
195 | +# the tool to wrap (cc, cxx, ar, ranlib, ..) |
196 | +tool="$1" |
197 | +shift |
198 | + |
199 | +# the reel tool (to call) |
200 | +REEL_TOOL="$1" |
201 | +shift |
202 | + |
203 | +pass_through=0 |
204 | +preserved_args= |
205 | +while test "$#" -gt 0; do |
206 | + opt="$1" |
207 | + shift |
208 | + |
209 | + case $opt in |
210 | + --shave-mode=*) |
211 | + mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` |
212 | + ;; |
213 | + -o) |
214 | + lt_output="$1" |
215 | + preserved_args="$preserved_args $opt" |
216 | + ;; |
217 | + -out:*|/out:*) |
218 | + lt_output="${opt:5}" |
219 | + preserved_args="$preserved_args $opt" |
220 | + ;; |
221 | + *) |
222 | + preserved_args="$preserved_args $opt" |
223 | + ;; |
224 | + esac |
225 | +done |
226 | + |
227 | +# mode=link is handled in the libtool wrapper |
228 | +case "$mode,$tool" in |
229 | +link,*) |
230 | + pass_through=1 |
231 | + ;; |
232 | +*,cxx) |
233 | + Q=" CXX " |
234 | + ;; |
235 | +*,cc) |
236 | + Q=" CC " |
237 | + ;; |
238 | +*,fc) |
239 | + Q=" FC " |
240 | + ;; |
241 | +*,f77) |
242 | + Q=" F77 " |
243 | + ;; |
244 | +*,objc) |
245 | + Q=" OBJC " |
246 | + ;; |
247 | +*,mcs) |
248 | + Q=" MCS " |
249 | + ;; |
250 | +*,*) |
251 | + # should not happen |
252 | + Q=" CC " |
253 | + ;; |
254 | +esac |
255 | + |
256 | +lt_unmangle "$lt_output" |
257 | +output=$last_result |
258 | + |
259 | +if test -z $V; then |
260 | + if test $pass_through -eq 0; then |
261 | + echo "$Q$output" |
262 | + fi |
263 | + $REEL_TOOL $preserved_args |
264 | +else |
265 | + echo $REEL_TOOL $preserved_args |
266 | + $REEL_TOOL $preserved_args |
267 | +fi |
268 | |
269 | === modified file 'configure.in' |
270 | --- configure.in 2009-08-21 14:29:14 +0000 |
271 | +++ configure.in 2009-08-24 21:33:58 +0000 |
272 | @@ -124,10 +124,16 @@ |
273 | AM_CONDITIONAL(BUILD_MONO_EXAMPLES, test "x$csharp_examples" != "xno") |
274 | |
275 | dnl CFLAGS |
276 | -CFLAGS="$CFLAGS -lm -Wall -Werror -std=c99" |
277 | +CFLAGS="$CFLAGS -Wall -Werror -std=c99" |
278 | + |
279 | +SHAVE_INIT([build/autotools], [enable]) |
280 | |
281 | AC_OUTPUT([ |
282 | Makefile |
283 | +build/Makefile |
284 | +build/autotools/Makefile |
285 | +build/autotools/shave-libtool |
286 | +build/autotools/shave |
287 | src/Makefile |
288 | tests/Makefile |
289 | examples/Makefile |
290 | |
291 | === added file 'm4/shave.m4' |
292 | --- m4/shave.m4 1970-01-01 00:00:00 +0000 |
293 | +++ m4/shave.m4 2009-08-24 21:33:58 +0000 |
294 | @@ -0,0 +1,102 @@ |
295 | +dnl Make automake/libtool output more friendly to humans |
296 | +dnl |
297 | +dnl Copyright (c) 2009, Damien Lespiau <damien.lespiau@gmail.com> |
298 | +dnl |
299 | +dnl Permission is hereby granted, free of charge, to any person |
300 | +dnl obtaining a copy of this software and associated documentation |
301 | +dnl files (the "Software"), to deal in the Software without |
302 | +dnl restriction, including without limitation the rights to use, |
303 | +dnl copy, modify, merge, publish, distribute, sublicense, and/or sell |
304 | +dnl copies of the Software, and to permit persons to whom the |
305 | +dnl Software is furnished to do so, subject to the following |
306 | +dnl conditions: |
307 | +dnl |
308 | +dnl The above copyright notice and this permission notice shall be |
309 | +dnl included in all copies or substantial portions of the Software. |
310 | +dnl |
311 | +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
312 | +dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
313 | +dnl OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
314 | +dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
315 | +dnl HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
316 | +dnl WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
317 | +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
318 | +dnl OTHER DEALINGS IN THE SOFTWARE. |
319 | +dnl |
320 | +dnl SHAVE_INIT([shavedir],[default_mode]) |
321 | +dnl |
322 | +dnl shavedir: the directory where the shave scripts are, it defaults to |
323 | +dnl $(top_builddir) |
324 | +dnl default_mode: (enable|disable) default shave mode. This parameter |
325 | +dnl controls shave's behaviour when no option has been |
326 | +dnl given to configure. It defaults to disable. |
327 | +dnl |
328 | +dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just |
329 | +dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and |
330 | +dnl LIBTOOL, you don't want the configure tests to have these variables |
331 | +dnl re-defined. |
332 | +dnl * This macro requires GNU make's -s option. |
333 | + |
334 | +AC_DEFUN([_SHAVE_ARG_ENABLE], |
335 | +[ |
336 | + AC_ARG_ENABLE([shave], |
337 | + AS_HELP_STRING( |
338 | + [--enable-shave], |
339 | + [use shave to make the build pretty [[default=$1]]]),, |
340 | + [enable_shave=$1] |
341 | + ) |
342 | +]) |
343 | + |
344 | +AC_DEFUN([SHAVE_INIT], |
345 | +[ |
346 | + dnl you can tweak the default value of enable_shave |
347 | + m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) |
348 | + |
349 | + if test x"$enable_shave" = xyes; then |
350 | + dnl where can we find the shave scripts? |
351 | + m4_if([$1],, |
352 | + [shavedir="$ac_pwd"], |
353 | + [shavedir="$ac_pwd/$1"]) |
354 | + AC_SUBST(shavedir) |
355 | + |
356 | + dnl make is now quiet |
357 | + AC_SUBST([MAKEFLAGS], [-s]) |
358 | + AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`']) |
359 | + |
360 | + dnl we need sed |
361 | + AC_CHECK_PROG(SED,sed,sed,false) |
362 | + |
363 | + dnl substitute libtool |
364 | + SHAVE_SAVED_LIBTOOL=$LIBTOOL |
365 | + LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" |
366 | + AC_SUBST(LIBTOOL) |
367 | + |
368 | + dnl substitute cc/cxx |
369 | + SHAVE_SAVED_CC=$CC |
370 | + SHAVE_SAVED_CXX=$CXX |
371 | + SHAVE_SAVED_FC=$FC |
372 | + SHAVE_SAVED_F77=$F77 |
373 | + SHAVE_SAVED_OBJC=$OBJC |
374 | + SHAVE_SAVED_MCS=$MCS |
375 | + CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" |
376 | + CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" |
377 | + FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" |
378 | + F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" |
379 | + OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}" |
380 | + MCS="${SHELL} ${shavedir}/shave mcs ${SHAVE_SAVED_MCS}" |
381 | + AC_SUBST(CC) |
382 | + AC_SUBST(CXX) |
383 | + AC_SUBST(FC) |
384 | + AC_SUBST(F77) |
385 | + AC_SUBST(OBJC) |
386 | + AC_SUBST(MCS) |
387 | + |
388 | + V=@ |
389 | + else |
390 | + V=1 |
391 | + fi |
392 | + Q='$(V:1=)' |
393 | + AC_SUBST(V) |
394 | + AC_SUBST(Q) |
395 | +]) |
396 | + |
397 | |
398 | === modified file 'src/Makefile.am' |
399 | --- src/Makefile.am 2009-08-21 13:48:35 +0000 |
400 | +++ src/Makefile.am 2009-08-24 21:33:58 +0000 |
401 | @@ -103,7 +103,7 @@ |
402 | $(NULL) |
403 | |
404 | notify_osd_LDFLAGS = \ |
405 | - -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions \ |
406 | + -Xlinker -lm -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions \ |
407 | $(NULL) |
408 | |
409 | # this comes from distutils.sysconfig.get_config_var('LINKFORSHARED') |
410 | |
411 | === modified file 'tests/Makefile.am' |
412 | --- tests/Makefile.am 2009-08-21 13:48:35 +0000 |
413 | +++ tests/Makefile.am 2009-08-24 21:33:58 +0000 |
414 | @@ -87,7 +87,7 @@ |
415 | $(GLIB_CFLAGS) \ |
416 | -I$(top_srcdir)/src -I$(top_srcdir)/egg -I$(top_srcdir) |
417 | |
418 | -LDADD = $(GLIB_LIBS) |
419 | +LDADD = $(GLIB_LIBS) -lm |
420 | |
421 | test_timeline_SOURCES = $(top_srcdir)/egg/test-timeline.c \ |
422 | $(EGG_MODULES) |
Added shave-support for compiling and linking notify-osd.