| @@ -1,70 +1,29 @@ | | | @@ -1,70 +1,29 @@ |
1 | $NetBSD: patch-aa,v 1.5 2015/09/19 15:42:44 taca Exp $ | | 1 | $NetBSD: patch-aa,v 1.6 2017/04/18 00:44:27 minskim Exp $ |
2 | | | 2 | |
3 | * Make ruby and swig commands are settable. | | 3 | * Make ruby and swig commands are settable. |
4 | * support DESTDIR. | | 4 | * support DESTDIR. |
5 | * Add an include directory for ruby 1.9 and later. | | 5 | * Add an include directory for ruby 1.9 and later. |
6 | * Fix build for Ruby 2.2 and later. | | 6 | * Fix build for Ruby 2.2 and later. |
7 | | | 7 | |
8 | --- Makefile.orig 2010-06-09 17:13:08.000000000 +0000 | | 8 | --- Makefile.orig 2016-08-15 17:12:01.000000000 +0000 |
9 | +++ Makefile | | 9 | +++ Makefile |
10 | @@ -1,9 +1,8 @@ | | 10 | @@ -1,9 +1,8 @@ |
11 | #YACC=yacc | | 11 | #YACC=yacc |
12 | YACC=bison -y -v | | 12 | YACC=bison -y -v |
13 | LEX=flex -P$(YYPREFIX) -olex.yy.c | | 13 | LEX=flex -P$(YYPREFIX) -olex.yy.c |
14 | -SWIG=swig | | 14 | -SWIG=swig |
15 | -RUBY=ruby | | 15 | -RUBY=ruby |
16 | -#RUBY=ruby19 | | 16 | -#RUBY=ruby19 |
17 | +SWIG?=swig | | 17 | +SWIG?=swig |
18 | +RUBY?=ruby | | 18 | +RUBY?=ruby |
19 | | | 19 | |
20 | RM=rm -f | | 20 | RM=rm -f |
21 | INSTALL=install -c | | 21 | INSTALL=install -c |
22 | @@ -37,18 +36,19 @@ clean: | | 22 | @@ -77,5 +76,5 @@ test_ruby: |
23 | install: itex2MML | | | |
24 | $(INSTALL) itex2MML $(BINDIR) | | | |
25 | | | | |
26 | -RUBY_CFLAGS = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["CFLAGS"]') | | | |
27 | -RUBY_LD = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LDSHARED"]') | | | |
28 | -RUBYLIBDIR =$(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["libdir"]') | | | |
29 | -RUBY_PREFIX = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubylibdir"]') | | | |
30 | -RUBY_ARCH = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["arch"]') | | | |
31 | -RUBYDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["archdir"]') | | | |
32 | -RUBYHDRDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["rubyhdrdir"]') | | | |
33 | -RUBY_SITEDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitelibdir"]') | | | |
34 | -RUBY_SITEARCHDIR = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["sitearchdir"]') | | | |
35 | -LIBRUBYARG = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["LIBRUBYARG"]') | | | |
36 | -DYLIB_EXT = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["DLEXT"]') | | | |
37 | -RUBY_target_os = $(shell $(RUBY) -e 'require "rbconfig"; print Config::CONFIG["target_os"]') | | | |
38 | +RUBY_CFLAGS = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["CFLAGS"]') | | | |
39 | +RUBY_LD = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["LDSHARED"]') | | | |
40 | +RUBYLIBDIR =$(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["libdir"]') | | | |
41 | +RUBY_PREFIX = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["rubylibdir"]') | | | |
42 | +RUBY_ARCH = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["arch"]') | | | |
43 | +RUBYDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["archdir"]') | | | |
44 | +RUBYHDRDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["rubyhdrdir"]') | | | |
45 | +RUBY_SITEDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["vendorlibdir"]') | | | |
46 | +RUBY_SITEARCHDIR = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["vendorarchdir"]') | | | |
47 | +LIBRUBYARG = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["LIBRUBYARG"]') | | | |
48 | +DYLIB_EXT = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["DLEXT"]') | | | |
49 | +RUBY_target_os = $(shell $(RUBY) -e 'require "rbconfig"; print RbConfig::CONFIG["target_os"]') | | | |
50 | +RUBYARCHINCLUDE = $(shell $(RUBY) -e 'require "rbconfig"; if RbConfig::CONFIG["ruby_version"] > "1.8"; print "-I" + File.join(RbConfig::CONFIG["rubyhdrdir"], RbConfig::CONFIG["arch"]); end ') | | | |
51 | | | | |
52 | ifneq (, $(findstring darwin, $(RUBY_target_os)) ) | | | |
53 | EXTRA_CFLAGS = -DHAVE_SNPRINTF -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE | | | |
54 | @@ -62,7 +62,7 @@ itex2MML_ruby.c: itex2MML.i | | | |
55 | $(SWIG) -ruby -o itex2MML_ruby.c itex2MML.i | | | |
56 | | | | |
57 | itex2MML_ruby.o: itex2MML_ruby.c | | | |
58 | - $(CC) $(RUBY_CFLAGS) $(EXTRA_CFLAGS) -c itex2MML_ruby.c -I$(RUBYHDRDIR) -I$(RUBYDIR) -o itex2MML_ruby.o | | | |
59 | + $(CC) $(RUBY_CFLAGS) $(EXTRA_CFLAGS) -c itex2MML_ruby.c -I$(RUBYHDRDIR) $(RUBYARCHINCLUDE) -I$(RUBYDIR) -o itex2MML_ruby.o | | | |
60 | | | | |
61 | y.tab_ruby.o: y.tab.c | | | |
62 | $(CC) $(RUBY_CFLAGS) -Ditex2MML_CAPTURE -c -o y.tab_ruby.o y.tab.c | | | |
63 | @@ -77,5 +77,5 @@ test_ruby: | | | |
64 | $(RUBY) ./itextomml.rb | | 23 | $(RUBY) ./itextomml.rb |
65 | | | 24 | |
66 | install_ruby: itex2MML.$(DYLIB_EXT) | | 25 | install_ruby: itex2MML.$(DYLIB_EXT) |
67 | - $(INSTALL) itex2MML.$(DYLIB_EXT) $(RUBY_SITEARCHDIR) | | 26 | - $(INSTALL) itex2MML.$(DYLIB_EXT) $(RUBY_SITEARCHDIR) |
68 | - $(INSTALL) itextomml.rb itex_stringsupport.rb $(RUBY_SITEDIR) | | 27 | - $(INSTALL) itextomml.rb itex_stringsupport.rb $(RUBY_SITEDIR) |
69 | + $(INSTALL) itex2MML.$(DYLIB_EXT) $(DESTDIR)$(RUBY_SITEARCHDIR) | | 28 | + $(INSTALL) itex2MML.$(DYLIB_EXT) $(DESTDIR)$(RUBY_SITEARCHDIR) |
70 | + $(BSD_INSTALL_DATA) itextomml.rb itex_stringsupport.rb $(DESTDIR)$(RUBY_SITEDIR) | | 29 | + $(BSD_INSTALL_DATA) itextomml.rb itex_stringsupport.rb $(DESTDIR)$(RUBY_SITEDIR) |