source: git/m4/p-procs.m4 @ 812138

spielwiese
Last change on this file since 812138 was 812138, checked in by Bradford Hovinen <hovinen@…>, 13 years ago
* Create new macros SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES and SING_CHECK_P_PROCS to resolve question of whether to enable p_Procs_Static and p_Procs_Dynamic * Invoke new macro in libpolys/polys/configure.ac and use its output to direct compilation in libpolys/polys/Makefile.am
  • Property mode set to 100644
File size: 2.0 KB
Line 
1# pprocs.m4
2# Copyright 2011 Bradford Hovinen <hovinen@gmail.com>
3#
4# Macro to check user-preferences and system-settings and enable or
5# disable static or dynamic modules for polynomial-operations
6
7AC_DEFUN([SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES],
8[
9AC_CANONICAL_HOST
10AC_MSG_CHECKING(whether system supports dynamic modules)
11AS_CASE([$host],
12  [i?86-*linux-gnu], [SUPPORTS_DYNAMIC_MODULES=yes],
13  [x86_64-*linux-gnu], [SUPPORTS_DYNAMIC_MODULES=yes],
14  [SUPPORTS_DYNAMIC_MODULES=no]
15)
16AC_MSG_RESULT($SUPPORTS_DYNAMIC_MODULES)
17])
18
19AC_DEFUN([SING_CHECK_P_PROCS],
20[
21AC_ARG_ENABLE(p-procs-static,
22[  --enable-p-procs-static  Enable statically compiled p_Procs-modules
23],
24[if test $enableval = yes; then
25     ENABLE_P_PROCS_STATIC="yes"
26 else
27     ENABLE_P_PROCS_STATIC="no"
28 fi
29],[NO_P_PROCS_STATIC_GIVEN=yes])
30
31AC_ARG_ENABLE(p-procs-dynamic,
32[  --enable-p-procs-dynamic  Enable dynamically compiled p_Procs-modules
33],
34[if test $enableval = yes; then
35     ENABLE_P_PROCS_DYNAMIC="yes"
36 else
37     ENABLE_P_PROCS_DYNAMIC="no"
38 fi
39],[NO_P_PROCS_DYNAMIC_GIVEN=yes])
40
41if test x$ENABLE_P_PROCS_DYNAMIC = xyes; then
42  SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES
43  if test $SUPPORTS_DYNAMIC_MODULES = no; then
44    AC_MSG_ERROR([--enable-pprocs-dynamic requested but your system appears not to support dynamic modules properly])
45  fi
46elif test x$NO_P_PROCS_DYNAMIC_GIVEN = xyes -a x$NO_P_PROCS_STATIC_GIVEN = xyes; then
47  SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES
48  if test $SUPPORTS_DYNAMIC_MODULES = yes; then
49    AC_MSG_NOTICE([Enabling dynamic modules and disabling static modules])
50    ENABLE_P_PROCS_DYNAMIC="yes"
51    ENABLE_P_PROCS_STATIC="no"
52  elif test $SUPPORTS_DYNAMIC_MODULES = no; then
53    AC_MSG_NOTICE([Enabling static modules and disabling dynamic modules])
54    ENABLE_P_PROCS_DYNAMIC="no"
55    ENABLE_P_PROCS_STATIC="yes"
56  else
57    AC_MSG_ERROR([Unknown whether system supports dynamic modules or not. This should not have happened.])
58  fi
59fi
60
61AM_CONDITIONAL([ENABLE_P_PROCS_DYNAMIC],[test x$ENABLE_P_PROCS_DYNAMIC = xyes])
62AM_CONDITIONAL([ENABLE_P_PROCS_STATIC],[test x$ENABLE_P_PROCS_STATIC = xyes])
63
64])
Note: See TracBrowser for help on using the repository browser.