From f4b746b8c23c257574b44e6bc0ad830c754f0c6b Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 19 Oct 2013 12:21:09 -0400 Subject: [SV 40254] Modify build.sh to work properly with Guile support. * guile.c (guile_gmake_setup) [HAVE_GUILE]: Define a stub function when Guile support is not enabled. * main.c (main) [HAVE_GUILE]: Always invoke guile_gmake_setup(). * Makefile.am: Make guile.c standard, not optional. * build.template: Add the Guile compiler and linker flags. --- Makefile.am | 6 +----- build.template | 8 ++++---- guile.c | 13 +++++++++++++ main.c | 2 -- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8cbfe7e..6303d96 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,15 +40,11 @@ else endif make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \ - function.c getopt.c getopt1.c implicit.c job.c load.c \ + function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \ loadapi.c main.c misc.c output.c read.c remake.c rule.c \ signame.c strcache.c variable.c version.c vpath.c hash.c \ $(remote) -if HAVE_GUILE - make_SOURCES += guile.c -endif - EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \ diff --git a/build.template b/build.template index 1a06ec6..1565b72 100644 --- a/build.template +++ b/build.template @@ -22,11 +22,11 @@ srcdir='@srcdir@' CC='@CC@' -CFLAGS='@CFLAGS@' +CFLAGS='@CFLAGS@ @GUILE_CFLAGS@' CPPFLAGS='@CPPFLAGS@' -LDFLAGS='@LDFLAGS@' +LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@' ALLOCA='@ALLOCA@' -LOADLIBES='@LIBS@ @LIBINTL@' +LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@' eval extras=\'@LIBOBJS@\' REMOTE='@REMOTE@' GLOBLIB='@GLOBLIB@' @@ -46,7 +46,7 @@ includedir=${prefix}/include localedir=${prefix}/share/locale aliaspath=${localedir}${PATH_SEPARATOR}. -defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@' +defines="-DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@' # Exit as soon as any command fails. set -e diff --git a/guile.c b/guile.c index 499585c..40d99aa 100644 --- a/guile.c +++ b/guile.c @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "makeint.h" + +#ifdef HAVE_GUILE + #include "gnumake.h" #include "debug.h" @@ -144,3 +147,13 @@ guile_gmake_setup (const gmk_floc *flocp UNUSED) return 1; } + +#else + +int +guile_gmake_setup (const gmk_floc *flocp UNUSED) +{ + return 1; +} + +#endif diff --git a/main.c b/main.c index e5fbefe..3b33ea5 100644 --- a/main.c +++ b/main.c @@ -1286,10 +1286,8 @@ main (int argc, char **argv, char **envp) define_variable_cname (".FEATURES", features, o_default, 0); } -#ifdef HAVE_GUILE /* Configure GNU Guile support */ guile_gmake_setup (NILF); -#endif /* Read in variables from the environment. It is important that this be done before $(MAKE) is figured out so its definitions will not be -- cgit v1.2.3