From e719d6d0b6993aefb9584fb16f14fa5d8039e072 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Fri, 25 Jan 2008 11:49:14 +0100 Subject: [PATCH] fix header generators for out-of-source builds The header generator scripts now work when srcdir!=builddir. Signed-off-by: Julien Danjou --- Makefile.am | 6 +++--- build-utils/layoutgen.sh | 3 ++- build-utils/uicbgen.sh | 5 +++-- build-utils/widgetgen.sh | 7 ++++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3d30a024..f0c80c9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -66,21 +66,21 @@ BUILT_SOURCES += uicbgen.h EXTRA_DIST += build-utils/uicbgen.sh uicbgen.h: $(awesome_SOURCES) @echo "generating uicbgen.h from headers file" - $(top_srcdir)/build-utils/uicbgen.sh > uicbgen.h + $(top_srcdir)/build-utils/uicbgen.sh "$(top_srcdir)" > uicbgen.h CLEANFILES += layoutgen.h BUILT_SOURCES += layoutgen.h EXTRA_DIST += build-utils/layoutgen.sh layoutgen.h: $(awesome_SOURCES) @echo "generating layoutgen.h from layouts headers file" - $(top_srcdir)/build-utils/layoutgen.sh > layoutgen.h + $(top_srcdir)/build-utils/layoutgen.sh "$(top_srcdir)" > layoutgen.h CLEANFILES += widgetgen.h BUILT_SOURCES += widgetgen.h EXTRA_DIST += build-utils/widgetgen.sh widgetgen.h: widget.h @echo "generating widgetgen.h from widget.h" - $(top_srcdir)/build-utils/widgetgen.sh > widgetgen.h + $(top_srcdir)/build-utils/widgetgen.sh "$(top_srcdir)" > widgetgen.h if USING_GCC # If you are using gcc, and want to deactivate this default set of diff --git a/build-utils/layoutgen.sh b/build-utils/layoutgen.sh index 9f4e10e1..e772b4dc 100755 --- a/build-utils/layoutgen.sh +++ b/build-utils/layoutgen.sh @@ -1,9 +1,10 @@ #!/bin/sh +top_srcdir="${1-.}" echo "/* This file is autogenerated by" $(basename $0) "*/" echo echo "const name_func_link_t LayoutList[] =" echo "{" -for file in layouts/*.h +for file in ${top_srcdir}/layouts/*.h do echo " /* $file */" grep '^LayoutArrange layout_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read layout diff --git a/build-utils/uicbgen.sh b/build-utils/uicbgen.sh index 59eb5c20..744caa96 100755 --- a/build-utils/uicbgen.sh +++ b/build-utils/uicbgen.sh @@ -1,16 +1,17 @@ #!/bin/sh +top_srcdir="${1-.}" echo "/* This file is autogenerated by" $(basename $0) "*/" echo echo "const name_func_link_t UicbList[] =" echo "{" -for file in *.h layouts/*.h +for file in ${top_srcdir}/*.h ${top_srcdir}/layouts/*.h do echo " /* $file */" grep '^Uicb uicb_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read uicb do shortname=$(echo $uicb | cut -d _ -f2-) echo " {\"$shortname\", $uicb}," - grep -q "\*$shortname\*" awesomerc.1.txt || \ + grep -q "\*$shortname\*" ${top_srcdir}/awesomerc.1.txt || \ echo " WARNING: $uicb NOT documented" >&2 done done diff --git a/build-utils/widgetgen.sh b/build-utils/widgetgen.sh index d6a7e52a..92fb3688 100755 --- a/build-utils/widgetgen.sh +++ b/build-utils/widgetgen.sh @@ -1,16 +1,17 @@ #!/bin/sh +top_srcdir="${1-.}" echo "/* This file is autogenerated by" $(basename $0) "*/" echo echo "const name_func_link_t WidgetList[] =" echo "{" -for file in widget.h +for file in ${top_srcdir}/widget.h do echo " /* $file */" - grep '^WidgetConstructor ' widget.h | cut -d' ' -f2 | cut -d\; -f1 | while read widget + grep '^WidgetConstructor ' "$file" | cut -d' ' -f2 | cut -d\; -f1 | while read widget do shortname=$(echo $widget | cut -d_ -f1) echo " {\"$shortname\", $widget}," - grep -q "^$shortname" awesomerc.1.txt || \ + grep -q "^$shortname" ${top_srcdir}/awesomerc.1.txt || \ echo " WARNING: $uicb NOT documented" >&2 done done