Skip to content

Commit

Permalink
build: use autotools
Browse files Browse the repository at this point in the history
This removes the hand-crafted Makefile in favor of standardized autotools
build configuration. This is done to allow for easy cross-compilation of
this project.

Signed-off-by: Bartosz Golaszewski <[email protected]>
  • Loading branch information
brgl committed Sep 13, 2019
1 parent b450d78 commit fe07e6a
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 66 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@ obj/*.o
man/*.1
man/*.xml
test/GLOB*
*.o

# autotools stuff
.deps/
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
autostuff/
config.h
config.h.in
config.h.in~
config.log
config.status
configure
m4/
stamp-h1
66 changes: 0 additions & 66 deletions Makefile

This file was deleted.

10 changes: 10 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
SUBDIRS = include src

if HAS_A2X
SUBDIRS += man
endif

licensedir = $(datadir)/licenses/unclutter
license_DATA = LICENSE
36 changes: 36 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
AC_PREREQ(2.61)

AC_INIT([unclutter-xfixes], 1.6)
AC_DEFINE_UNQUOTED([VERSION], ["$PACKAGE_VERSION"])

AC_CONFIG_AUX_DIR([autostuff])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])

AM_PROG_AR
AC_PROG_CC
AC_PROG_INSTALL

# libev has no pkg-config support
AC_CHECK_HEADERS([ev.h], [], [AC_MSG_ERROR([ev.h not found - please install libev])])

PKG_CHECK_MODULES([X11], [x11 xi xfixes])

AC_CHECK_PROG([has_a2x], [a2x], [true], [false])
AM_CONDITIONAL([HAS_A2X], [test "x$has_a2x" = xtrue])
if test "x$has_a2x" = xfalse
then
AC_MSG_NOTICE([a2x not found - needed to generate man pages])
fi

AC_CONFIG_FILES([Makefile
include/Makefile
src/Makefile
man/Makefile])

AC_OUTPUT
9 changes: 9 additions & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
noinst_HEADERS = \
all.h \
cursor.h \
event.h \
extensions.h \
externals.h \
globals.h \
types.h \
util.h
7 changes: 7 additions & 0 deletions man/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
unclutter-xfixes.1:
a2x --no-xmllint -f manpage unclutter-xfixes.man

dist_man1_MANS = unclutter-xfixes.1

clean-local:
rm -f unclutter-xfixes.1
Empty file removed obj/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AM_CFLAGS = -D'__VERSION="${VERSION}"' "-I$(top_srcdir)/include"
AM_CFLAGS += -std=gnu99 -Wall -Wundef -Wshadow -Wformat-security
AM_CFLAGS += $(X11_CFLAGS)
AM_LDFLAGS = -lev $(X11_LIBS)

bin_PROGRAMS = unclutter

unclutter_SOURCES = \
cursor.c \
event.c \
extensions.c \
unclutter.c \
util.c

0 comments on commit fe07e6a

Please sign in to comment.