Ticket #398: 0001-Modified-the-omalloc-configuration-for-factory-and-m.patch

File 0001-Modified-the-omalloc-configuration-for-factory-and-m.patch, 5.9 KB (added by julien.puydt@…, 12 years ago)

"git format-patch -p1" version of the previous patch

  • Makefile.am

    From c9913418eab526979b668d93f6ac4fb093503242 Mon Sep 17 00:00:00 2001
    From: Julien Puydt <julien.puydt@laposte.net>
    Date: Tue, 31 Jan 2012 21:49:02 +0100
    Subject: [PATCH] Modified the omalloc configuration for factory/ and made
     toplevel use it
    
    The factory/ configure now has four options for omalloc:
     --enable-omalloc
     --with-omalloc-dir=<path> (to point to omalloc's main install)
     --with-omalloc-extra-dir=<path> (in case there needs a second
                                      -- think out-of-tree builds)
     --enable-omalloc-trust (to trust omalloc will be found at build-time
                             but don't check at configure-time)
    
    That last is especially useful to build factory/ inside singular,
    because in that case, omalloc.h includes omTables.h... which will exist
    only during the build!
    
    Finally, the toplevel Makefile.am and configure.ac are modified, so
    that the correct options are passed to factory/configure.
    ---
     Makefile.am          |    4 +--
     configure.ac         |   16 +++++++++++++
     factory/Makefile.am  |    2 +-
     factory/configure.ac |   62 +++++++++++++++++++++++++------------------------
     4 files changed, 50 insertions(+), 34 deletions(-)
    
    diff --git a/Makefile.am b/Makefile.am
    index c239975..340c02f 100644
    a b  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 ALLOC=omalloc
    4 
    53if ENABLE_FACTORY
    64  USE_FACTORY = factory
    75else
    86  USE_FACTORY =
    97endif
    108 
    11 PACKAGES=findexec $(ALLOC) $(USE_FACTORY) libpolys kernel numeric Singular IntegerProgramming
     9PACKAGES=findexec omalloc $(USE_FACTORY) libpolys kernel numeric Singular IntegerProgramming
    1210
    1311SUBDIRS=$(PACKAGES)
    1412
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 1d35cda..754fbc5 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