unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Question about native compilation
@ 2021-06-09 18:01 Yasuhiro Kimura
  2021-06-09 18:17 ` Stefan Monnier
  2021-06-09 18:21 ` Eli Zaretskii
  0 siblings, 2 replies; 3+ messages in thread
From: Yasuhiro Kimura @ 2021-06-09 18:01 UTC (permalink / raw)
  To: emacs-devel

Hello,

At first, thank you for implementing native compilation. It's very
exciting.

Currently I'm trying to change some 3rd party emacs lisp programs so
they build and install .eln files if Emacs executable supports native
compilation. For example I would like to write Makefile such as
following.

----------------------------------------------------------------------
NATIVE_COMPILE!= $(execute command to check if native compilation is supported)

all:
	emacs -q -batch -f batch-byte-compile *.el
.if ${NATIVE_COMPILE} == yes
	emacs -q -batch -f batch-native-compile *.el
.endif

install:
	install -m 644 -p *.el *.elc /usr/local/share/emacs/site-lisp
.if ${NATIVE_COMPILE} == yes
	install -m 644 -p *.eln ${directory where 3rd party .eln files should be installed}
.endif
----------------------------------------------------------------------

And I have 2 qestions about it.

1. What is the recommended way to check if executable of Emacs
   supports native compilation?
2. Is there standard place where 3rd party .eln files should be
   installed? I expect such directories as
   ${prefix}/share/emacs/site-lisp or
   ${prefix}/share/emacs/$(version)/site-lisp for .el and .elc files.

Best Regards.

---
Yasuhiro Kimura



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

* Re: Question about native compilation
  2021-06-09 18:01 Question about native compilation Yasuhiro Kimura
@ 2021-06-09 18:17 ` Stefan Monnier
  2021-06-09 18:21 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2021-06-09 18:17 UTC (permalink / raw)
  To: Yasuhiro Kimura; +Cc: emacs-devel

> Currently I'm trying to change some 3rd party emacs lisp programs so
> they build and install .eln files if Emacs executable supports native
> compilation. For example I would like to write Makefile such as
> following.

I'll let someone else answer your immediate question, but I do want to
point out that generating the `.eln` files as part of installation of
the package is a bad idea: the `.eln` files are not just specific to the
package but also to the Emacs for which it was compiled, so next time
you use another version of Emacs, they'll have to be recompiled anyway.

For this reason, the way native compilation is currently arranged, it
automatically native-compiles the files on-demand, and pre-compiling
them during installation of a package is more trouble than it's
worth, IMO.


        Stefan




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

* Re: Question about native compilation
  2021-06-09 18:01 Question about native compilation Yasuhiro Kimura
  2021-06-09 18:17 ` Stefan Monnier
@ 2021-06-09 18:21 ` Eli Zaretskii
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2021-06-09 18:21 UTC (permalink / raw)
  To: Yasuhiro Kimura; +Cc: emacs-devel

> Date: Thu, 10 Jun 2021 03:01:02 +0900 (JST)
> From: Yasuhiro Kimura <yasu@utahime.org>
> 
> all:
> 	emacs -q -batch -f batch-byte-compile *.el
> .if ${NATIVE_COMPILE} == yes
> 	emacs -q -batch -f batch-native-compile *.el
> .endif

It is better to use "-f batch+native-compile", I think.

> 1. What is the recommended way to check if executable of Emacs
>    supports native compilation?

  emacs -batch --eval "(message \"%s\" system-configuration-features)" | grep NATIVE_COMP

> 2. Is there standard place where 3rd party .eln files should be
>    installed? I expect such directories as
>    ${prefix}/share/emacs/site-lisp or
>    ${prefix}/share/emacs/$(version)/site-lisp for .el and .elc files.

${prefix}/share is for architecture-independent files, so it's the
wrong place.

More importantly: why do you want to install them somewhere? why not
let Emacs compile them when they are first used and store them in
~/.emacs.d/eln-cache?  I think that's the canonical way at the moment.



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

end of thread, other threads:[~2021-06-09 18:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 18:01 Question about native compilation Yasuhiro Kimura
2021-06-09 18:17 ` Stefan Monnier
2021-06-09 18:21 ` Eli Zaretskii

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git