File: configure.ac

package info (click to toggle)
mercator 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: sh: 10,433; cpp: 4,482; makefile: 115
file content (93 lines) | stat: -rw-r--r-- 2,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
dnl Initialise autoconf

AC_INIT([mercator], [0.3.0], [alriddoch@googlemail.com])
AC_CONFIG_SRCDIR([Mercator/Mercator.cpp])
AC_CONFIG_HEADERS([config.h])

dnl Detect the canonical host and target environment

AC_CANONICAL_HOST

dnl Initialise automake

AM_INIT_AUTOMAKE([nostdinc dist-bzip2 check-news color-tests parallel-tests])

dnl versioning info for libtool
MERCATOR_CURRENT=1
MERCATOR_REVISION=0
MERCATOR_AGE=0
MERCATOR_VERSION_INFO=$MERCATOR_CURRENT:$MERCATOR_REVISION:$MERCATOR_AGE

MERCATOR_LIB_SUFFIX="-0.3"
MERCATOR_LIBS="-lmercator$MERCATOR_LIB_SUFFIX"
MERCATOR_REQUIRES=""

AC_SUBST(MERCATOR_VERSION_INFO)

dnl Test for GNU libtool

LT_INIT([disable-static])

AC_PROG_CXX

AC_ARG_ENABLE(debug,
    [  --enable-debug          enable debug information [default=no]],
    [
        if test "$enableval" = "yes"; then
            CXXFLAGS="$CXXFLAGS -Wall -DDEBUG"
        else
            CXXFLAGS="$CXXFLAGS -Wall -DNDEBUG"
        fi
    ],[
        CXXFLAGS="$CXXFLAGS -Wall -DNDEBUG"
    ]
)

dnl Make sure we've got sensible versions of the sources (eg to get lrintf)

AC_DEFINE(_XOPEN_SOURCE, 500, [This is XOpen source])
AC_DEFINE(_ISOC99_SOURCE,1, [This is C99 source])

AC_LANG(C++)

dnl Check for float to int converters

AC_CHECK_FUNCS([lrintf rintf rint])
AC_CHECK_FUNCS([fabsf])

PKG_PROG_PKG_CONFIG

dnl Check for wfmath library
PKG_CHECK_MODULES(WF, wfmath-0.3 >= 0.3.2,
    [
        CPPFLAGS="$CPPFLAGS $WF_CFLAGS"
        LIBS="$LIBS $WF_LIBS"
        MERCATOR_REQUIRES="$MERCATOR_REQUIRES wfmath-0.3"
    ],
    [
        AC_MSG_ERROR([
Cannot find valid versions of required WorldForge maths library, wfmath:
$WF_PKG_ERRORS
Perhaps you should add the directory containing the missing libraries to the
PKG_CONFIG_PATH environment variable.
Please see http://www.worldforge.org/dev/eng/libraries/mercator for details of
the libraries required and where to obtain them.])
    ])

SYSTEM_LIBS=""
MERCATOR_CFLAGS=""
AC_SUBST(SYSTEM_LIBS)
AC_SUBST(MERCATOR_LIB_SUFFIX)
AC_SUBST(MERCATOR_LIBS)
AC_SUBST(MERCATOR_CFLAGS)
AC_SUBST(MERCATOR_REQUIRES)

AC_CONFIG_FILES([
	Makefile
	Mercator/Makefile
	tests/Makefile
	mercator.spec
	mingw32-mercator.spec
	mercator-0.3.pc
])
AC_OUTPUT