From 97c5b4d178fb0066706fb4258c07f5f59c669d58 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 4 Dec 2017 08:28:55 -0500 Subject: [PATCH] Use autotools for the build/dist system. --- Makefile.am | 12 ++++++++++++ autogen.sh | 2 ++ configure.ac | 19 +++++++++++++++++++ makefile | 11 ----------- 4 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 Makefile.am create mode 100755 autogen.sh create mode 100644 configure.ac delete mode 100644 makefile diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..41a6b6a --- /dev/null +++ b/Makefile.am @@ -0,0 +1,12 @@ +EXTRA_DIST = doc + +consoledir = $(pkgdatadir) +nodist_console_DATA = $(srcdir)/src/console.map + +if XMODMAP + # Without this set, we won't try to install the Xmodmap file. + xmodmapdir = $(pkgdatadir) + nodist_xmodmap_DATA = $(srcdir)/src/Xmodmap +endif + +nodist_doc_DATA = $(srcdir)/doc/README diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3f026c4 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/sh +autoreconf --force --install diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..51b92a0 --- /dev/null +++ b/configure.ac @@ -0,0 +1,19 @@ +AC_INIT([emacs-keys], [0.0.1], [michael@orlitzky.com]) +AM_INIT_AUTOMAKE([-Wall foreign no-dist-gzip dist-xz]) + +# --enable-Xmodmap flag, disabled by default, that decides whether or +# not we install the Xmodmap file. +AC_ARG_ENABLE( + [Xmodmap], + [ --enable-Xmodmap install the Xmodmap file [[default=no]]], + [case "${enableval}" in + yes) xmodmap=true ;; + no) xmodmap=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-xmodmap]) ;; + esac],[xmodmap=false]) + AM_CONDITIONAL([XMODMAP], [test x$xmodmap = xtrue]) + +# List of output files. +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/makefile b/makefile deleted file mode 100644 index 87c6ccc..0000000 --- a/makefile +++ /dev/null @@ -1,11 +0,0 @@ -PN = emacs-keys -PREFIX := /usr/local - -# So that "make" doesn't try to install stuff. -all: - -install-console: $(DESTDIR)$(PREFIX)/share/$(PN)/console.map -install-xorg: $(DESTDIR)$(PREFIX)/share/$(PN)/Xmodmap - -$(DESTDIR)$(PREFIX)/share/$(PN)%: src/% - install -D --mode=644 $< $@ -- 2.44.2