Commit 022ba02a authored by David Byers's avatar David Byers
Browse files

Use autoconf to create Makefile in distribution

parent 881d74e3
2000-09-02 David Byers <>
* Makefile (release-files): Build zip file too.
* command.el (lyskom-command-match-string-regexp): New function.
(lyskom-completing-strip-command): New function.
(lyskom-complete-command): Record exact matches when iterating
......@@ -47,6 +47,8 @@ FTPDIR=/home/davby/www-pub
#FTPDIR = /usr/ftp/pub/lyskom/elisp-client
LISPDIR = /usr/gnu/share/emacs/site-lisp
LANGUAGES = swedish english
SHELL = /bin/sh
RM = /bin/rm -f
......@@ -107,11 +109,13 @@ HEADER = header.el \
MISC = envcheck.el \
lpath.el \
DISTFILES = Makefile \
DISTSRC = $(DISTFILES:%=distribution-%)
HEADER-ELC = $(HEADER:%.el=%.elc)
......@@ -167,7 +171,7 @@ install: $(TARGET) $(TARGET-EL)
release: release-files release-cleanup release-move
release-files: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC) $(TARGET-EL)
release-files: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC)
mkdir lyskom-$(CLIENTVERSION)
for i in $(DISTFILES) ; do \
......@@ -177,17 +181,25 @@ release-files: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC) $(TARGET-EL)
for i in $(DOCFILES) ; do \
cp ../doc/$$i lyskom-$(CLIENTVERSION)/$$i ; \
(cd lyskom-$(CLIENTVERSION); make lyskom-$(CLIENTVERSION).el)
( cd lyskom-$(CLIENTVERSION); \
autoconf ; \
./configure --prefix=$(DEFAULTPREFIX) --with-lispdir=$(DEFAULTLISPDIR) ; \
make lyskom-$(CLIENTVERSION).el )
chmod -R u+rw,g+r,o+r lyskom-$(CLIENTVERSION)
tar cvf lyskom-$(CLIENTVERSION).tar lyskom-$(CLIENTVERSION)
gzip -9 lyskom-$(CLIENTVERSION).tar
zip -R9y lyskom-$(CLIENTVERSION).zip 'lyskom-$(CLIENTVERSION)/*'
$(RM) -rf lyskom-$(CLIENTVERSION) lyskom-elisp-client-$(DEBIANCLIENTVERSION)
$(RM) -rf lyskom-$(CLIENTVERSION) \
lyskom-$(CLIENTVERSION).tar.gz \
lyskom-$(CLIENTVERSION).zip \
release-move: release-files
if [ -d $(FTPDIR) ]; then \
mv lyskom-$(CLIENTVERSION).tar.gz $(FTPDIR) ; \
mv lyskom-$(CLIENTVERSION).zip $(FTPDIR) ; \
mv $(TARGET-EL) $(FTPDIR)/lyskom-$(CLIENTVERSION).el ; \
else \
echo "Flyttade inte release-filerna till $(FTPDIR)." ; \
......@@ -216,9 +228,7 @@ clean:
$(RM) -rf lyskom-$(CLIENTVERSION) \
lyskom-$(CLIENTVERSION).tar \
lyskom-$(CLIENTVERSION).tar.gz \
lyskom-$(CLIENTVERSION).zip \
$(RM) *~ *.elc $(GENERIC-CLEAN)
$(RM) -r build-stamp lyskom-elisp-client*
distclean: clean
(defun extract-configuration-option (option)
(if (string-match (concat "\\([\"']\\)?"
(regexp-quote option) "\\(=\\|\\s-+\\)")
(let ((start (match-end 0))
(dquot nil)
(squot nil)
(i nil)
(start (match-end 0))
(end nil)
(result nil))
(setq i start)
(if (match-beginning 1)
(if (eq (elt system-configuration-options (match-beginning 1)) ?')
(setq squot t)
(setq dquot t)))
(while (and (not end) (< i (length system-configuration-options)))
(let ((c (elt system-configuration-options i)))
(cond ((and (eq c ?') (not dquot)) (setq squot (not squot)))
((and (eq c ?\") (not squot)) (setq dquot (not dquot)))
((eq c ?\\) (setq start (1+ start)))
((and (or (eq c ?\ ) (eq c ?\t) (eq c ?\r) (eq c ?\n))
(not squot)
(not dquot))
(setq end i))
(t (setq result (cons c result)))))
(setq i (1+ i)))
(concat (nreverse result)))))
(defun extract-site-lisp-dir ()
(let ((path load-path)
(result nil))
(while path
(if (string-match "/site-lisp" (car path))
(progn (setq result (car path))
(setq path nil))
(setq path (cdr path))))
(defun extract-autoconf-data ()
(let ((prefix (extract-configuration-option "--prefix"))
(datadir (extract-configuration-option "--datadir"))
(infodir (extract-configuration-option "--infodir"))
(lispdir (extract-site-lisp-dir))
(version (format "%S.%S" emacs-major-version emacs-minor-version)))
(and prefix (message "xprefix=%s" prefix))
(and datadir (message "xdatadir=%s" datadir))
(and infodir (message "xinfodir=%s" infodir))
(and lispdir (message "xlispdir=%s" lispdir))
(and version (message "xversion=%s" version))))
......@@ -8,7 +8,7 @@
# Gnu Emacs 19.34 or later, or XEmacs 19.15 or 20.2 or later.
# ======================================================================
# ======================================================================
......@@ -17,8 +17,9 @@ EMACS=emacs
# INFODIR is where documentation goes (if there is any)
# ======================================================================
# ======================================================================
......@@ -32,7 +33,7 @@ INFODIR=/usr/local/info
# The first language in the list will be the default language.
# ======================================================================
LANGUAGES=swedish english
# ======================================================================
......@@ -108,6 +109,7 @@ lyskom-@@CLIENTVERSION@@.el: $(HEADER) $(SOURCES)
install: lyskom-@@CLIENTVERSION@@.elc
cp lyskom-@@CLIENTVERSION@@.el lyskom-@@CLIENTVERSION@@.elc $(LISPDIR)
ln -sf $(LISPDIR)/lyskom-@@CLIENTVERSION@@.el $(LISPDIR)/lyskom.el
ln -sf $(LISPDIR)/lyskom-@@CLIENTVERSION@@.elc $(LISPDIR)/lyskom.elc
The LysKOM Emacs Lisp Client
The LysKOM Emacs Lisp Client
Release notes for version @@CLIENTVERSION@@
LysKOM is a project in progress at the Lysator Academic Computing
Society at Linköping University in Sweden. For information abuot
Society at Linköping University in Sweden. For information about
Lysator, see <URL:>. For more information
on LysKOM, see <URL:>.
......@@ -77,7 +79,7 @@
Make sure you do not have a file called macedit.el early in your
load path. This file redefines a function that the client relies
heavly on. The redefinition is buggy. You can recognize this
heavily on. The redefinition is buggy. You can recognize this
problem if your Emacs says something like this: "Key sequence <
m o u s e - 2 > uses invalid prefix characters" when you load or
compile the elisp client.
......@@ -143,24 +145,39 @@
1. Edit the Makefile in the distribution to reflect your
environment. You can change the following variables:
environment. There are instructions in the Makefile.
EMACS should be set to the command used to start Emacs.
Usually this will be either `emacs' or `xemacs'.
Optionally, use the configure script. It attempts to find
suitable defaults for the settings in the Makefile. Simply run
./configure in the directory containing the client sources.
LISPDIR is the directory in which the compiled and
uncompiled client will go. This will normally be set to your
site-lisp directory.
You may customize the output of the configure script with the
following command-line arguments:
INFODIR is where the info files will go, once we've written
them. You should set this variable on the off chance that we
distributed some documentation with the code.
--with-emacs=EMACS Specify the name of the Emacs you want to
use (usually `emacs' or `xemacs'). The
script will attempt to locate an emacs
LANGUAGES is a list of languages to compile in. As of version
0.46 there are only two translations of LysKOM. The Makefile
states which values are legal. Just list all the languages
you want, separated by whitespace. The first language you
specify will be the default language.
--with-lispdir=DIR Specify where to install the client. You
will have to specify this if the script
fails to locate a suitable directory
Enable a language. Currently swedish and
english are available. If you do not
explicitly enable any language, all will
be enabled.
Set the default language to LANG (swedish
or english). If you do not specify a
default language the script will choose
one for you.
The configure script is an experiment. It might work and it
might not. If it doesn't, edit the Makefile by hand instead.
2. Run `make envcheck' to make sure your Emacs environment is set
up correctly. The environment check does not read your .emacs,
......@@ -172,7 +189,8 @@
path for compiling (this should only happen if the custom
package is not on your default load path).
4. If you changed the list of languages, run `make clean'.
4. If you changed the list of languages or ran the configure
script, run `make clean'.
5. Run `make'. If your environment is set up correctly, LysKOM
should be compiled. When compilation is finished, type `make
......@@ -240,7 +258,7 @@
5. Known issues
Issue: I see \201 before swedish characters in the string showing
Issue: I see \201 before Swedish characters in the string showing
what some other user is doing (e.g. L\201äser).
Reason: The user is probably using an old version of the client in
......@@ -263,19 +281,19 @@
file (e.g. lyskom.elc or lyskom-@@CLIENTVERSION@@.elc).
Issue: Columns containing swedish characters or characters in
Issue: Columns containing Swedish characters or characters in
numeric representation are not aligned correctly.
Reason: This happens in certain versions of Emacs when running
without multibyte character support and is due to bugs in
without multi-byte character support and is due to bugs in
Emacs. The only workaround is to either upgrade Emacs or
enable multibyte character support.
enable multi-byte character support.
Issue: Swedish characters show up as blanks, question marks or
Reason: If swedish characters show up as blanks your font probably
Reason: If Swedish characters show up as blanks your font probably
does not support them. If they show up as question marks or
numbers your language environment does not support them.
[ --with-emacs=EMACS specify which emacs to use (EMACS=emacs)],
[ emacs="${withval}"],
[ AC_CHECK_PROGS(emacs, [emacs xemacs]) ]
[ --with-lispdir=DIR specify directory to install Lisp code in],
[ lispdir="${withval}" ],
[ lispdir="" ])
[ --enable-language=LANG include support for language LANG ],
[ case "${enableval}" in
sv|swedish) val="swedish" ;;
en|english) val="english" ;;
no) AC_MSG_ERROR([You cannot disable a language]) ;;
*) AC_MSG_ERROR([Argument \`--enable-language=$enableval' is invalid.
The language must be one of swedish or english.]) ;;
languages="${languages} ${val}"
[ languages="swedish english" ]
[ --with-default-language=LANG set default language to LANG (default swedish)],
[ case "${withval}" in
sv|swedish) val="swedish" ;;
en|english) val="english" ;;
*) AC_MSG_ERROR([Argument \`--with-default-language=$withval' is invalid.
The default language must be one of \`swedish' or \`english'.]);
languages="`echo ${languages} | sed -e \"s/ *${val} *//g\"`"
languages="${val} ${languages}"
if test -z "${lispdir}"
eval `${emacs} -batch -l ./autoconf.el -f extract-autoconf-data 2>&1`
if test -z "${xlispdir}"
AC_MSG_ERROR([No Lisp directory was found or specified with --with-lispdir.])
echo "LysKOM elisp-client configuration"
echo " Path prefix: $prefix"
echo " Emacs: $emacs"
echo " Installation directory: $lispdir"
echo " Documentation directory: $infodir"
echo " Languages (default first): $languages"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment