source: git/m4/p-procs.m4 @ 2dcf453

spielwiese
Last change on this file since 2dcf453 was 2dcf453, checked in by Mohamed Barakat <mohamed.barakat@…>, 13 years ago
do not compile dynamic modules unless ENABLE_P_PROCS_DYNAMIC=true
  • Property mode set to 100644
File size: 2.2 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  [*linux-gnu], [SUPPORTS_DYNAMIC_MODULES=yes],
13  [*-sun-solaris2*], [SUPPORTS_DYNAMIC_MODULES=yes],
14  [*-apple-darwin*], [SUPPORTS_DYNAMIC_MODULES=yes],
15  [SUPPORTS_DYNAMIC_MODULES=no]
16)
17AC_MSG_RESULT($SUPPORTS_DYNAMIC_MODULES)
18])
19
20AC_DEFUN([SING_CHECK_P_PROCS],
21[
22AC_ARG_ENABLE(p-procs-static,
23[  --enable-p-procs-static Enable statically compiled p_Procs-modules
24],
25[if test $enableval = yes; then
26     ENABLE_P_PROCS_STATIC="yes"
27     ENABLE_P_PROCS_DYNAMIC="no"
28 else
29     ENABLE_P_PROCS_STATIC="no"
30 fi
31],[NO_P_PROCS_STATIC_GIVEN=yes])
32
33AC_ARG_ENABLE(p-procs-dynamic,
34[  --enable-p-procs-dynamic Enable dynamically compiled p_Procs-modules
35],
36[if test $enableval = yes; then
37     ENABLE_P_PROCS_DYNAMIC="yes"
38     ENABLE_P_PROCS_STATIC="no"
39 else
40     ENABLE_P_PROCS_DYNAMIC="no"
41 fi
42],[NO_P_PROCS_DYNAMIC_GIVEN=yes])
43
44if test x$ENABLE_P_PROCS_DYNAMIC = xyes; then
45  SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES
46  if test $SUPPORTS_DYNAMIC_MODULES = no; then
47    AC_MSG_ERROR([--enable-pprocs-dynamic requested but your system appears not to support dynamic modules properly])
48  fi
49elif test x$NO_P_PROCS_DYNAMIC_GIVEN = xyes -a x$NO_P_PROCS_STATIC_GIVEN = xyes; then
50  SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES
51  if test $SUPPORTS_DYNAMIC_MODULES = yes; then
52    AC_MSG_NOTICE([Enabling dynamic modules and disabling static modules])
53    ENABLE_P_PROCS_DYNAMIC="yes"
54    ENABLE_P_PROCS_STATIC="no"
55  elif test $SUPPORTS_DYNAMIC_MODULES = no; then
56    AC_MSG_NOTICE([Enabling static modules and disabling dynamic modules])
57    ENABLE_P_PROCS_DYNAMIC="no"
58    ENABLE_P_PROCS_STATIC="yes"
59  else
60    AC_MSG_ERROR([Unknown whether system supports dynamic modules or not. This should not have happened.])
61  fi
62fi
63
64if test x$ENABLE_P_PROCS_DYNAMIC = xyes; then
65  AC_DEFINE(HAVE_DL,1,enable dynamic modules)
66fi
67
68AM_CONDITIONAL([ENABLE_P_PROCS_DYNAMIC],[test x$ENABLE_P_PROCS_DYNAMIC = xyes])
69AM_CONDITIONAL([ENABLE_P_PROCS_STATIC],[test x$ENABLE_P_PROCS_STATIC = xyes])
70
71])
Note: See TracBrowser for help on using the repository browser.