[PATCH] xdgmime: Add autotools-based build system.
Thierry Reding
thierry.reding at avionic-design.de
Mon Feb 28 23:54:24 PST 2011
---
Makefile.am | 41 +++++++++++++++++++++++++++++++++++++++++
autogen.sh | 13 +++++++++++++
configure.ac | 30 ++++++++++++++++++++++++++++++
src/Makefile | 12 ------------
src/xdgmime.pc.in | 9 +++++++++
5 files changed, 93 insertions(+), 12 deletions(-)
create mode 100644 Makefile.am
create mode 100755 autogen.sh
create mode 100644 configure.ac
delete mode 100644 src/Makefile
create mode 100644 src/xdgmime.pc.in
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..62be7d6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,41 @@
+ACLOCAL_AMFLAGS = -I m4
+
+lib_LTLIBRARIES = \
+ libxdgmime.la
+
+include_HEADERS = \
+ src/xdgmime.h
+
+libxdgmime_la_SOURCES = \
+ src/xdgmimealias.c \
+ src/xdgmimealias.h \
+ src/xdgmime.c \
+ src/xdgmime.h \
+ src/xdgmimecache.c \
+ src/xdgmimecache.h \
+ src/xdgmimeglob.c \
+ src/xdgmimeglob.h \
+ src/xdgmimeicon.c \
+ src/xdgmimeicon.h \
+ src/xdgmimeint.c \
+ src/xdgmimeint.h \
+ src/xdgmimemagic.c \
+ src/xdgmimemagic.h \
+ src/xdgmimeparent.c \
+ src/xdgmimeparent.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = \
+ src/xdgmime.pc
+
+TESTS = \
+ test-mime \
+ test-mime-data
+
+test_mime_SOURCES = src/test-mime.c
+test_mime_LDADD = libxdgmime.la
+test_mime_data_SOURCES = src/test-mime-data.c
+test_mime_data_LDADD = libxdgmime.la
+
+noinst_PROGRAMS = \
+ $(TESTS)
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..86f382e
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+test -d m4 || mkdir m4
+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..014fbfe
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,30 @@
+AC_INIT([xdgmime], [0.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xdgmime])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADER([config.h])
+AC_CANONICAL_HOST
+
+AM_INIT_AUTOMAKE([dist-bzip2 dist-xz foreign])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_MAINTAINER_MODE
+
+AC_PROG_LIBTOOL
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+
+CFLAGS="$CFLAGS -Wall"
+
+AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--enable-werror],
+ [Treat warnings as errors (default: enabled)])],
+ [enable_werror="$enableval"],
+ [enable_werror=yes])
+AS_IF([test "x$enable_werror" = "xyes"], [CFLAGS="$CFLAGS -Werror"])
+
+AC_FUNC_MMAP
+
+AC_OUTPUT([
+ Makefile
+ src/xdgmime.pc
+])
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index c07f760..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-CFLAGS=-Wall -Wmissing-prototypes -Wno-sign-compare -g -DXDG_PREFIX=xdg_test -DHAVE_MMAP
-
-all: test-mime test-mime-data
-
-test-mime: xdgmime.o xdgmimeglob.o xdgmimeint.o xdgmimemagic.o xdgmimealias.o xdgmimeparent.o xdgmimecache.o xdgmimeicon.o
-
-test-mime-data: xdgmime.o xdgmimeglob.o xdgmimeint.o xdgmimemagic.o xdgmimealias.o xdgmimeparent.o xdgmimecache.o xdgmimeicon.o
-
-clean:
- rm -f *~ *.o test-mime test-mime-data
-
diff --git a/src/xdgmime.pc.in b/src/xdgmime.pc.in
new file mode 100644
index 0000000..7ce2cdd
--- /dev/null
+++ b/src/xdgmime.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xdgmime
+Description: XDG shared mime database query library
+Version: @VERSION@
+Libs: -L${libdir} -lxdgmime
--
1.7.4.1
More information about the xdg
mailing list