diff options
| author | Chase Douglas <chase.douglas@canonical.com> | 2010-06-21 21:08:51 -0400 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-22 11:44:16 +0200 |
| commit | 0647b37dfc35145d74822844ad7e54bf5c218369 (patch) | |
| tree | 47225422ade9159ac08d61bcf16a4a45cf336dfb | |
| parent | 172221f14fc91ebb37aa4c561ad733088cc3c3bf (diff) | |
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-- | .gitignore | 81 | ||||
| -rw-r--r-- | Makefile | 71 | ||||
| -rw-r--r-- | Makefile.am | 14 | ||||
| -rwxr-xr-x | autogen.sh | 12 | ||||
| -rw-r--r-- | configure.ac | 33 | ||||
| -rw-r--r-- | mtdev.pc.in | 9 | ||||
| -rw-r--r-- | src/Makefile.am | 16 |
7 files changed, 162 insertions, 74 deletions
| @@ -1,3 +1,78 @@ | |||
| 1 | bin | 1 | # |
| 2 | obj | 2 | # X.Org module default exclusion patterns |
| 3 | patches | 3 | # The next section if for module specific patterns |
| 4 | # | ||
| 5 | # Do not edit the following section | ||
| 6 | # GNU Build System (Autotools) | ||
| 7 | aclocal.m4 | ||
| 8 | autom4te.cache/ | ||
| 9 | autoscan.log | ||
| 10 | ChangeLog | ||
| 11 | compile | ||
| 12 | config.guess | ||
| 13 | config.h | ||
| 14 | config.h.in | ||
| 15 | config.log | ||
| 16 | config-ml.in | ||
| 17 | config.py | ||
| 18 | config.status | ||
| 19 | config.status.lineno | ||
| 20 | config.sub | ||
| 21 | configure | ||
| 22 | configure.scan | ||
| 23 | depcomp | ||
| 24 | .deps/ | ||
| 25 | INSTALL | ||
| 26 | install-sh | ||
| 27 | .libs/ | ||
| 28 | libtool | ||
| 29 | libtool.m4 | ||
| 30 | ltmain.sh | ||
| 31 | lt~obsolete.m4 | ||
| 32 | ltoptions.m4 | ||
| 33 | ltsugar.m4 | ||
| 34 | ltversion.m4 | ||
| 35 | Makefile | ||
| 36 | Makefile.in | ||
| 37 | mdate-sh | ||
| 38 | missing | ||
| 39 | mkinstalldirs | ||
| 40 | *.pc | ||
| 41 | py-compile | ||
| 42 | stamp-h? | ||
| 43 | symlink-tree | ||
| 44 | texinfo.tex | ||
| 45 | ylwrap | ||
| 46 | |||
| 47 | # Do not edit the following section | ||
| 48 | # Edit Compile Debug Document Distribute | ||
| 49 | *~ | ||
| 50 | *.[0-9] | ||
| 51 | *.[0-9]x | ||
| 52 | *.bak | ||
| 53 | *.bin | ||
| 54 | core | ||
| 55 | *.dll | ||
| 56 | *.exe | ||
| 57 | *-ISO*.bdf | ||
| 58 | *-JIS*.bdf | ||
| 59 | *-KOI8*.bdf | ||
| 60 | *.kld | ||
| 61 | *.ko | ||
| 62 | *.ko.cmd | ||
| 63 | *.lai | ||
| 64 | *.l[oa] | ||
| 65 | *.[oa] | ||
| 66 | *.obj | ||
| 67 | *.patch | ||
| 68 | *.so | ||
| 69 | *.pcf.gz | ||
| 70 | *.pdb | ||
| 71 | *.tar.bz2 | ||
| 72 | *.tar.gz | ||
| 73 | # | ||
| 74 | # Add & Override patterns for mtdev | ||
| 75 | # | ||
| 76 | # Edit the following section as needed | ||
| 77 | # For example, !report.pc overrides *.pc. See 'man gitignore' | ||
| 78 | # | ||
diff --git a/Makefile b/Makefile deleted file mode 100644 index 678fee4..0000000 --- a/Makefile +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | VERSION = 1 | ||
| 2 | PATCHLEVEL = 0 | ||
| 3 | SUBLEVEL = 0 | ||
| 4 | EXTRAVERSION = | ||
| 5 | |||
| 6 | LIBRARY = libmtdev | ||
| 7 | MODULES = src | ||
| 8 | |||
| 9 | o_src = match iobuf caps core | ||
| 10 | |||
| 11 | TARGETS += test/mtdev-mapgen | ||
| 12 | TARGETS += test/mtdev | ||
| 13 | PUBINC += mtdev.h | ||
| 14 | |||
| 15 | OBJECTS = $(addsuffix .o,\ | ||
| 16 | $(foreach mod,$(MODULES),\ | ||
| 17 | $(addprefix $(mod)/,$(o_$(mod))))) | ||
| 18 | |||
| 19 | TBIN = $(addprefix bin/,$(TARGETS)) | ||
| 20 | SLIB = $(addprefix obj/,$(LIBRARY).a) | ||
| 21 | DLIB = $(addprefix obj/,$(LIBRARY).so) | ||
| 22 | TOBJ = $(addprefix obj/,$(addsuffix .o,$(TARGETS))) | ||
| 23 | TINC = $(addprefix include/,$(PUBINC)) | ||
| 24 | OBJS = $(addprefix obj/,$(OBJECTS)) | ||
| 25 | LIBS = | ||
| 26 | |||
| 27 | DESTINC = usr/include | ||
| 28 | DESTLIB = usr/lib | ||
| 29 | |||
| 30 | INCLUDE = -Iinclude | ||
| 31 | OPTS = -O3 -fPIC | ||
| 32 | |||
| 33 | .PHONY: all clean | ||
| 34 | .PRECIOUS: obj/%.o | ||
| 35 | |||
| 36 | all: $(OBJS) $(SLIB) $(DLIB) $(TOBJ) $(TBIN) | ||
| 37 | |||
| 38 | bin/%: obj/%.o $(SLIB) | ||
| 39 | @mkdir -p $(@D) | ||
| 40 | gcc $< -o $@ $(SLIB) $(LIBS) | ||
| 41 | |||
| 42 | $(SLIB): $(OBJS) $(XOBJS) | ||
| 43 | @rm -f $(SLIB) | ||
| 44 | ar qc $@ $(OBJS) $(XOBJS) | ||
| 45 | |||
| 46 | $(DLIB): $(OBJS) $(XOBJS) | ||
| 47 | @rm -f $(DLIB) | ||
| 48 | gcc -shared $(OBJS) $(XOBJS) -Wl,-soname -Wl,$(LIBRARY).so -o $@ | ||
| 49 | |||
| 50 | obj/%.o: %.c | ||
| 51 | @mkdir -p $(@D) | ||
| 52 | gcc $(INCLUDE) $(OPTS) -c $< -o $@ | ||
| 53 | |||
| 54 | clean: | ||
| 55 | rm -rf bin obj | ||
| 56 | |||
| 57 | distclean: clean | ||
| 58 | rm -rf debian/*.log debian/files | ||
| 59 | |||
| 60 | install: $(TINC) $(SLIB) $(DLIB) | ||
| 61 | install -d $(DESTDIR)/$(DESTINC) | ||
| 62 | install -m 644 $(TINC) $(DESTDIR)/$(DESTINC) | ||
| 63 | install -d $(DESTDIR)/$(DESTLIB) | ||
| 64 | install -m 644 $(SLIB) $(DESTDIR)/$(DESTLIB) | ||
| 65 | install -m 755 $(DLIB) $(DESTDIR)/$(DESTLIB) | ||
| 66 | ldconfig -n $(DESTDIR)/$(DESTLIB) | ||
| 67 | |||
| 68 | uninstall: | ||
| 69 | rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).so | ||
| 70 | rm -f $(DESTDIR)/$(DESTLIB)/$(LIBRARY).a | ||
| 71 | 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 @@ | |||
| 1 | SUBDIRS = src | ||
| 2 | |||
| 3 | pkgconfigdir = $(libdir)/pkgconfig | ||
| 4 | pkgconfig_DATA = mtdev.pc | ||
| 5 | |||
| 6 | INCLUDES = $(top_srcdir)/include/ | ||
| 7 | |||
| 8 | .PHONY: ChangeLog INSTALL | ||
| 9 | INSTALL: | ||
| 10 | $(INSTALL_CMD) | ||
| 11 | ChangeLog: | ||
| 12 | $(CHANGELOG_CMD) | ||
| 13 | |||
| 14 | 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 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | |||
| 3 | srcdir=`dirname $0` | ||
| 4 | test -z "$srcdir" && srcdir=. | ||
| 5 | |||
| 6 | ORIGDIR=`pwd` | ||
| 7 | cd $srcdir | ||
| 8 | |||
| 9 | autoreconf -v --install || exit 1 | ||
| 10 | cd $ORIGDIR || exit $? | ||
| 11 | |||
| 12 | $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 @@ | |||
| 1 | # Initialize Autoconf | ||
| 2 | AC_PREREQ([2.60]) | ||
| 3 | AC_INIT([Multitouch Protocol Translation Library], | ||
| 4 | [1.0.0], | ||
| 5 | [], | ||
| 6 | [mtdev]) | ||
| 7 | AC_CONFIG_SRCDIR([Makefile.am]) | ||
| 8 | AC_CONFIG_HEADERS([config.h]) | ||
| 9 | |||
| 10 | # Initialize Automake | ||
| 11 | AM_INIT_AUTOMAKE([foreign dist-bzip2]) | ||
| 12 | AM_MAINTAINER_MODE | ||
| 13 | |||
| 14 | LIB_VERSION=1:0:0 | ||
| 15 | AC_SUBST([LIB_VERSION]) | ||
| 16 | |||
| 17 | # Initialize libtool | ||
| 18 | AC_PROG_LIBTOOL | ||
| 19 | |||
| 20 | # Checks for programs. | ||
| 21 | AC_PROG_CC | ||
| 22 | AC_PROG_INSTALL | ||
| 23 | |||
| 24 | # Initialize X.Org macros | ||
| 25 | m4_ifndef([XORG_MACROS_VERSION], | ||
| 26 | [m4_fatal([must install xorg-macros 1.5 or later before running autoconf/autogen])]) | ||
| 27 | XORG_MACROS_VERSION(1.5) | ||
| 28 | XORG_DEFAULT_OPTIONS | ||
| 29 | |||
| 30 | AC_CONFIG_FILES([Makefile | ||
| 31 | src/Makefile | ||
| 32 | mtdev.pc]) | ||
| 33 | 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 @@ | |||
| 1 | prefix=@prefix@ | ||
| 2 | exec_prefix=@exec_prefix@ | ||
| 3 | libdir=@libdir@ | ||
| 4 | includedir=@includedir@ | ||
| 5 | |||
| 6 | Name: mtdev | ||
| 7 | Description: Multitouch Protocol Translation Library | ||
| 8 | Version: @PACKAGE_VERSION@ | ||
| 9 | 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 @@ | |||
| 1 | lib_LTLIBRARIES = libmtdev.la | ||
| 2 | |||
| 3 | libmtdev_la_LDFLAGS = -version-info @LIB_VERSION@ | ||
| 4 | |||
| 5 | libmtdev_la_SOURCES = \ | ||
| 6 | caps.c \ | ||
| 7 | core.c \ | ||
| 8 | iobuf.c \ | ||
| 9 | match.c | ||
| 10 | |||
| 11 | AM_CFLAGS = $(CWARNFLAGS) | ||
| 12 | |||
| 13 | INCLUDES = -I$(top_srcdir)/include/ | ||
| 14 | |||
| 15 | libmtdevincludedir = $(includedir) | ||
| 16 | libmtdevinclude_HEADERS = $(top_srcdir)/include/mtdev.h | ||
