@@ -9,52 +9,7 @@ SAGE_SPKG_CONFIGURE([singular], [
9
9
AC_MSG_CHECKING ( [ that Singular's help is working] )
10
10
AS_IF ( [ test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x] , [
11
11
AC_MSG_RESULT ( yes )
12
- dnl We have Singular. Now determine the shared library path on
13
- dnl platforms on which sage.libs.singular needs to reload the library with RTLD_GLOBAL.
14
- AS_CASE ( [ $host_os] ,
15
- [ cygwin*] , [ dnl Nothing to do
16
- ] ,
17
- [ dnl Use pkg-config to get singular's libdir while we're at it. As a
18
- dnl moral compromise for using pkg-config, this ultimately allows us
19
- dnl to pass an absolute path to dlopen(), which is the only approach
20
- dnl that POSIX guarantees will work.
21
- PKG_CHECK_VAR([ SINGULAR_LIB_DIR] , [ Singular] , [ libdir] )
22
- dnl The acl_shlibext variable is set in the top-level configure.ac.
23
- AC_LANG_PUSH ( C )
24
- ORIG_LIBS="${LIBS}"
25
- LIBS="${LIBS} -ldl"
26
- AC_MSG_CHECKING ( [ if we can dlopen($LIBSINGULAR_PATH)] )
27
- LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libSingular.${acl_shlibext}"
28
-
29
- dnl if we can dlopen() it, substitute the name for sage_conf;
30
- dnl otherwise, fall back to using the SPKG.
31
- AC_RUN_IFELSE (
32
- [ AC_LANG_PROGRAM (
33
- [ [ #include <dlfcn.h>] ] ,
34
- [ [ void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
35
- if (h == 0) { return 1; } else { return dlclose(h); }] ]
36
- ) ] , [
37
- AC_MSG_RESULT ( yes )
38
- ] , [
39
- dnl try Debian-specific name
40
- LIBSINGULAR_PATH="${SINGULAR_LIB_DIR}/libsingular-Singular.${acl_shlibext}"
41
- AC_RUN_IFELSE (
42
- [ AC_LANG_PROGRAM (
43
- [ [ #include <dlfcn.h>] ] ,
44
- [ [ void* h = dlopen("${LIBSINGULAR_PATH}", RTLD_LAZY | RTLD_GLOBAL);
45
- if (h == 0) { return 1; } else { return dlclose(h); }] ]
46
- ) ] , [
47
- AC_MSG_RESULT ( yes )
48
- ] , [
49
- AC_MSG_RESULT ( no )
50
- sage_spkg_install_singular=yes
51
- ] , [ AC_MSG_RESULT ( yes ) ] )
52
- ] , [ AC_MSG_RESULT ( yes ) ] )
53
-
54
- AC_LANG_POP ( )
55
- LIBS="${ORIG_LIBS}"
56
- ]
57
- ) ] , [
12
+ ] , [
58
13
AC_MSG_RESULT ( no )
59
14
sage_spkg_install_singular=yes
60
15
]
@@ -64,20 +19,4 @@ SAGE_SPKG_CONFIGURE([singular], [
64
19
] )
65
20
] )
66
21
] )
67
- ] ,[ ] ,[ ] ,[
68
- dnl Post-check phase
69
- dnl We make the sage_conf substitutions here, because the "default"
70
- dnl substitution needs to be made even if we skipped the system-Singular
71
- dnl checks themselves.
72
- AS_IF ( [ test "x${sage_spkg_install_singular}" = "xyes"] , [
73
- AS_CASE ( [ $host_os] ,
74
- [ cygwin*] , [ dnl Nothing to do
75
- ] ,
76
- [ dnl Set shared library path, needed for reloading the library with RTLD_GLOBAL
77
- LIBSINGULAR_PATH="\$SAGE_LOCAL/lib/libSingular.${acl_shlibext}"
78
- ]
79
- )
80
- ] )
81
-
82
- AC_SUBST ( LIBSINGULAR_PATH , "${LIBSINGULAR_PATH}" )
83
22
] )
0 commit comments