[812138] | 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], |
---|
[4021bb] | 12 | [*linux-gnu], [SUPPORTS_DYNAMIC_MODULES=yes], |
---|
| 13 | [*-sun-solaris2*], [SUPPORTS_DYNAMIC_MODULES=yes], |
---|
[f0cf96] | 14 | [*-apple-darwin*], [SUPPORTS_DYNAMIC_MODULES=yes], |
---|
[812138] | 15 | [SUPPORTS_DYNAMIC_MODULES=no] |
---|
| 16 | ) |
---|
| 17 | AC_MSG_RESULT($SUPPORTS_DYNAMIC_MODULES) |
---|
| 18 | ]) |
---|
| 19 | |
---|
| 20 | AC_DEFUN([SING_CHECK_P_PROCS], |
---|
| 21 | [ |
---|
| 22 | AC_ARG_ENABLE(p-procs-static, |
---|
[2dcf453] | 23 | [ --enable-p-procs-static Enable statically compiled p_Procs-modules |
---|
[812138] | 24 | ], |
---|
| 25 | [if test $enableval = yes; then |
---|
| 26 | ENABLE_P_PROCS_STATIC="yes" |
---|
[2dcf453] | 27 | ENABLE_P_PROCS_DYNAMIC="no" |
---|
[812138] | 28 | else |
---|
| 29 | ENABLE_P_PROCS_STATIC="no" |
---|
| 30 | fi |
---|
| 31 | ],[NO_P_PROCS_STATIC_GIVEN=yes]) |
---|
| 32 | |
---|
| 33 | AC_ARG_ENABLE(p-procs-dynamic, |
---|
[2dcf453] | 34 | [ --enable-p-procs-dynamic Enable dynamically compiled p_Procs-modules |
---|
[812138] | 35 | ], |
---|
| 36 | [if test $enableval = yes; then |
---|
| 37 | ENABLE_P_PROCS_DYNAMIC="yes" |
---|
[2dcf453] | 38 | ENABLE_P_PROCS_STATIC="no" |
---|
[812138] | 39 | else |
---|
| 40 | ENABLE_P_PROCS_DYNAMIC="no" |
---|
| 41 | fi |
---|
| 42 | ],[NO_P_PROCS_DYNAMIC_GIVEN=yes]) |
---|
| 43 | |
---|
| 44 | if 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 |
---|
| 49 | elif 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 |
---|
| 62 | fi |
---|
| 63 | |
---|
[e1761c] | 64 | if test x$ENABLE_P_PROCS_DYNAMIC = xyes; then |
---|
| 65 | AC_DEFINE(HAVE_DL,1,enable dynamic modules) |
---|
| 66 | fi |
---|
| 67 | |
---|
[812138] | 68 | AM_CONDITIONAL([ENABLE_P_PROCS_DYNAMIC],[test x$ENABLE_P_PROCS_DYNAMIC = xyes]) |
---|
| 69 | AM_CONDITIONAL([ENABLE_P_PROCS_STATIC],[test x$ENABLE_P_PROCS_STATIC = xyes]) |
---|
| 70 | |
---|
[4021bb] | 71 | ]) |
---|