Commit 630c9452 authored by joddie's avatar joddie

Clean up build process to be closer to gnuplot source tree.

The Gnuplot CVS repository recently removed the various info-look
files from the lisp/ subdirectory, which seems pretty safe -- they
haven't been needed by any new version of Emacs in ten years or so.
They also got rid of the separate lisp/configure, so that the (old)
gnuplot-mode in that repository now uses the same
autoconf/automake/configure process as the main Gnuplot tree.

This seemed like a good opportunity to clean up the github
gnuplot-mode tree, since it would be nice to eventually merge a stable
version back into Gnuplot's repository.  Automake knows how to compile
and install Emacs Lisp, so we can replace Makefile.in with a
short Makefile.am and configure.ac.  It also seems logical to remove
all the generated files (mkinstalldirs, etc.) from the git repository,
since the autotools will install them automatically.  Building from
the git checkout now looks like:

    autoreconf
    automake --add-missing
    ./configure
    make install

"Configure" knows about the environment variable EMACS and the
--with-lispdir switch too.

Makefile.dst is still there and mostly unchanged, for people who lack
autotools. But they should probably install from a release tarball
anyway, which will include the generated "configure" and "Makefile.in"
files.  Automake makes it easy to produce these via "make dist".

Yes, it is a little silly to do the whole Automake dance just for
three Emacs Lisp files, but we might as well be consistent.
parent 7046fe1c
......@@ -12,3 +12,17 @@
/config.cache
/config.status
/info-look.el
/autom4te.cache/*
/elc-stamp
/elisp-comp
/missing
/aclocal.m4
/configure.scan
/gpelcard.ps
/install-sh
/Makefile.in
/configure
elisp-comp
install-sh
missing
gnuplot-mode-*.tar.gz
To install gnuplot-mode:
1. At the command line:
> configure
1. If you got gnuplot-mode from a release tarball, do the following
at the command line:
> ./configure
> make
If you use XEmacs, do "make EMACS=xemacs" (or change the EMACS
variable to "xemacs" in the Makefile, the run "make").
If you're working from a git checkout of the gnuplot-mode
repository, you will first need to do
> autoreconf
> automake --add-missing
before the "configure; make" step above.
If you use XEmacs, add "EMACS=xemacs" to the "./configure" command.
If you use Emacs.app on Mac OS X, add
"EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs".
You can also use the "--with-lispdir" option to select where you
want to install the Elisp files.
If "configure" doesn't work for you, the file "Makefile.dst" can be
used. In that case do, "make -f Makefile.dst".
2. Move the .elc files to a place where emacs can find them, for
example /usr/share/emacs/site-lisp or your personal emacs
directory.
2. Either run "make install", or move the .el and .elc files to a
place where emacs can find them, for example
/usr/share/emacs/site-lisp or your personal emacs directory.
3. Insert the contents of the `dotemacs' file into your .emacs file
or system start-up file to enable gnuplot mode.
......@@ -28,18 +40,12 @@ To install gnuplot-mode:
(add-to-list 'Info-default-directory-list "/path/to/file")
The "configure; make" sequence may not work on all systems,
particularly Win32 systems. The long-winded way of making the .elc
gpelcard.ps files is to edit each of the .el files with emacs and do
`M-x byte-compile-file'. Then "latex gpelcard.tex" and
"dvips gpelcard.dvi".
You will need to follow the instructions contained in the file
Win9x/INSTALL.Win9x to get gnuplot working with Emacs on a Windows 95
or 98 machine.
Problems? Contact gnuplot-mode's author Bruce Ravel
<ravel@phys.washington.edu>
<bruceravel1@gmail.com> or submit an issue on github:
http://github.com/bruceravel/gnuplot-mode
## Process this file with automake to produce Makefile.in -*-Makefile-*-
AUTOMAKE_OPTIONS = foreign
dist_lisp_LISP = gnuplot.el gnuplot-gui.el gnuplot-context.el
EXTRA_DIST = dotemacs gpelcard.dvi gpelcard.pdf gpelcard.ps gpelcard.tex
CLEANFILES = gpelcard.pdf gpelcard.ps gpelcard.dvi gpelcard.log gpelcard.aux
DISTCLEANFILES =
.dvi.ps:
@if [ "$(DVIPS)" != no ] ; then \
$(DVIPS) -o $@ $< ; \
else \
echo "dvips not found: cannot make $@" ; \
fi
.tex.dvi:
@if [ "$(LATEX)" != no ] ; then \
$(LATEX) $< ; \
else \
echo "latex not found: cannot make $@" ; \
fi
.tex.pdf:
@if [ "$(PDFLATEX)" != no ] ; then \
$(PDFLATEX) $< ; \
else \
echo "pdflatex not found: cannot make $@" ; \
fi
pdf: gpelcard.pdf
ps: gpelcard.ps
SUFFIXES = .el .elc .pdf .ps .tex
......@@ -9,7 +9,7 @@ BYTE = $(EMACS) -batch -q -no-site-file -l dot.el -f batch-byte-compile
.PHONY: all default clean
default:
$(MAKE) info-look.elc gnuplot.elc gnuplot-gui.elc gnuplot-context.elc
$(MAKE) gnuplot.elc gnuplot-gui.elc gnuplot-context.elc
gnuplot.elc: gnuplot.el
$(BYTE) gnuplot.el
......@@ -20,45 +20,6 @@ gnuplot-gui.elc: gnuplot-gui.el
gnuplot-context.elc: gnuplot-context.el
$(BYTE) gnuplot-context.el
## There are many possibilities for info-look:
##
## EMACS version use
## -----------------------------------------
## Emacs or XEmacs 19 info-look.20.2.el
## Emacs 20.2 or less info-look.20.2.el
## Emacs 20.3 nothing
## XEmacs 20+ info-look.20.3.el
##
## want to use my modified version even if 20.2 is installed because a
## bug is fixed
##
## the first 6 lines attempt to ascertain the version number of
## $(EMACS), then multiply by 100 to convert it to an integer for the
## sake of the integer comparisons in the following lines. Is this a
## hassle, or what?!
##
MESSAGE = compiling info-look for $(EMACS) $$vnum
info-look.elc: info-look.20.2.el info-look.20.3.el
@if [ $(EMACS) = "emacs" ]; \
then vnum=`emacs --version | grep 'Emacs [12]' | awk '{print $$3}'`; \
else vnum=`xemacs --version | grep 'Emacs [12]' | awk '{print $$2}'`; \
fi; \
vn=`echo "$$vnum" | awk 'BEGIN{FS="."}{print $$1 "." $$2}'`; \
version=`echo "$$vn" | awk '{print 100*$$1}'`; \
if [ $(EMACS) = "emacs" -a $$version -ge 2030 ]; \
then echo "no need to compile info-look for $(EMACS) $$vnum"; \
else echo "$(MESSAGE)"; \
fi; \
if [ $(EMACS) = "emacs" -a $$version -lt 2030 ]; \
then cp -v info-look.20.2.el info-look.el; \
elif [ $(EMACS) = "xemacs" -a $$version -ge 2000 ]; \
then cp -v info-look.20.3.el info-look.el; \
elif [ $(EMACS) = "xemacs" -a $$version -lt 2000 ]; \
then cp -v info-look.20.2.el info-look.el; \
fi ;\
if [ ! \( $(EMACS) = "emacs" -a $$version -ge 2030 \) ]; \
then $(BYTE) info-look.el; fi;
gpelcard.ps: gpelcard.dvi
dvips -o gpelcard.ps gpelcard.dvi
......@@ -66,21 +27,7 @@ gpelcard.dvi: gpelcard.tex
latex gpelcard.tex
all:
$(MAKE) gnuplot.elc info-look.elc gnuplot-gui.elc gpelcard.ps
$(MAKE) gnuplot.elc gnuplot-gui.elc gpelcard.ps
clean:
rm -f *.elc info-look.el gpelcard.dvi gpelcard.log gpelcard.aux
##----------------------------------------------------------------------
## old stuff:
## from the `all' and `default' targets:
# gnuplot-toolbar.elc kw-compl.elc
#kw-compl.elc: kw-compl.el
# $(BYTE) kw-compl.el
## only make this for XEmacs
#gnuplot-toolbar.elc: gnuplot-toolbar.el
# if [ $(EMACS) = "xemacs" ]; then $(BYTE) gnuplot-toolbar.el; fi
rm -f *.elc gpelcard.dvi gpelcard.log gpelcard.aux
#
# Makefile.in for gnuplot-mode
#
# Based on original Makefile
# by Lars Hecking <lhecking@nmrc.ucc.ie> 1999-02-25
#
# Modified to install .el files along with .elc files
# BR May 17 2002
SHELL = /bin/sh
prefix = @prefix@
datadir = @datadir@
lispdir = @lispdir@
srcdir = @srcdir@
subdir = lisp
top_builddir = .
top_srcdir = @top_srcdir@
@SET_MAKE@
EMACS = @EMACS@
MAKEINFO = @MAKEINFO@
LATEX = latex
DVIPS = dvips
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
VPATH = @srcdir@
# Command to byte-compile
BYTEC = $(EMACS) -batch -q -no-site-file -l $(srcdir)/dot.el -f batch-byte-compile
ELCS = info-look.elc gnuplot.elc gnuplot-gui.elc gnuplot-context.elc
DIST_COMMON = ChangeLog Makefile.dst Makefile.in README aclocal.m4 configure \
configure.in
EXTRA_DIST = dot.el dotemacs gnuplot-gui.el gnuplot.el gnuplot.el.old \
gnuplot-context.el gpelcard.tex info-look.20.2.el info-look.20.3.el
DISTFILES = $(DIST_COMMON) $(EXTRA_DIST)
default: $(ELCS)
gnuplot.elc: gnuplot.el
test "$(srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot.el .
$(BYTEC) gnuplot.el
gnuplot-gui.elc: gnuplot.elc gnuplot-gui.el
test "$(srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot-gui.el .
$(BYTEC) gnuplot-gui.el
gnuplot-context.elc: gnuplot.elc gnuplot-context.el
test "$(srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot-context.el .
$(BYTEC) gnuplot-context.el
## There are many possibilities for info-look:
##
## EMACS version use
## -----------------------------------------
## Emacs or XEmacs 19 info-look.20.2.el
## Emacs 20.2 or less info-look.20.2.el
## Emacs 20.3 nothing
## XEmacs 20+ info-look.20.3.el
##
## want to use my modified version even if 20.2 is installed because a
## bug is fixed
##
## the first 6 lines attempt to ascertain the version number of
## $(EMACS), then multiply by 100 to convert it to an integer for the
## sake of the integer comparisons in the following lines. Is this a
## hassle, or what?!
##
MESSAGE = compiling info-look for $(EMACS) $$vnum
info-look.elc: info-look.20.2.el info-look.20.3.el
@if [ $(EMACS) = "emacs" ]; \
then vnum=`emacs --version | grep 'Emacs [12]' | awk '{print $$3}'`; \
else vnum=`xemacs --version | grep 'Emacs [12]' | awk '{print $$2}'`; \
fi; \
vn=`echo "$$vnum" | awk 'BEGIN{FS="."}{print $$1 "." $$2}'`; \
version=`echo "$$vn" | awk '{print 100*$$1}'`; \
if [ $(EMACS) = "emacs" -a $$version -ge 2030 ]; \
then echo "no need to compile info-look for $(EMACS) $$vnum"; \
else echo "$(MESSAGE)"; \
fi; \
if [ $(EMACS) = "emacs" -a $$version -lt 2030 ]; \
then echo Using info-look.20.2.el; \
cp $(srcdir)/info-look.20.2.el info-look.el; \
elif [ $(EMACS) = "xemacs" -a $$version -ge 2000 ]; \
then echo Using info-look.20.3.el; \
cp $(srcdir)/info-look.20.3.el info-look.el; \
elif [ $(EMACS) = "xemacs" -a $$version -lt 2000 ]; \
then echo Using info-look.20.2.el; \
cp $(srcdir)/info-look.20.2.el info-look.el; \
fi ;\
if [ ! \( $(EMACS) = "emacs" -a $$version -ge 2030 \) ]; \
then $(BYTEC) info-look.el; fi;
ps: gpelcard.ps
gpelcard.ps: gpelcard.dvi
$(DVIPS) -o gpelcard.ps gpelcard.dvi
gpelcard.dvi: gpelcard.tex
$(LATEX) $(srcdir)/gpelcard.tex
all: gnuplot.elc info-look.elc gnuplot-gui.elc
install:
mkinstalldirs $(lispdir)
@for p in *.el *.elc; do \
echo " $(INSTALL_DATA) $$p $(lispdir)/$$p"; \
$(INSTALL_DATA) $$p $(lispdir)/$$p; \
done
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lisp
distdir: $(DISTFILES)
distdir=`cd $(distdir) && pwd`
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
clean:
-rm -f *.elc info-look.el gpelcard.ps gpelcard.dvi gpelcard.log \
gpelcard.aux
test "$(srcdir)" = "$(top_builddir)" || rm -f gnuplot.el gnuplot-gui.el
distclean: clean
rm -f Makefile config.status config.log config.cache
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# serial 1
AC_DEFUN(AM_PATH_LISPDIR,
[# If set to t, that means we are running in a shell under Emacs.
# If you have an Emacs named "t", then use the full path.
test "$EMACS" = t && EMACS=
AC_PATH_PROGS(EMACS, emacs xemacs, no)
if test $EMACS != "no"; then
AC_MSG_CHECKING([where .elc files should go])
dnl Set default value
lispdir="\$(datadir)/emacs/site-lisp"
emacs_flavor=`echo "$EMACS" | sed -e 's,^.*/,,'`
if test "x$prefix" = "xNONE"; then
if test -d $ac_default_prefix/share/$emacs_flavor/site-lisp; then
lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
else
if test -d $ac_default_prefix/lib/$emacs_flavor/site-lisp; then
lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
fi
fi
else
if test -d $prefix/share/$emacs_flavor/site-lisp; then
lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
else
if test -d $prefix/lib/$emacs_flavor/site-lisp; then
lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
fi
fi
fi
AC_MSG_RESULT($lispdir)
fi
AC_SUBST(lispdir)])
This diff is collapsed.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([gnuplot-mode], [0.7], [bruceravel1@gmail.com])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_CHECK_PROGS(DVIPS, dvips, no)
AC_CHECK_PROGS(LATEX, latex latex2e, no)
AC_CHECK_PROGS(PDFLATEX, pdflatex, no)
# Check for Emacs and the Emacs site-lisp directory
AM_PATH_LISPDIR
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AC_INIT(dot.el)
AC_SET_MAKE
AC_PROG_INSTALL
AM_PATH_LISPDIR
EMACS=`basename $EMACS`
AC_PATH_PROG(MAKEINFO, makeinfo, no)
AC_OUTPUT(Makefile)
......@@ -3,5 +3,3 @@
(setq load-path (append (list ".") load-path)
byte-compile-verbose nil
byte-compile-warnings nil)
(require 'font-lock)
(defun hilit-repaint-command (foo))
This diff is collapsed.
This diff is collapsed.
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
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