# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1356085975 -3600
# Node ID bf0e6e20391cc99593a5b4d0a44ca97ed03b5cb8
# Parent bf6d37de972c77c2112fb1cb27ef464b4c2a772e
Use configure for xalloc when SINGULAR_XALLOC=yes
diff --git a/patches/conditional/singular_xalloc.patch b/patches/conditional/singular_xalloc.patch
a
|
b
|
|
1 | | # HG changeset patch |
2 | | # User Simon King <simon.king@uni-jena.de> |
3 | | # Date 1354189511 -3600 |
4 | | # Node ID 16081b90915b00b49c62089d51dc2f30e5b4327f |
5 | | # Parent 6f7df27014a3c42decbda471871aae6012bc7d6d |
6 | | See Sage trac #13731: Create a Singular spkg using xalloc instead of omalloc. |
7 | | |
8 | | diff --git a/kernel/kutil.cc b/kernel/kutil.cc |
9 | | --- a/kernel/kutil.cc |
10 | | +++ b/kernel/kutil.cc |
| 1 | diff -ruN a/kernel/kutil.cc b/kernel/kutil.cc |
| 2 | --- a/kernel/kutil.cc 2012-02-22 16:00:05.000000000 +0100 |
| 3 | +++ b/kernel/kutil.cc 2012-12-21 11:08:42.117513571 +0100 |
11 | 4 | @@ -666,7 +666,9 @@ |
12 | 5 | return dReportError("pNext(%c[%d].max) != NULL", TN, i); |
13 | 6 | |
… |
… |
|
18 | 11 | #if KDEBUG > 0 |
19 | 12 | if (! sloppy_max) |
20 | 13 | { |
21 | | diff --git a/kernel/pDebug.cc b/kernel/pDebug.cc |
22 | | --- a/kernel/pDebug.cc |
23 | | +++ b/kernel/pDebug.cc |
| 14 | diff -ruN a/kernel/pDebug.cc b/kernel/pDebug.cc |
| 15 | --- a/kernel/pDebug.cc 2012-07-10 12:00:15.000000000 +0200 |
| 16 | +++ b/kernel/pDebug.cc 2012-12-21 11:08:42.127513707 +0100 |
24 | 17 | @@ -72,6 +72,7 @@ |
25 | 18 | { |
26 | 19 | if (p != NULL) |
… |
… |
|
59 | 52 | #endif |
60 | 53 | // number/coef check |
61 | 54 | pPolyAssumeReturnMsg(p->coef != NULL || (n_GetChar(r) >= 2), "NULL coef",p,r); |
62 | | diff --git a/kernel/pInline1.h b/kernel/pInline1.h |
63 | | --- a/kernel/pInline1.h |
64 | | +++ b/kernel/pInline1.h |
| 55 | diff -ruN a/kernel/pInline1.h b/kernel/pInline1.h |
| 56 | --- a/kernel/pInline1.h 2012-07-10 12:00:15.000000000 +0200 |
| 57 | +++ b/kernel/pInline1.h 2012-12-21 11:08:42.127513707 +0100 |
65 | 58 | @@ -94,7 +94,9 @@ |
66 | 59 | PINLINE1 poly p_Init(const ring r, omBin bin) |
67 | 60 | { |
… |
… |
|
82 | 75 | poly new_p = p_New(r); |
83 | 76 | p_MemCopy_LengthGeneral(new_p->exp, p->exp, r->ExpL_Size); |
84 | 77 | pSetCoeff0(new_p, pGetCoeff(p)); |
85 | | diff --git a/kernel/pInline2.h b/kernel/pInline2.h |
86 | | --- a/kernel/pInline2.h |
87 | | +++ b/kernel/pInline2.h |
| 78 | diff -ruN a/kernel/pInline2.h b/kernel/pInline2.h |
| 79 | --- a/kernel/pInline2.h 2012-07-10 12:00:15.000000000 +0200 |
| 80 | +++ b/kernel/pInline2.h 2012-12-21 11:08:42.127513707 +0100 |
88 | 81 | @@ -296,7 +296,9 @@ |
89 | 82 | PINLINE2 poly p_New(ring r, omBin bin) |
90 | 83 | { |
… |
… |
|
105 | 98 | return r->p_Procs->p_ShallowCopyDelete(p, r, bin); |
106 | 99 | } |
107 | 100 | |
108 | | diff --git a/kernel/pShallowCopyDelete.cc b/kernel/pShallowCopyDelete.cc |
109 | | --- a/kernel/pShallowCopyDelete.cc |
110 | | +++ b/kernel/pShallowCopyDelete.cc |
| 101 | diff -ruN a/kernel/pShallowCopyDelete.cc b/kernel/pShallowCopyDelete.cc |
| 102 | --- a/kernel/pShallowCopyDelete.cc 2012-07-10 12:00:15.000000000 +0200 |
| 103 | +++ b/kernel/pShallowCopyDelete.cc 2012-12-21 11:08:42.127513707 +0100 |
111 | 104 | @@ -18,7 +18,9 @@ |
112 | 105 | p_CheckPolyRing(s_p, s_r); |
113 | 106 | p_CheckRing(d_r); |
… |
… |
|
118 | 111 | assume(s_r->N == d_r->N); |
119 | 112 | |
120 | 113 | spolyrec dp; |
121 | | diff --git a/omalloc/Makefile b/omalloc/Makefile |
122 | | new file mode 100644 |
123 | | --- /dev/null |
124 | | +++ b/omalloc/Makefile |
125 | | @@ -0,0 +1,37 @@ |
| 114 | diff -ruN a/omalloc/Makefile.in b/omalloc/Makefile.in |
| 115 | --- a/omalloc/Makefile.in 1970-01-01 01:00:00.000000000 +0100 |
| 116 | +++ b/omalloc/Makefile.in 2012-12-21 11:17:12.767512898 +0100 |
| 117 | @@ -0,0 +1,69 @@ |
126 | 118 | +################################################################# |
127 | 119 | +### |
128 | 120 | +### Makefile for xalloc |
129 | 121 | +### |
130 | 122 | +################################################################# |
131 | 123 | + |
| 124 | +## |
| 125 | +## various paths |
| 126 | +## |
| 127 | +top_srcdir = @top_srcdir@ |
| 128 | +srcdir = @srcdir@ |
| 129 | +prefix = @prefix@ |
| 130 | +exec_prefix = @exec_prefix@ |
| 131 | + |
| 132 | +# header file is installed here |
| 133 | +includedir = @includedir@ |
| 134 | +# library is installed here |
| 135 | +libdir = @libdir@ |
| 136 | + |
| 137 | +## |
| 138 | +## various programs |
| 139 | +## |
| 140 | +@SET_MAKE@ |
| 141 | +CC = @CC@ |
| 142 | +AR = @AR@ |
| 143 | +RANLIB = @RANLIB@ |
| 144 | +PERL = @PERL@ |
| 145 | +LN_S = @LN_S@ |
| 146 | +INSTALL = @INSTALL@ |
| 147 | +INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 148 | +INSTALL_DATA = @INSTALL_DATA@ |
| 149 | +MKINSTALLDIRS = ./mkinstalldirs |
| 150 | +## |
| 151 | +## compiler and linker options |
| 152 | +## |
| 153 | +CFLAGS = @CFLAGS@ |
| 154 | +CPPFLAGS = @CPPFLAGS@ |
| 155 | +DEFS = @DEFS@ |
132 | 156 | + |
133 | 157 | +# normal C source files |
134 | 158 | +CSOURCES=omFindExec.c |
… |
… |
|
150 | 174 | + $(RANLIB) $@ |
151 | 175 | + |
152 | 176 | +install: libomalloc.a |
153 | | + install omalloc.h $(SAGE_LOCAL)/include/ |
154 | | + install mylimits.h $(SAGE_LOCAL)/include/ |
155 | | + install libomalloc.a $(SAGE_LOCAL)/lib/ |
| 177 | + $(INSTALL_DATA) omalloc.h $(includedir) |
| 178 | + $(INSTALL_DATA) mylimits.h $(includedir) |
| 179 | + $(INSTALL_DATA) libomalloc.a $(libdir) |
156 | 180 | + |
157 | 181 | +install-nolns: install |
158 | 182 | + |
159 | 183 | +install-libsingular: install |
160 | 184 | + |
161 | 185 | +clean: |
162 | | + rm *.o *.a |
163 | | diff --git a/omalloc/mylimits.h b/omalloc/mylimits.h |
164 | | new file mode 100644 |
165 | | --- /dev/null |
166 | | +++ b/omalloc/mylimits.h |
| 186 | + rm -f *.o *.a |
| 187 | diff -ruN a/omalloc/mylimits.h b/omalloc/mylimits.h |
| 188 | --- a/omalloc/mylimits.h 1970-01-01 01:00:00.000000000 +0100 |
| 189 | +++ b/omalloc/mylimits.h 2012-12-21 11:08:42.137513466 +0100 |
167 | 190 | @@ -0,0 +1,15 @@ |
168 | 191 | +/* -*-c++-*- */ |
169 | 192 | +/******************************************************************* |
… |
… |
|
180 | 203 | +*/ |
181 | 204 | + |
182 | 205 | +#include <limits.h> |
183 | | diff --git a/omalloc/omFindExec.c b/omalloc/omFindExec.c |
184 | | new file mode 100755 |
185 | | --- /dev/null |
186 | | +++ b/omalloc/omFindExec.c |
| 206 | diff -ruN a/omalloc/omFindExec.c b/omalloc/omFindExec.c |
| 207 | --- a/omalloc/omFindExec.c 1970-01-01 01:00:00.000000000 +0100 |
| 208 | +++ b/omalloc/omFindExec.c 2012-12-21 11:08:42.137513466 +0100 |
187 | 209 | @@ -0,0 +1,226 @@ |
188 | 210 | +/******************************************************************* |
189 | 211 | + * File: omFindExec.c |
… |
… |
|
411 | 433 | +struct omInfo_s om_Info; /* dummy */ |
412 | 434 | +struct omOpts_s om_Opts; /* dummy */ |
413 | 435 | + |
414 | | diff --git a/omalloc/omalloc.h b/omalloc/omalloc.h |
415 | | new file mode 100644 |
416 | | --- /dev/null |
417 | | +++ b/omalloc/omalloc.h |
| 436 | diff -ruN a/omalloc/omGetPageSize.h b/omalloc/omGetPageSize.h |
| 437 | --- a/omalloc/omGetPageSize.h 1970-01-01 01:00:00.000000000 +0100 |
| 438 | +++ b/omalloc/omGetPageSize.h 2012-12-21 11:27:51.537512976 +0100 |
| 439 | @@ -0,0 +1,2 @@ |
| 440 | +/* Dummy value for configure */ |
| 441 | +#define omalloc_getpagesize 4096 |
| 442 | diff -ruN a/omalloc/om_Alloc.c b/omalloc/om_Alloc.c |
| 443 | --- a/omalloc/om_Alloc.c 1970-01-01 01:00:00.000000000 +0100 |
| 444 | +++ b/omalloc/om_Alloc.c 2012-12-21 11:23:30.467512481 +0100 |
| 445 | @@ -0,0 +1 @@ |
| 446 | +/* Stub file to please configure */ |
| 447 | diff -ruN a/omalloc/omalloc.h b/omalloc/omalloc.h |
| 448 | --- a/omalloc/omalloc.h 1970-01-01 01:00:00.000000000 +0100 |
| 449 | +++ b/omalloc/omalloc.h 2012-12-21 11:08:42.137513466 +0100 |
418 | 450 | @@ -0,0 +1,223 @@ |
419 | 451 | +#ifndef XMEMORY_H |
420 | 452 | +#define XMEMORY_H |
diff --git a/spkg-install b/spkg-install
a
|
b
|
|
97 | 97 | fi |
98 | 98 | |
99 | 99 | if [ "x$SINGULAR_XALLOC" = "xyes" ]; then |
100 | | rm -r ../src/omalloc/* |
101 | | mv conditional/singular_xalloc.patch . || return $? |
| 100 | # Remove old omalloc files, except for configure |
| 101 | mv ../src/omalloc/configure configure_omalloc |
| 102 | rm -r ../src/omalloc/* |
| 103 | mv configure_omalloc ../src/omalloc/configure |
| 104 | mv conditional/singular_xalloc.patch . || return $? |
102 | 105 | fi |
103 | 106 | |
104 | 107 | # Apply all patches |