[nqp/f20] add patch file

Gerd Pokorra gerd at fedoraproject.org
Thu Apr 3 15:10:49 UTC 2014


commit 3cba716426da9534d5f0966feca7d03afa4ccf4f
Author: gerd <gp at zimt.uni-siegen.de>
Date:   Thu Apr 3 17:10:30 2014 +0200

    add patch file

 use_libtommath.patch |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)
---
diff --git a/use_libtommath.patch b/use_libtommath.patch
new file mode 100644
index 0000000..a8f9ec1
--- /dev/null
+++ b/use_libtommath.patch
@@ -0,0 +1,65 @@
+diff --git a/Configure.pl b/Configure.pl
+index 896da69..2e80bf4 100644
+--- Configure.pl
++++ Configure.pl
+@@ -29,8 +29,9 @@ MAIN: {
+                'with-parrot=s', 'gen-parrot:s',
+                'make-install!', 'makefile-timing!',
+                'backends=s', 'gen-moar:s', 'moar-option=s@',
+-               'git-protocol=s',
+-               'parrot-config=s', 'parrot-option=s@');
++               'git-protocol=s', 'has-libtommath',
++               'parrot-config=s', 'parrot-option=s@') or
++    die "See --help for further information\n";
+ 
+     # Print help if it's requested
+     if ($options{'help'}) {
+@@ -198,6 +199,22 @@ MAIN: {
+             }
+         }
+ 
++        if ($options{'has-libtommath'}) {
++            if (defined($config{'libs'})) {
++                $config{'libs'} .= ' -ltommath';
++            } elsif (defined($config{'parrot::libs'})) {
++                $config{'parrot::libs'} .= ' -ltommath';
++            } else {
++                $config{'libs'} = '-ltommath';
++            }
++            $config{'libtommath_src'} = '$(TOM)_mp_set_long$(O) $(TOM)_mp_get_long$(O)';
++            $config{'haslibtommath'} = '../../../../$(TOM)_mp_*_long$(O)';
++        }
++        else {
++            $config{'libtommath_src'} = '$(LIBTOMMATH_BIN)';
++            $config{'haslibtommath'} = '../../../../3rdparty/libtommath/*$(O)';
++        }
++
+         fill_template_file(
+             'tools/build/Makefile-Parrot.in', $MAKEFILE,
+             %config,
+@@ -323,6 +340,7 @@ General Options:
+                        Download and build a copy of Parrot to use
+     --parrot-option='--option=value'
+                        Options to pass to parrot configuration for --gen-parrot
++    --has-libtommath   Link NQP with the libtommath library of the system.
+     --gen-moar         Download and build a copy of MoarVM to use
+     --moar-option='--option=value'
+                        Options to pass to MoarVM configuration for --gen-moar
+diff --git a/tools/build/Makefile-Parrot.in b/tools/build/Makefile-Parrot.in
+index 034ce45..cd6da38 100644
+--- tools/build/Makefile-Parrot.in
++++ tools/build/Makefile-Parrot.in
+@@ -1006,11 +1006,11 @@ $(OPS_DIR)/$(OPS)$(LOAD_EXT): $(OPS_DIR)/$(OPS_SOURCE) $(DYNPMC)
+ 3rdparty/libtommath/bn_s_mp_sub$(O): 3rdparty/libtommath/bn_s_mp_sub.c $(LIBTOMMATH_H)
+ 	cd 3rdparty/libtommath && $(CC) -c @cc_o_out at bn_s_mp_sub$(O) -I. $(CFLAGS) bn_s_mp_sub.c
+ 
+-$(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT): $(OPS_DIR)/$(BIGINT_OPS_SOURCE) $(LIBTOMMATH_BIN) $(LIBTOMMATH_H) src/vm/parrot/6model/reprs/P6bigint.h src/vm/parrot/6model/reprs/P6bigint.c
++$(OPS_DIR)/$(BIGINT_OPS)$(LOAD_EXT): $(OPS_DIR)/$(BIGINT_OPS_SOURCE) @libtommath_src@ $(LIBTOMMATH_H) src/vm/parrot/6model/reprs/P6bigint.h src/vm/parrot/6model/reprs/P6bigint.c
+ 	cd $(OPS_DIR) && $(OPS2C) C --dynamic $(BIGINT_OPS_SOURCE)
+ 	cd $(OPS_DIR) && $(CC) -c @cc_o_out@$(BIGINT_OPS)$(O) $(CINCLUDES) -I../../../../3rdparty/libtommath $(CFLAGS) $(BIGINT_OPS).c
+ 	cd src/vm/parrot/6model/reprs && $(CC) -c @cc_o_out at P6bigint$(O) -I../../../../../$(PMC_DIR) -I../../../../../3rdparty/libtommath $(CINCLUDES) $(CFLAGS) P6bigint.c
+-	cd $(OPS_DIR) && $(LD) @ld_out@$(BIGINT_OPS)$(LOAD_EXT) $(BIGINT_OPS)$(O) ../../../../3rdparty/libtommath/*$(O) ../6model/reprs/P6bigint$(O) $(LINKARGS)
++	cd $(OPS_DIR) && $(LD) @ld_out@$(BIGINT_OPS)$(LOAD_EXT) $(BIGINT_OPS)$(O) @haslibtommath@ ../6model/reprs/P6bigint$(O) $(LINKARGS)
+ 
+ $(DYNCALL_BIN):
+ 	@dyncall_build@


More information about the scm-commits mailing list