[SV 40254] Modify build.sh to work properly with Guile support.
authorPaul Smith <psmith@gnu.org>
Sat, 19 Oct 2013 16:21:09 +0000 (12:21 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 19 Oct 2013 16:24:14 +0000 (12:24 -0400)
* 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
build.template
guile.c
main.c

index 8cbfe7ee344f9ebef8129e4c4a6ff7eb281db102..6303d96e77b93705e026300fb277ed6b90bd1055 100644 (file)
@@ -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 \
index 1a06ec6f72cbcd5a2b3b813b06d6574e02815eb4..1565b7256d46b832f0f4274dffb7dd9b19e9d94f 100644 (file)
 
 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 499585cfa7913baa09aa1565ea9aa05ff2b8d152..40d99aa43f5af94816fe092f2cf194b15fb683df 100644 (file)
--- 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 <http://www.gnu.org/licenses/>.  */
 
 #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 e5fbefe178b9d6f83d4df3af69036790019b414c..3b33ea54e1012b216879280af9cd825545544736 100644 (file)
--- 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