From 5582660d37052a3e2d88bf4ada3fc58a98428d15 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Mon, 25 May 2020 13:34:23 +0100 Subject: [PATCH] wmcore: switch to autotools. --- wmcore/.gitignore | 14 ++++++++++++++ wmcore/Makefile | 37 ------------------------------------- wmcore/Makefile.am | 7 +++++++ wmcore/autogen | 6 ++++++ wmcore/configure.ac | 29 +++++++++++++++++++++++++++++ wmcore/wmcore.c | 4 ++-- 6 files changed, 58 insertions(+), 39 deletions(-) delete mode 100644 wmcore/Makefile create mode 100644 wmcore/Makefile.am create mode 100755 wmcore/autogen create mode 100644 wmcore/configure.ac diff --git a/wmcore/.gitignore b/wmcore/.gitignore index f30f96a..c61ade1 100644 --- a/wmcore/.gitignore +++ b/wmcore/.gitignore @@ -1,5 +1,19 @@ *~ .\#* \#*\# +aclocal.m4 +autom4te.cache/ +compile +config.* +configure +depcomp +.deps/ +INSTALL +install-sh +Makefile +Makefile.in +missing *.o +stamp-h1 wmcore +wmcore-*.tar.xz diff --git a/wmcore/Makefile b/wmcore/Makefile deleted file mode 100644 index cf670aa..0000000 --- a/wmcore/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -PREFIX = /usr -BINDIR = $(PREFIX)/bin - -INSTALL = /usr/bin/install -LD = $(CC) - -CFLAGS += -Wall -O3 \ - $(shell pkg-config dockapp --cflags) \ - $(shell pkg-config x11 --cflags) \ - $(shell pkg-config xext --cflags) \ - $(shell pkg-config xpm --cflags) -LDFLAGS += -Wall - -LIBS = $(shell pkg-config dockapp --libs) \ - $(shell pkg-config x11 --libs) \ - $(shell pkg-config xext --libs) \ - $(shell pkg-config xpm --libs) - -OBJS = wmcore.o - -all : wmcore - -.c.o: - $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $*.o - -wmcore: $(OBJS) - $(LD) $(LDFLAGS) $^ -o $@ $(LIBS) - -clean: - rm -f $(OBJS) wmcore - -install: - $(INSTALL) -d $(DESTDIR)$(BINDIR) - $(INSTALL) -m 0755 wmcore $(DESTDIR)$(BINDIR) - -uninstall: - rm -f /usr/bin/wmcore diff --git a/wmcore/Makefile.am b/wmcore/Makefile.am new file mode 100644 index 0000000..d673ee0 --- /dev/null +++ b/wmcore/Makefile.am @@ -0,0 +1,7 @@ +bin_PROGRAMS = wmcore + +wmcore_CFLAGS = -Wall -O3 $(pkg_config_CFLAGS) + +wmcore_LDADD = $(pkg_config_LIBS) + +wmcore_SOURCES = wmcore.c wmcore_mask.xbm wmcore_master.xpm diff --git a/wmcore/autogen b/wmcore/autogen new file mode 100755 index 0000000..2a595cc --- /dev/null +++ b/wmcore/autogen @@ -0,0 +1,6 @@ +#!/bin/sh + +AUTOMAKE="automake --add-missing" +export AUTOMAKE + +exec autoreconf --install "$@" diff --git a/wmcore/configure.ac b/wmcore/configure.ac new file mode 100644 index 0000000..acd1414 --- /dev/null +++ b/wmcore/configure.ac @@ -0,0 +1,29 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([wmcore], [0.0.3], [wmaker-dev@googlegroups.com]) +AC_CONFIG_SRCDIR([wmcore.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz]) + +# Checks for programs. +: ${CFLAGS:=""} +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for pkg-config modules. +PKG_CHECK_MODULES([pkg_config], [x11 xext xpm dockapp]) + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/param.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_CHECK_FUNCS([strstr]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/wmcore/wmcore.c b/wmcore/wmcore.c index 68b6833..bb417f9 100644 --- a/wmcore/wmcore.c +++ b/wmcore/wmcore.c @@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define VERSION "0.0.3" +#include "config.h" #include #include @@ -91,7 +91,7 @@ int main(int argc, char **argv) { XEvent Event; - printf("wmcore %s by bitman@bitmania.de\n", VERSION); + fputs(PACKAGE_STRING " by bitman@bitmania.de\n", stdout); for (c=1;c<=argc;c++) { if (argv[c] == NULL) {} else if (!strcmp(argv[c],"-d")) { -- 2.11.4.GIT