Ticket #398: singular_omalloc.patch

File singular_omalloc.patch, 4.7 KB (added by julien.puydt@…, 12 years ago)

Patch to handle omalloc in spielwiese

  • Makefile.am

    diff --git a/Makefile.am b/Makefile.am
    index 88653d8..24ea58b 100644
    a b  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 ALLOC=omalloc
    4 
    53if ENABLE_FACTORY
    64  USE_FACTORY = factory
    75else
    86  USE_FACTORY =
    97endif
    10  
    11 PACKAGES=findexec $(ALLOC) $(USE_FACTORY) libpolys kernel numeric Singular
     8
     9PACKAGES=findexec omalloc $(USE_FACTORY) libpolys kernel numeric Singular
    1210
    1311SUBDIRS=$(PACKAGES)
    1412
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index b532d0f..4d0e975 100644
    a b  
    11AC_INIT([singular],[3.1.3.sw])
    22
     3_AC_SRCDIRS(["$ac_dir"])
     4
    35AC_CONFIG_MACRO_DIR([m4])
    46AC_CONFIG_AUX_DIR([.])
    57
    AC_DEFINE_UNQUOTED([LDFLAGS],"$LDFLAGS",[LDFLAGS]) 
    9597### the following is needed due to the use of om_sing_opt_show_mem in misc_ip.cc...
    9698#ac_configure_args="$ac_configure_args --with-external-config_h=../Singular/omSingularConfig.h"
    9799
     100AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc], [use omalloc for the factory]),
     101[if test "x$enableval"  = "xyes"; then
     102  enable_omalloc=yes
     103fi], enable_omalloc=no)
     104
     105AC_MSG_CHECKING(whether to use omalloc in factory)
     106if test "$enable_omalloc" = yes; then
     107
     108  AC_MSG_RESULT(yes)
     109  ac_configure_args="$ac_configure_args --with-omalloc-dir=$ac_abs_top_srcdir --with-omalloc-extra-dir=$ac_abs_top_builddir --enable-omalloc-trust"
     110else
     111  AC_MSG_RESULT(no)
     112fi
     113
    98114AC_CONFIG_SUBDIRS(omalloc)
    99115
    100116if test x$ENABLE_FACTORY = xyes; then
  • factory/Makefile.am

    diff --git a/factory/Makefile.am b/factory/Makefile.am
    index 1df4f65..91f36dd 100644
    a b SUBDIRS=$(PACKAGES) 
    66CXXTEMPLFLAGS=
    77## -fno-implicit-templates
    88
    9 AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include ${GMP_CFLAGS} ${NTL_CFLAGS}
     9AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include ${GMP_CFLAGS} ${NTL_CFLAGS} ${OMALLOC_CFLAGS}
    1010
    1111AM_LDFLAGS =  -L${builddir} -L${builddir}/libfac
    1212
  • factory/configure.ac

    diff --git a/factory/configure.ac b/factory/configure.ac
    index 301a6bb..fbf3e4e 100644
    a b  
     1
    12dnl # emacs edit mode for this file is -*- sh -*-
    23dnl # $Id$
    34
    AC_ARG_WITH( 
    4748  ,
    4849  [with_Singular=yes])
    4950
     51AC_ARG_ENABLE(omalloc, AS_HELP_STRING([--enable-omalloc],[build for use with omalloc]),
     52[if test "x$enableval" = "xyes"; then
     53  enable_omalloc=yes
     54fi], enable_omalloc=no)
    5055
    51 AC_ARG_WITH(
    52   omalloc,
    53   [AS_HELP_STRING([--with-omalloc],[build for use with omalloc])])
     56AC_ARG_ENABLE(omalloc_trust, AS_HELP_STRING([--enable-omalloc-trust],[do not check the omalloc header]),
     57[if test "x$enableval" = "xyes"; then
     58  omalloc_trust=yes
     59fi], omalloc_trust=no)
    5460
     61AC_ARG_WITH(omalloc_dir,[AS_HELP_STRING([--with-omalloc-dir=PTH],[location of omalloc])], with_omalloc_dir="$withval", with_omalloc_dir="")
     62
     63AC_ARG_WITH(omalloc_extra_dir,[AS_HELP_STRING([--with-omalloc-extra-dir=PTH],[optional extra location of omalloc])], with_omalloc_extra_dir="$withval", with_omalloc_extra_dir="")
    5564
    5665AC_ARG_ENABLE(
    5766  cf-inline,
    if test "x$enable_timing" != xno; then 
    227236                  \`configure --disable-timing') ])
    228237fi
    229238
    230 AC_CHECK_HEADERS(omalloc.h,,)
    231 
    232239# font-lock-trick: '
    233240
    234241#
    fi 
    351358#  AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
    352359#fi
    353360
     361AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
    354362AC_MSG_CHECKING(whether to use omalloc)
     363if test "$enable_omalloc" = yes; then
    355364
    356 if test "$with_omalloc" = yes; then
    357   if test "$ac_cv_header_omalloc_h" != yes; then
    358     if test "$enable_omalloc" = yes; then
    359        warn_omalloc=yes
    360     else
    361        with_omalloc=no
    362     fi
     365  AC_MSG_RESULT(yes)
     366  CPPFLAGS_save="$CPPFLAGS"
     367  if test "x$with_omalloc_dir" != "x"; then
     368    OMALLOC_CFLAGS="-I${with_omalloc_dir}"
    363369  fi
    364 else
    365   if test "$with_omalloc" != no; then
    366     if test "$enable_omalloc" = yes; then
    367       if test "$ac_cv_header_omalloc_h" != yes; then
    368         warn_omalloc=yes
    369       fi
    370       with_omalloc=yes
    371     else
    372       with_omalloc=no
     370  if test "x$with_omalloc_extra_dir" != "x"; then
     371    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
     372  fi
     373  if test $omalloc_trust = no; then
     374    AC_CHECK_HEADERS(omalloc/omalloc.h)
     375    if test "$ac_cv_header_omalloc_omalloc_h" != yes; then
     376      AC_MSG_ERROR([You asked for omalloc, but it was not found])
    373377    fi
     378  else
     379    AC_MSG_NOTICE(trusting the omalloc locations given)
     380    AC_MSG_RESULT()
    374381  fi
    375 fi
    376 
    377 AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
    378 if test "$with_omalloc" = yes; then
    379   AC_DEFINE([HAVE_OMALLOC],[1])
    380 fi
    381 AC_MSG_RESULT($with_omalloc)
    382 if test "$warn_omalloc" = yes; then
    383   AC_MSG_WARN(did not find omalloc.h -- install before compiling)
     382  AC_DEFINE(HAVE_OMALLOC,1, [omalloc support])
     383  AC_SUBST(OMALLOC_CFLAGS)
     384else
     385  AC_MSG_RESULT(no)
    384386fi
    385387
    386388