diff options
-rwxr-xr-x | autogen.bash | 23 | ||||
-rw-r--r-- | misc/Makefile.am | 2 | ||||
-rwxr-xr-x | misc/do_m4.bash | 23 | ||||
-rw-r--r-- | paludis/Makefile.am.m4 | 13 | ||||
-rw-r--r-- | paludis/files.m4 | 6 |
5 files changed, 46 insertions, 21 deletions
diff --git a/autogen.bash b/autogen.bash index e9ecfac5d..8d738527f 100755 --- a/autogen.bash +++ b/autogen.bash @@ -17,14 +17,6 @@ run() { fi } -make_from_m4() { - echo ">>> $(get_m4 ) -E ${1}.m4 > ${1}" - if ! $(get_m4 ) -E ${1}.m4 > ${1} ; then - echo "oops!" 1>&2 - exit 127 - fi -} - get() { type ${1}-${2} &>/dev/null && echo ${1}-${2} && return type ${1}${2//.} &>/dev/null && echo ${1}${2//.} && return @@ -33,17 +25,10 @@ get() { kill $KILL_PID } -get_m4() { - type "gm4" &>/dev/null && echo gm4 && return - type "m4" &>/dev/null && echo m4 && return - echo "Could not find m4" 1>&2 - kill $KILL_PID -} - -make_from_m4 paludis/Makefile.am -make_from_m4 paludis/paludis.hh -make_from_m4 paludis/smart_record.hh -make_from_m4 paludis/comparison_policy.hh +misc/do_m4.bash paludis/Makefile.am || exit $? +misc/do_m4.bash paludis/paludis.hh || exit $? +misc/do_m4.bash paludis/smart_record.hh || exit $? +misc/do_m4.bash paludis/comparison_policy.hh || exit $? run mkdir -p config run $(get libtoolize 1.5 ) --copy --force --automake rm -f config.cache diff --git a/misc/Makefile.am b/misc/Makefile.am index 91a5cf3e9..ef81f090c 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -1,4 +1,4 @@ CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in svn-version-filter-data.bash -EXTRA_DIST = generated-file.txt svn-version-filter-data.bash.in +EXTRA_DIST = generated-file.txt svn-version-filter-data.bash.in do_m4.bash diff --git a/misc/do_m4.bash b/misc/do_m4.bash new file mode 100755 index 000000000..63a042e54 --- /dev/null +++ b/misc/do_m4.bash @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# vim: set sw=4 sts=4 et tw=80 : + +if test "xyes" = x"${BASH_VERSION}" ; then + echo "This is not bash!" + exit 127 +fi + +trap 'echo "exiting." ; exit 250' 15 +KILL_PID=$$ + +get_m4() { + type "gm4" &>/dev/null && echo gm4 && return + type "m4" &>/dev/null && echo m4 && return + echo "Could not find m4" 1>&2 + kill $KILL_PID +} + +echo ">>> $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1}" +if ! $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1} ; then + echo "oops!" 1>&2 + exit 127 +fi diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4 index 720811d09..4d840109b 100644 --- a/paludis/Makefile.am.m4 +++ b/paludis/Makefile.am.m4 @@ -1,7 +1,7 @@ ifdef(`__gnu__',`',`errprint(`This is not GNU m4... ')m4exit(1)') include(`misc/generated-file.txt') -dnl vim: set ft=m4 et : +dnl vim: set ft=m4 noet : define(`filelist', `')dnl define(`testlist', `')dnl @@ -43,3 +43,14 @@ check_PROGRAMS = $(TESTS) check_SCRIPTS = testscriptlist noinst_LIBRARIES = libpaludis.a +Makefile.am : Makefile.am.m4 files.m4 + $(top_srcdir)/misc/do_m4.bash Makefile.am + +paludis.hh : paludis.hh.m4 files.m4 + $(top_srcdir)/misc/do_m4.bash paludis.hh + +smart_record.hh : smart_record.hh.m4 + $(top_srcdir)/misc/do_m4.bash smart_record.hh + +comparison_policy.hh : comparison_policy.hh.m4 + $(top_srcdir)/misc/do_m4.bash comparison_policy.hh.m4 diff --git a/paludis/files.m4 b/paludis/files.m4 index 5f864ae52..f9d6ebe42 100644 --- a/paludis/files.m4 +++ b/paludis/files.m4 @@ -1,6 +1,12 @@ dnl vim: set ft=m4 et : dnl This file is used by Makefile.am.m4 and paludis.hh.m4. You should dnl use the provided autogen.bash script to do all the hard work. +dnl +dnl This file is used to avoid having to make lots of repetitive changes in +dnl Makefile.am every time we add a source or test file. The first parameter is +dnl the base filename with no extension; later parameters can be `hh', `cc', +dnl `test', `impl', `testscript'. Note that there isn't much error checking done +dnl on this file at present... add(`about', `hh', `test') add(`all_dep_atom', `hh', `cc') |