summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2010-06-21 21:08:51 -0400
committerHenrik Rydberg <rydberg@euromail.se>2010-06-22 11:44:16 +0200
commit0647b37dfc35145d74822844ad7e54bf5c218369 (patch)
tree47225422ade9159ac08d61bcf16a4a45cf336dfb
parent172221f14fc91ebb37aa4c561ad733088cc3c3bf (diff)
downloadmtdev-git-0647b37dfc35145d74822844ad7e54bf5c218369.tar.gz
Move to autotools
[rydberg@euromail.se: minor fixups] Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--.gitignore81
-rw-r--r--Makefile71
-rw-r--r--Makefile.am14
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac33
-rw-r--r--mtdev.pc.in9
-rw-r--r--src/Makefile.am16
7 files changed, 162 insertions, 74 deletions
diff --git a/.gitignore b/.gitignore
index 7eb23b5..7df57dd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,78 @@
-bin
-obj
-patches
+#
+# X.Org module default exclusion patterns
+# The next section if for module specific patterns
+#
+# Do not edit the following section
+# GNU Build System (Autotools)
+aclocal.m4
+autom4te.cache/
+autoscan.log
+ChangeLog
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config-ml.in
+config.py
+config.status
+config.status.lineno
+config.sub
+configure
+configure.scan
+depcomp
+.deps/
+INSTALL
+install-sh
+.libs/
+libtool
+libtool.m4
+ltmain.sh
+lt~obsolete.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+Makefile
+Makefile.in
+mdate-sh
+missing
+mkinstalldirs
+*.pc
+py-compile
+stamp-h?
+symlink-tree
+texinfo.tex
+ylwrap
+
+# Do not edit the following section
+# Edit Compile Debug Document Distribute
+*~
+*.[0-9]
+*.[0-9]x
+*.bak
+*.bin
+core
+*.dll
+*.exe
+*-ISO*.bdf
+*-JIS*.bdf
+*-KOI8*.bdf
+*.kld
+*.ko
+*.ko.cmd
+*.lai
+*.l[oa]
+*.[oa]
+*.obj
+*.patch
+*.so
+*.pcf.gz
+*.pdb
+*.tar.bz2
+*.tar.gz
+#
+# Add & Override patterns for mtdev
+#
+# Edit the following section as needed
+# For example, !report.pc overrides *.pc. See 'man gitignore'
+#
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 678fee4..0000000
--- a/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-VERSION = 1
-PATCHLEVEL = 0
-SUBLEVEL = 0
-EXTRAVERSION =
-
-LIBRARY = libmtdev
-MODULES = src
-
-o_src = match iobuf caps core
-
-TARGETS += test/mtdev-mapgen
-TARGETS += test/mtdev
-PUBINC += mtdev.h
-
-OBJECTS = $(addsuffix .o,\
- $(foreach mod,$(MODULES),\
- $(addprefix $(mod)/,$(o_$(mod)))))
-
-TBIN = $(addprefix bin/,$(TARGETS))
-SLIB = $(addprefix obj/,$(LIBRARY).a)
-DLIB = $(addprefix obj/,$(LIBRARY).so)
-TOBJ = $(addprefix obj/,$(addsuffix .o,$(TARGETS)))
-TINC = $(addprefix include/,$(PUBINC))
-OBJS = $(addprefix obj/,$(OBJECTS))
-LIBS =
-
-DESTINC = usr/include
-DESTLIB = usr/lib
-
-INCLUDE = -Iinclude
-OPTS = -O3 -fPIC
-
-.PHONY: all clean
-.PRECIOUS: obj/%.o
-
-all: $(OBJS) $(SLIB) $(DLIB) $(TOBJ) $(TBIN)
-
-bin/%: obj/%.o $(SLIB)
- @mkdir -p $(@D)
- gcc $< -o $@ $(SLIB) $(LIBS)
-
-$(SLIB): $(OBJS) $(XOBJS)
- @rm -f $(SLIB)
- ar qc $@ $(OBJS) $(XOBJS)
-
-$(DLIB): $(OBJS) $(XOBJS)
- @rm -f $(DLIB)
- gcc -shared $(OBJS) $(XOBJS) -Wl,-soname -Wl,$(LIBRARY).so -o $@
-
-obj/%.o: %.c
- @mkdir -p $(@D)
- gcc $(INCLUDE) $(OPTS) -c $< -o $@
-
-clean:
- rm -rf bin obj
-
-distclean: clean
- rm -rf debian/*.log debian/files
-
-install: $(TINC) $(SLIB) $(DLIB)
- install -d $(DESTDIR)/$(DESTINC)
- install -m 644 $(TINC) $(DESTDIR)/$(DESTINC)
- install -d $(DESTDIR)/$(DESTLIB)
- install -m 644 $(SLIB) $(DESTDIR)/$(DESTLIB)
- install -m 755 $(DLIB) $(DESTDIR)/$(DESTLIB)
- ldconfig -n $(DESTDIR)/$(DESTLIB)
-
-uninstall:
- rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).so
- rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).a
- rm -f $(DESTDIR)/$(DESTINC)/$(PUBINC)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..e2c1d0a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,14 @@
+SUBDIRS = src
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = mtdev.pc
+
+INCLUDES = $(top_srcdir)/include/
+
+.PHONY: ChangeLog INSTALL
+INSTALL:
+ $(INSTALL_CMD)
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..904cd67
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..cb59c11
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,33 @@
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([Multitouch Protocol Translation Library],
+ [1.0.0],
+ [],
+ [mtdev])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+LIB_VERSION=1:0:0
+AC_SUBST([LIB_VERSION])
+
+# Initialize libtool
+AC_PROG_LIBTOOL
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Initialize X.Org macros
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.5 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.5)
+XORG_DEFAULT_OPTIONS
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ mtdev.pc])
+AC_OUTPUT
diff --git a/mtdev.pc.in b/mtdev.pc.in
new file mode 100644
index 0000000..de5528b
--- /dev/null
+++ b/mtdev.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: mtdev
+Description: Multitouch Protocol Translation Library
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lmtdev
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..70ace68
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,16 @@
+lib_LTLIBRARIES = libmtdev.la
+
+libmtdev_la_LDFLAGS = -version-info @LIB_VERSION@
+
+libmtdev_la_SOURCES = \
+ caps.c \
+ core.c \
+ iobuf.c \
+ match.c
+
+AM_CFLAGS = $(CWARNFLAGS)
+
+INCLUDES = -I$(top_srcdir)/include/
+
+libmtdevincludedir = $(includedir)
+libmtdevinclude_HEADERS = $(top_srcdir)/include/mtdev.h