emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 4e4d8508cd 039/166: ENHANCED: Allow using swipl


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 4e4d8508cd 039/166: ENHANCED: Allow using swipl compiled with GMP
Date: Fri, 30 Sep 2022 04:59:24 -0400 (EDT)

branch: elpa/sweeprolog
commit 4e4d8508cde67470ed8cc165499fd8302b70d737
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ENHANCED: Allow using swipl compiled with GMP
---
 .build.yml | 14 +++++++++++---
 Makefile   | 22 ++--------------------
 sweep.c    |  1 +
 sweep.el   |  4 ++--
 4 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/.build.yml b/.build.yml
index bd049c2838..2f12efe469 100644
--- a/.build.yml
+++ b/.build.yml
@@ -33,11 +33,19 @@ secrets:
 sources:
   - git@git.sr.ht:~eshel/sweep
 tasks:
-  - build: |
-      cd sweep
+  - getswipl: |
+      git clone --recursive https://github.com/SWI-Prolog/swipl-devel.git
+      cd swipl-devel
+      mkdir build
+      cd build
       export LANG="en_US.UTF-8"
       sudo localectl set-locale LANG=en_US.UTF-8
       localectl set-locale LANG=en_US.UTF-8
+      cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DSWIPL_INSTALL_IN_LIB=ON 
-DSWIPL_PACKAGES_ODBC=OFF -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF 
-DINSTALL_DOCUMENTATION=OFF -G Ninja ..
+      ninja
+      ninja install
+  - build: |
+      cd sweep
       make
       make sweep.info
-      LD_PRELOAD=lib/libswipl.so make check
+      make check
diff --git a/Makefile b/Makefile
index f5758a24be..687b1f51ca 100644
--- a/Makefile
+++ b/Makefile
@@ -15,45 +15,27 @@ OBJECT   = $(BASENAME).o
 SOURCE   = $(BASENAME).c
 
 LDFLAGS += -shared
-LDFLAGS += -Llib
 LDFLAGS += -lswipl
 
 CFLAGS  += -fPIC
 CFLAGS  += -Wall
 CFLAGS  += -Wextra
 CFLAGS  += -O2
-CFLAGS  += -Ilib/swipl/include
-
-CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=$(CURRENT_DIR)
-CMAKE_OPTIONS += -DUSE_GMP=OFF
-CMAKE_OPTIONS += -DSWIPL_PACKAGES_ODBC=OFF
-CMAKE_OPTIONS += -DSWIPL_PACKAGES_JAVA=OFF
-CMAKE_OPTIONS += -DSWIPL_PACKAGES_X=OFF
-CMAKE_OPTIONS += -DSWIPL_INSTALL_IN_LIB=ON
+CFLAGS  += -I/usr/local/lib/swipl/include
 
 .PHONY: clean all swipl check
 
 all: $(TARGET)
 
-$(OBJECT): $(SOURCE) lib/libswipl.$(SOEXT)
+$(OBJECT): $(SOURCE)
        $(CC) $(CFLAGS) -o $@ -c $(SOURCE)
 
 $(TARGET): $(OBJECT)
        $(CC) -o $@ $(OBJECT) $(LDFLAGS)
 
 clean:
-       rm -rf bin lib share swipl/build
        rm -f $(TARGET) $(OBJECT) $(BASENAME).info
 
-lib/libswipl.$(SOEXT):
-       cd swipl; \
-       rm -rf build; \
-       mkdir build; \
-       cd build; \
-       cmake $(CMAKE_OPTIONS) -G Ninja ..; \
-       ninja; \
-       ninja install
-
 $(BASENAME).info:: README.org
        emacs -Q --batch --eval '(require (quote ox-texinfo))' --eval 
"(with-current-buffer (find-file \"README.org\") (org-export-to-file (quote 
texinfo) \"$@\" nil nil nil nil nil (quote org-texinfo-compile)))"
 
diff --git a/sweep.c b/sweep.c
index 188ada6f55..12a559f525 100644
--- a/sweep.c
+++ b/sweep.c
@@ -426,6 +426,7 @@ sweep_initialize(emacs_env *env, ptrdiff_t nargs, 
emacs_value *args, void *data)
       return NULL;
     }
   }
+  PL_action(PL_GMP_SET_ALLOC_FUNCTIONS, FALSE);
   r = PL_initialise(nargs, argv);
   for (i = 0; i < nargs; i++) {
     free(argv[i]);
diff --git a/sweep.el b/sweep.el
index 10e0059073..b43784e287 100644
--- a/sweep.el
+++ b/sweep.el
@@ -116,8 +116,8 @@
                                     sweep-prolog-server-port))
   (apply #'sweep-initialize
          (cons (expand-file-name "bin/swipl" (file-name-directory
-                                              load-file-name))
-               (cons "-q" sweep-init-args)))
+                                              (buffer-file-name)))
+               (cons "-q" (cons "--no-signals" sweep-init-args))))
   (sweep-start-prolog-server))
 
 (defun sweep-predicates-collection ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]