70 lines
3.8 KiB
Text
70 lines
3.8 KiB
Text
$NetBSD: patch-aa,v 1.5 2015/09/19 15:42:44 taca Exp $
|
|
|
|
* Make ruby and swig commands are settable.
|
|
* support DESTDIR.
|
|
* Add an include directory for ruby 1.9 and later.
|
|
* Fix build for Ruby 2.2 and later.
|
|
|
|
--- Makefile.orig 2010-06-09 17:13:08.000000000 +0000
|
|
+++ Makefile
|
|
@@ -1,9 +1,8 @@
|
|
#YACC=yacc
|
|
YACC=bison -y -v
|
|
LEX=flex -P$(YYPREFIX) -olex.yy.c
|
|
-SWIG=swig
|
|
-RUBY=ruby
|
|
-#RUBY=ruby19
|
|
+SWIG?=swig
|
|
+RUBY?=ruby
|
|
|
|
RM=rm -f
|
|
INSTALL=install -c
|
|
@@ -37,18 +36,19 @@ clean:
|
|
install: itex2MML
|
|
$(INSTALL) itex2MML $(BINDIR)
|
|
|
|
-RUBY_CFLAGS = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["CFLAGS"]')
|
|
-RUBY_LD = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LDSHARED"]')
|
|
-RUBYLIBDIR =$(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["libdir"]')
|
|
-RUBY_PREFIX = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubylibdir"]')
|
|
-RUBY_ARCH = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["arch"]')
|
|
-RUBYDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["archdir"]')
|
|
-RUBYHDRDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubyhdrdir"]')
|
|
-RUBY_SITEDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitelibdir"]')
|
|
-RUBY_SITEARCHDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitearchdir"]')
|
|
-LIBRUBYARG = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LIBRUBYARG"]')
|
|
-DYLIB_EXT = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["DLEXT"]')
|
|
-RUBY_target_os = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["target_os"]')
|
|
+RUBY_CFLAGS = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["CFLAGS"]')
|
|
+RUBY_LD = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["LDSHARED"]')
|
|
+RUBYLIBDIR =$(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["libdir"]')
|
|
+RUBY_PREFIX = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["rubylibdir"]')
|
|
+RUBY_ARCH = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["arch"]')
|
|
+RUBYDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["archdir"]')
|
|
+RUBYHDRDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["rubyhdrdir"]')
|
|
+RUBY_SITEDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["vendorlibdir"]')
|
|
+RUBY_SITEARCHDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["vendorarchdir"]')
|
|
+LIBRUBYARG = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["LIBRUBYARG"]')
|
|
+DYLIB_EXT = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["DLEXT"]')
|
|
+RUBY_target_os = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["target_os"]')
|
|
+RUBYARCHINCLUDE = $(shell $(RUBY) -e 'require "rbconfig"; if RbConfig::CONFIG["ruby_version"] > "1.8"; print "-I" + File.join(RbConfig::CONFIG["rubyhdrdir"], RbConfig::CONFIG["arch"]); end ')
|
|
|
|
ifneq (, $(findstring darwin, $(RUBY_target_os)) )
|
|
EXTRA_CFLAGS = -DHAVE_SNPRINTF -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
|
|
@@ -62,7 +62,7 @@ itex2MML_ruby.c: itex2MML.i
|
|
$(SWIG) -ruby -o itex2MML_ruby.c itex2MML.i
|
|
|
|
itex2MML_ruby.o: itex2MML_ruby.c
|
|
- $(CC) $(RUBY_CFLAGS) $(EXTRA_CFLAGS) -c itex2MML_ruby.c -I$(RUBYHDRDIR) -I$(RUBYDIR) -o itex2MML_ruby.o
|
|
+ $(CC) $(RUBY_CFLAGS) $(EXTRA_CFLAGS) -c itex2MML_ruby.c -I$(RUBYHDRDIR) $(RUBYARCHINCLUDE) -I$(RUBYDIR) -o itex2MML_ruby.o
|
|
|
|
y.tab_ruby.o: y.tab.c
|
|
$(CC) $(RUBY_CFLAGS) -Ditex2MML_CAPTURE -c -o y.tab_ruby.o y.tab.c
|
|
@@ -77,5 +77,5 @@ test_ruby:
|
|
$(RUBY) ./itextomml.rb
|
|
|
|
install_ruby: itex2MML.$(DYLIB_EXT)
|
|
- $(INSTALL) itex2MML.$(DYLIB_EXT) $(RUBY_SITEARCHDIR)
|
|
- $(INSTALL) itextomml.rb itex_stringsupport.rb $(RUBY_SITEDIR)
|
|
+ $(INSTALL) itex2MML.$(DYLIB_EXT) $(DESTDIR)$(RUBY_SITEARCHDIR)
|
|
+ $(BSD_INSTALL_DATA) itextomml.rb itex_stringsupport.rb $(DESTDIR)$(RUBY_SITEDIR)
|