unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: emacs-25 307e76c 4/6: Add dynamic module module support
       [not found] ` <E1Zz8M2-0005RN-CB@vcs.savannah.gnu.org>
@ 2016-02-07  9:53   ` Andreas Schwab
  2016-02-07 15:49     ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2016-02-07  9:53 UTC (permalink / raw)
  To: emacs-devel; +Cc: Aurélien Aptel

Teodor Zlatanov <tzz@lifelogs.com> writes:

> +### Dynamic modules support
> +LIBMODULES=
> +HAVE_MODULES=no
> +MODULES_OBJ=
> +MODULES_SUFFIX=
> +if test "${with_modules}" != "no"; then
> +  if test "$opsys" = "gnu-linux"; then
> +    LIBMODULES="-ldl"
> +    MODULES_SUFFIX=".so"
> +    HAVE_MODULES=yes
> +  elif test "$opsys" = "cygwin"; then
> +    # XXX: not tested
> +    LIBMODULES="-lcygwin"
> +    MODULES_SUFFIX=".dll"
> +    HAVE_MODULES=yes
> +  elif test "$opsys" = "darwin"; then
> +    MODULES_SUFFIX=".so"
> +    HAVE_MODULES=yes
> +  elif test "$opsys" = "mingw32"; then
> +    MODULES_SUFFIX=".dll"
> +    HAVE_MODULES=yes
> +  else
> +    # BSD system have dlopen in the libc
> +    AC_CHECK_FUNC(dlopen, [MODULES_SUFFIX=".so"]
> +                          [HAVE_MODULES=yes], [])
> +  fi
> +
> +  if test "${HAVE_MODULES}" = no; then
> +    AC_MSG_ERROR([Dynamic modules are not supported on your system])
> +  fi
> +fi
> +
> +if test "${HAVE_MODULES}" = yes; then
> +   MODULES_OBJ="dynlib.o module.o"
> +   AC_DEFINE(HAVE_MODULES, 1, [Define to 1 if dynamic modules are enabled])
> +   AC_DEFINE_UNQUOTED(MODULES_SUFFIX, "$MODULES_SUFFIX", [System extension for dynamic libraries])
> +fi
> +AC_SUBST(MODULES_OBJ)
> +AC_SUBST(LIBMODULES)
> +AX_GCC_VAR_ATTRIBUTE(cleanup)
> +AC_CHECK_FUNCS(dladdr)

dladdr requires -ldl, but this check doesn't use LIBMODULES, which means
dladdr is never found here.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: emacs-25 307e76c 4/6: Add dynamic module module support
  2016-02-07  9:53   ` emacs-25 307e76c 4/6: Add dynamic module module support Andreas Schwab
@ 2016-02-07 15:49     ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2016-02-07 15:49 UTC (permalink / raw)
  To: Andreas Schwab, emacs-devel; +Cc: Aurélien Aptel

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

Andreas Schwab wrote:
> dladdr requires -ldl, but this check doesn't use LIBMODULES, which means
> dladdr is never found here.

Thanks for catching that. Fixed with the attached.

[-- Attachment #2: 0001-Fix-test-for-dladdr.patch --]
[-- Type: text/x-diff, Size: 986 bytes --]

From 6ca920f6718135a321ccc86dcbe3cf37efd7eb4e Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 7 Feb 2016 07:46:59 -0800
Subject: [PATCH] Fix test for dladdr

Problem reported by Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00327.html
* configure.ac (dladdr): Link with LIBMODULES when checking for
this function.
---
 configure.ac | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 57bde94..1ff9c49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3360,7 +3360,7 @@ if test "${with_modules}" != "no"; then
   else
     SAVE_LIBS=$LIBS
     LIBS="$LIBS $LIBMODULES"
-    AC_CHECK_FUNCS([dlfunc])
+    AC_CHECK_FUNCS([dladdr dlfunc])
     LIBS=$SAVE_LIBS
   fi
 fi
@@ -3373,7 +3373,6 @@ if test "${HAVE_MODULES}" = yes; then
 fi
 AC_SUBST(MODULES_OBJ)
 AC_SUBST(LIBMODULES)
-AC_CHECK_FUNCS(dladdr)
 
 ### Use -lpng if available, unless '--with-png=no'.
 HAVE_PNG=no
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-07 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20151118192512.20738.15828@vcs.savannah.gnu.org>
     [not found] ` <E1Zz8M2-0005RN-CB@vcs.savannah.gnu.org>
2016-02-07  9:53   ` emacs-25 307e76c 4/6: Add dynamic module module support Andreas Schwab
2016-02-07 15:49     ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).