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 | |
---|
7 | AC_DEFUN([SING_SYSTEM_SUPPORTS_DYNAMIC_MODULES], |
---|
8 | [ |
---|
9 | AC_CANONICAL_HOST |
---|
10 | AC_MSG_CHECKING(whether system supports dynamic modules) |
---|
11 | AS_CASE([$host], |
---|
12 | [*linux-gnu], [SUPPORTS_DYNAMIC_MODULES=yes], |
---|
13 | [*-sun-solaris2*], [SUPPORTS_DYNAMIC_MODULES=yes], |
---|
14 | [SUPPORTS_DYNAMIC_MODULES=no] |
---|
15 | ) |
---|
16 | AC_MSG_RESULT($SUPPORTS_DYNAMIC_MODULES) |
---|
17 | ]) |
---|
18 | |
---|
19 | AC_DEFUN([SING_CHECK_P_PROCS], |
---|
20 | [ |
---|
21 | AC_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 | |
---|
31 | AC_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 | |
---|
41 | if 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 |
---|
46 | elif 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 |
---|
59 | fi |
---|
60 | |
---|
61 | AM_CONDITIONAL([ENABLE_P_PROCS_DYNAMIC],[test x$ENABLE_P_PROCS_DYNAMIC = xyes]) |
---|
62 | AM_CONDITIONAL([ENABLE_P_PROCS_STATIC],[test x$ENABLE_P_PROCS_STATIC = xyes]) |
---|
63 | |
---|
64 | ]) |
---|