Ticket #13731: xalloc-makefile.diff

File xalloc-makefile.diff, 6.8 KB (added by jdemeyer, 7 years ago)

Patch added to the spkg

  • patches/conditional/singular_xalloc.patch

    # 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
     1diff -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
    114@@ -666,7 +666,9 @@
    125           return dReportError("pNext(%c[%d].max) != NULL", TN, i);
    136 
     
    1811 #if KDEBUG > 0
    1912         if (! sloppy_max)
    2013         {
    21 diff --git a/kernel/pDebug.cc b/kernel/pDebug.cc
    22 --- a/kernel/pDebug.cc
    23 +++ b/kernel/pDebug.cc
     14diff -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
    2417@@ -72,6 +72,7 @@
    2518 {
    2619   if (p != NULL)
     
    5952     #endif
    6053     // number/coef check
    6154     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
     55diff -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
    6558@@ -94,7 +94,9 @@
    6659 PINLINE1 poly p_Init(const ring r, omBin bin)
    6760 {
     
    8275   poly new_p = p_New(r);
    8376   p_MemCopy_LengthGeneral(new_p->exp, p->exp, r->ExpL_Size);
    8477   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
     78diff -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
    8881@@ -296,7 +296,9 @@
    8982 PINLINE2 poly p_New(ring r, omBin bin)
    9083 {
     
    10598   return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
    10699 }
    107100 
    108 diff --git a/kernel/pShallowCopyDelete.cc b/kernel/pShallowCopyDelete.cc
    109 --- a/kernel/pShallowCopyDelete.cc
    110 +++ b/kernel/pShallowCopyDelete.cc
     101diff -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
    111104@@ -18,7 +18,9 @@
    112105   p_CheckPolyRing(s_p, s_r);
    113106   p_CheckRing(d_r);
     
    118111   assume(s_r->N == d_r->N);
    119112 
    120113   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 @@
     114diff -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 @@
    126118+#################################################################
    127119+###
    128120+### Makefile for xalloc
    129121+###
    130122+#################################################################
    131123+
     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@
    132156+
    133157+# normal C source files
    134158+CSOURCES=omFindExec.c
     
    150174+       $(RANLIB) $@
    151175+
    152176+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)
    156180+
    157181+install-nolns: install
    158182+
    159183+install-libsingular: install
    160184+
    161185+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
     187diff -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
    167190@@ -0,0 +1,15 @@
    168191+/* -*-c++-*- */
    169192+/*******************************************************************
     
    180203+*/
    181204+
    182205+#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
     206diff -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
    187209@@ -0,0 +1,226 @@
    188210+/*******************************************************************
    189211+ *  File:    omFindExec.c
     
    411433+struct omInfo_s om_Info; /* dummy */
    412434+struct omOpts_s om_Opts; /* dummy */
    413435+
    414 diff --git a/omalloc/omalloc.h b/omalloc/omalloc.h
    415 new file mode 100644
    416 --- /dev/null
    417 +++ b/omalloc/omalloc.h
     436diff -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
     442diff -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 */
     447diff -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
    418450@@ -0,0 +1,223 @@
    419451+#ifndef XMEMORY_H
    420452+#define XMEMORY_H
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    9797    fi
    9898
    9999    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 $?
    102105    fi
    103106
    104107    # Apply all patches