f8d165
From 996012f6abe0ce4d68a2de9f249935c6d5b467bc Mon Sep 17 00:00:00 2001
f8d165
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
f8d165
Date: Fri, 4 Oct 2013 22:13:11 +0200
f8d165
Subject: [PATCH] Allow to specify addition preludes by configuration option.
f8d165
f8d165
---
f8d165
 Makefile.in  | 2 ++
f8d165
 common.mk    | 2 +-
f8d165
 configure.ac | 7 +++++++
f8d165
 3 files changed, 10 insertions(+), 1 deletion(-)
f8d165
f8d165
diff --git a/Makefile.in b/Makefile.in
f8d165
index 7e8ed82..7916993 100644
f8d165
--- a/Makefile.in
f8d165
+++ b/Makefile.in
f8d165
@@ -119,6 +119,8 @@ XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
f8d165
 XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
f8d165
 BOOTSTRAPRUBY = @BOOTSTRAPRUBY@
f8d165
 
f8d165
+OPTIONAL_PRELUDES = @OPTIONAL_PRELUDES@
f8d165
+
f8d165
 #### End of system configuration section. ####
f8d165
 
f8d165
 MAJOR=	@MAJOR@
f8d165
diff --git a/common.mk b/common.mk
f8d165
index 5cfbc3d..3f0a82e 100644
f8d165
--- a/common.mk
f8d165
+++ b/common.mk
f8d165
@@ -147,7 +147,7 @@ ALLOBJS       = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
f8d165
 GOLFOBJS      = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
f8d165
 
f8d165
 DEFAULT_PRELUDES = $(GEM_PRELUDE)
f8d165
-PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES)
f8d165
+PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(DEFAULT_PRELUDES) $(OPTIONAL_PRELUDES)
f8d165
 GEM_PRELUDE   = $(srcdir)/gem_prelude.rb
f8d165
 PRELUDES      = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
f8d165
 GOLFPRELUDES  = {$(srcdir)}golf_prelude.c
f8d165
diff --git a/configure.ac b/configure.ac
f8d165
index 028ef7ca3e..cdeff87871 100644
f8d165
--- a/configure.ac
f8d165
+++ b/configure.ac
f8d165
@@ -4397,6 +4397,13 @@ AC_SUBST(rubyarchhdrdir)dnl
f8d165
 AC_SUBST(sitearchhdrdir)dnl
f8d165
 AC_SUBST(vendorarchhdrdir)dnl
f8d165
 
f8d165
+AC_ARG_WITH(prelude,
f8d165
+		AS_HELP_STRING([--with-prelude=FILE-LIST], [specify additional preludes separated by space]),
f8d165
+		[prelude=$withval])
f8d165
+if test "$prelude" != ""; then
f8d165
+    AC_SUBST(OPTIONAL_PRELUDES, $prelude)
f8d165
+fi
f8d165
+
f8d165
 AC_ARG_WITH(mantype,
f8d165
 	AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
f8d165
 		[
f8d165
-- 
f8d165
1.8.3.1
f8d165