aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/emacs-module.c7
-rw-r--r--src/emacs-module.h.in2
-rw-r--r--test/Makefile.in3
-rw-r--r--test/data/emacs-module/mod-test.c9
4 files changed, 15 insertions, 6 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index b6a12386267..0b7b3d6ffbe 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -70,6 +70,11 @@ To add a new module function, proceed as follows:
70 70
71#include <config.h> 71#include <config.h>
72 72
73#ifndef HAVE_GMP
74#include "mini-gmp.h"
75#define EMACS_MODULE_HAVE_MPZ_T
76#endif
77
73#define EMACS_MODULE_GMP 78#define EMACS_MODULE_GMP
74#include "emacs-module.h" 79#include "emacs-module.h"
75 80
@@ -80,8 +85,6 @@ To add a new module function, proceed as follows:
80#include <stdlib.h> 85#include <stdlib.h>
81#include <time.h> 86#include <time.h>
82 87
83#include <gmp.h>
84
85#include "lisp.h" 88#include "lisp.h"
86#include "bignum.h" 89#include "bignum.h"
87#include "dynlib.h" 90#include "dynlib.h"
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in
index e61aadfc3ac..fbc62a61ef4 100644
--- a/src/emacs-module.h.in
+++ b/src/emacs-module.h.in
@@ -28,7 +28,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
28#include <stdbool.h> 28#include <stdbool.h>
29#endif 29#endif
30 30
31#ifdef EMACS_MODULE_GMP 31#if defined EMACS_MODULE_GMP && !defined EMACS_MODULE_HAVE_MPZ_T
32#include <gmp.h> 32#include <gmp.h>
33#endif 33#endif
34 34
diff --git a/test/Makefile.in b/test/Makefile.in
index 2282ccd951c..ec20a427ba5 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -257,6 +257,7 @@ endif
257HYBRID_MALLOC = @HYBRID_MALLOC@ 257HYBRID_MALLOC = @HYBRID_MALLOC@
258LIBEGNU_ARCHIVE = ../lib/lib$(if $(HYBRID_MALLOC),e)gnu.a 258LIBEGNU_ARCHIVE = ../lib/lib$(if $(HYBRID_MALLOC),e)gnu.a
259GMP_LIB = @GMP_LIB@ 259GMP_LIB = @GMP_LIB@
260GMP_OBJ = $(if @GMP_OBJ@, ../src/@GMP_OBJ@)
260 261
261# Note: emacs-module.h is generated from emacs-module.h.in, hence we 262# Note: emacs-module.h is generated from emacs-module.h.in, hence we
262# look in ../src, not $(srcdir)/../src. 263# look in ../src, not $(srcdir)/../src.
@@ -269,7 +270,7 @@ src/emacs-module-tests.log: $(test_module)
269$(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h $(LIBEGNU_ARCHIVE) 270$(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h $(LIBEGNU_ARCHIVE)
270 $(AM_V_at)${MKDIR_P} $(dir $@) 271 $(AM_V_at)${MKDIR_P} $(dir $@)
271 $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ 272 $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
272 -o $@ $< $(LIBEGNU_ARCHIVE) $(GMP_LIB) 273 -o $@ $< $(LIBEGNU_ARCHIVE) $(GMP_LIB) $(GMP_OBJ)
273endif 274endif
274 275
275## Check that there is no 'automated' subdirectory, which would 276## Check that there is no 'automated' subdirectory, which would
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c
index 8ac08f71534..b7007bd80ff 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/data/emacs-module/mod-test.c
@@ -27,11 +27,16 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
27#include <string.h> 27#include <string.h>
28#include <time.h> 28#include <time.h>
29 29
30#ifdef HAVE_GMP
31#include <gmp.h>
32#else
33#include "mini-gmp.h"
34#define EMACS_MODULE_HAVE_MPZ_T
35#endif
36
30#define EMACS_MODULE_GMP 37#define EMACS_MODULE_GMP
31#include <emacs-module.h> 38#include <emacs-module.h>
32 39
33#include <gmp.h>
34
35#include "timespec.h" 40#include "timespec.h"
36 41
37int plugin_is_GPL_compatible; 42int plugin_is_GPL_compatible;