Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Add an autotools based build system
- moved all code to the src directory
- generates pkg-config files

remove memphis-uninstalled.pc.in
  • Loading branch information
simon committed Oct 17, 2009
1 parent a36cbfd commit d6fa9d8
Show file tree
Hide file tree
Showing 34 changed files with 183 additions and 1 deletion.
Empty file added ChangeLog
Empty file.
13 changes: 13 additions & 0 deletions Makefile.am
@@ -0,0 +1,13 @@
SUBDIRS = src demos

ACLOCAL_AMFLAGS = -I m4

pcfiles = memphis-@API_VERSION@.pc

memphis-@API_VERSION@.pc: memphis.pc
@cp -f $< $@

pkgconfig_DATA = $(pcfiles)
pkgconfigdir = $(libdir)/pkgconfig

CLEANFILES = $(pcfiles)
Empty file added NEWS
Empty file.
87 changes: 87 additions & 0 deletions configure.ac
@@ -0,0 +1,87 @@
#
# Process this file with autoconf to produce a configure script.
#
m4_define([memphis_major_version], [0])
m4_define([memphis_minor_version], [1])
m4_define([memphis_micro_version], [0])
m4_define([memphis_version],
[memphis_major_version.memphis_minor_version.memphis_micro_version])
m4_define([api_version],
[memphis_major_version.memphis_minor_version])

AC_PREREQ(2.61)
AC_INIT([libmempis],
[memphis_version],
marius.rieder@durchmesser.ch)
AC_CONFIG_SRCDIR([src/memphis.h])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O

CPPFLAGS+="-Wall -Werror"

# API_VERSION is used to generate pc file only
API_VERSION=api_version
AC_SUBST(API_VERSION)

# used for -version-info current[:revision[:age]]
# see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html
LIBRARY_VERSION=0:1:0
AC_SUBST(LIBRARY_VERSION)

AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)

# check for gnome libraries
PKG_CHECK_MODULES(DEPS,
[ glib-2.0 >= 2.16,
gobject-2.0 >= 2.10,
cairo >= 1.4
]
)

# check for expat
AC_CHECK_LIB([expat], [XML_ParserCreate], [DEPS_LIBS="$DEPS_LIBS -lexpat"],
[AC_MSG_ERROR([cannot find expat library])])
AC_CHECK_HEADER([expat.h], [],
[AC_MSG_ERROR([cannot find expat.h header])])

# check for gtk-doc
#GTK_DOC_CHECK(1.9)

# -----------------------------------------------------------
# Enable debug
# -----------------------------------------------------------

AC_ARG_ENABLE(debug,
AC_HELP_STRING([--disable-debug],[compile without debug code]),
enable_debug=$enableval, enable_debug=yes )

if test x$enable_debug = xyes; then
AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
fi

# -----------------------------------------------------------
AC_CONFIG_FILES([Makefile
src/Makefile
demos/Makefile
memphis.pc
])
AC_OUTPUT

echo ""
echo " libmemphis $VERSION"
echo ""
echo " Prefix: ${prefix}"
echo " Compiler flags: ${CPPFLAGS}"
echo " Debug: ${enable_debug}"
#echo " Documentation: ${enable_gtk_doc}"
echo ""

13 changes: 13 additions & 0 deletions demos/Makefile.am
@@ -0,0 +1,13 @@
noinst_PROGRAMS = tile-renderer

INCLUDES = -I$(top_srcdir)

AM_CPPFLAGS = $(DEPS_CFLAGS)
AM_LDFLAGS = $(DEPS_LIBS)

tile_renderer_SOURCES = tile-renderer.c
tile_renderer_LDADD = $(DEPS_LIBS) ../src/libmemphis-0.1.la

EXTRA_DIST = \
map.osm \
rule.xml
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demos/tile-renderer.c
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "../memphis.h"
#include "src/memphis.h"
#include <stdlib.h>

#define RESOLUTION 256
Expand Down
11 changes: 11 additions & 0 deletions memphis.pc.in
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: libmemphis
Description: A map renderer for OpenStreetMap data
Version: @VERSION@
Libs: -L${libdir} -lmemphis-@API_VERSION@
Cflags: -I${includedir}/libmemphis-@API_VERSION@
Requires: gobject-2.0 cairo
58 changes: 58 additions & 0 deletions src/Makefile.am
@@ -0,0 +1,58 @@

lib_LTLIBRARIES = libmemphis-0.1.la

libmemphis_headers = \
memphis.h \
memphis-data-pool.h \
memphis-rule.h \
memphis-rule-set.h \
memphis-map.h \
memphis-renderer.h \
libmercator.h \
ruleset.h \
list.h \
textpath.h \
mlib.h \
osm05.h

libmemphis_0_1_la_SOURCES = \
libmercator.c \
mlib.c \
ruleset.c \
textpath.c \
osm05.c \
memphis-map.c \
memphis-rule.c \
memphis-rule-set.c \
memphis-renderer.c \
memphis-data-pool.c

noinst_HEADERS = \
libmercator.h \
list.h \
textpath.h \
mlib.h

libmemphis_include_HEADERS = \
memphis.h \
memphis-data-pool.h \
memphis-rule.h \
memphis-rule-set.h \
memphis-map.h \
memphis-renderer.h \
osm05.h \
ruleset.h

libmemphis_0_1_la_LIBADD = $(DEPS_LIBS)

libmemphis_includedir = $(includedir)/libmemphis-0.1/memphis

libmemphis_0_1_la_LDFLAGS = -version-info $(LIBRARY_VERSION) \
-export-symbols-regex \
^memphis_.*

AM_CPPFLAGS = \
$(DEPS_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-I$(top_srcdir) \
-std=c99
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d6fa9d8

Please sign in to comment.