source: git/m4/p-procs.m4 @ 4ffb46

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