emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter integration in python.el


From: Matthias Meulien
Subject: Re: Tree-sitter integration in python.el
Date: Tue, 04 Oct 2022 13:21:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

> (...)  Would you please share the changes you made, FTR?  Then others
> who face the same problem could easily find the solution.  TIA.

Sure, but let me make clear that it's an unclean hack and using
https://github.com/casouri/tree-sitter-module may prove to be more
robust.

diff --unified tree-sitter-ruby/Makefile tree-sitter-python/Makefile
--- tree-sitter-ruby/Makefile   2022-10-03 23:01:34.963750322 +0200
+++ tree-sitter-python/Makefile 2022-10-04 13:06:46.014817832 +0200
@@ -31,7 +31,7 @@
 ifeq (, $(CPPSRC))
        ADDITIONALLIBS := 
 else
-       ADDITIONALLIBS := -lc++
+       ADDITIONALLIBS :=
 endif
 
 # collect sources
@@ -71,14 +71,14 @@
 ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
        PCLIBDIR := $(PREFIX)/libdata/pkgconfig
 endif
-                               
-all: libtree-sitter-$(PARSER_NAME).a libtree-sitter-$(PARSER_NAME).$(SOEXTVER) 
bindings/c/$(PARSER_NAME).h bindings/c/tree-sitter-$(PARSER_NAME).pc
+
+all: libtree-sitter-$(PARSER_NAME).a libtree-sitter-$(PARSER_NAME).$(SOEXTVER)
 
 libtree-sitter-$(PARSER_NAME).a: $(OBJ)
        $(AR) rcs $@ $^
 
 libtree-sitter-$(PARSER_NAME).$(SOEXTVER): $(OBJ)
-       $(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@
+       g++ $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@
        ln -sf $@ libtree-sitter-$(PARSER_NAME).$(SOEXT)
        ln -sf $@ libtree-sitter-$(PARSER_NAME).$(SOEXTVER_MAJOR)
 
@@ -102,10 +102,6 @@
        install -m755 libtree-sitter-$(PARSER_NAME).$(SOEXTVER) 
'$(DESTDIR)$(LIBDIR)'/libtree-sitter-$(PARSER_NAME).$(SOEXTVER)
        ln -sf libtree-sitter-$(PARSER_NAME).$(SOEXTVER) 
'$(DESTDIR)$(LIBDIR)'/libtree-sitter-$(PARSER_NAME).$(SOEXTVER_MAJOR)
        ln -sf libtree-sitter-$(PARSER_NAME).$(SOEXTVER) 
'$(DESTDIR)$(LIBDIR)'/libtree-sitter-$(PARSER_NAME).$(SOEXT)
-       install -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter
-       install -m644 bindings/c/$(PARSER_NAME).h 
'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/
-       install -d '$(DESTDIR)$(PCLIBDIR)'
-       install -m644 bindings/c/tree-sitter-$(PARSER_NAME).pc 
'$(DESTDIR)$(PCLIBDIR)'/
 
 clean:
        rm -f $(OBJ) libtree-sitter-$(PARSER_NAME).a 
libtree-sitter-$(PARSER_NAME).$(SOEXT) 
libtree-sitter-$(PARSER_NAME).$(SOEXTVER_MAJOR) 
libtree-sitter-$(PARSER_NAME).$(SOEXTVER)
-- 
Matthias



reply via email to

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