summaryrefslogtreecommitdiff
path: root/bdb/dist/aclocal/sosuffix.ac
blob: 1197128293b7acd6713b886a854071e71dc4306c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# $Id: sosuffix.ac,v 1.1 2002/07/08 13:15:05 dda Exp $
# Determine shared object suffixes.
#
# Our method is to use the libtool variable $library_names_spec,
# set by using AC_PROG_LIBTOOL.  This variable is a snippet of shell
# defined in terms of $versuffix, $release, $libname, $module and $jnimodule.
# We want to eval it and grab the suffix used for shared objects.
# By setting $module and $jnimodule to yes/no, we obtain the suffixes
# used to create dlloadable, or java loadable modules.
# On many (*nix) systems, these all evaluate to .so, but there
# are some notable exceptions.

# This macro is used internally to discover the suffix for the current
# settings of $module and $jnimodule.  The result is stored in $_SOSUFFIX.
AC_DEFUN(_SOSUFFIX_INTERNAL, [
	versuffix=""
	release=""
	libname=libfoo
	eval library_names=\"$library_names_spec\"
	_SOSUFFIX=`echo "$library_names" | sed -e 's/.*\.\([[a-zA-Z0-9_]]*\).*/\1/'`
	if test "$_SOSUFFIX" = '' ; then
		_SOSUFFIX=so
		if test "$enable_shared" = "yes" && test "$_SOSUFFIX_MESSAGE" = ""; then
			_SOSUFFIX_MESSAGE=yes
        		AC_MSG_WARN([libtool may not know about this architecture.])
               		AC_MSG_WARN([assuming .$_SUFFIX suffix for dynamic libraries.])
        	fi
        fi
])

# SOSUFFIX_CONFIG will set the variable SOSUFFIX to be the
# shared library extension used for general linking, not dlopen.
AC_DEFUN(SOSUFFIX_CONFIG, [
	AC_MSG_CHECKING([SOSUFFIX from libtool])
	module=no
	jnimodule=no
        _SOSUFFIX_INTERNAL
        SOSUFFIX=$_SOSUFFIX
	AC_MSG_RESULT($SOSUFFIX)
	AC_SUBST(SOSUFFIX)
])

# MODSUFFIX_CONFIG will set the variable MODSUFFIX to be the
# shared library extension used for dlopen'ed modules.
# To discover this, we set $module, simulating libtool's -module option.
AC_DEFUN(MODSUFFIX_CONFIG, [
	AC_MSG_CHECKING([MODSUFFIX from libtool])
	module=yes
	jnimodule=no
        _SOSUFFIX_INTERNAL
        MODSUFFIX=$_SOSUFFIX
	AC_MSG_RESULT($MODSUFFIX)
	AC_SUBST(MODSUFFIX)
])

# JMODSUFFIX_CONFIG will set the variable JMODSUFFIX to be the
# shared library extension used JNI modules opened by Java.
# To discover this, we set $jnimodule, simulating libtool's -jnimodule option.
# -jnimodule is currently a Sleepycat local extension to libtool.
AC_DEFUN(JMODSUFFIX_CONFIG, [
	AC_MSG_CHECKING([JMODSUFFIX from libtool])
	module=yes
	jnimodule=yes
        _SOSUFFIX_INTERNAL
        JMODSUFFIX=$_SOSUFFIX
	AC_MSG_RESULT($JMODSUFFIX)
	AC_SUBST(JMODSUFFIX)
])