~alexc/gpredict/head

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Alexandru Csete
  • Date: 2013-03-07 14:43:04 UTC
  • Revision ID: git-v1:daa611c92a71bf08f34df42fc3b17e3f08fbe0ef
Build system updates.

- Update configure.ac to work with recent automake.
- Use git-version-gen to generate git revisions.
- Use kernel style compile messages.
- Don't use PKG_CHECK_MODULES macro (ref http://goo.gl/E6Bvi)
- Misc. clean-up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
AC_INIT(src/main.c)
2
 
 
 
1
AC_INIT([gpredict],
 
2
        m4_esyscmd([./git-version-gen .tarball-version]),
 
3
        [gpredict-discussion@lists.sourceforge.net])
 
4
AC_CONFIG_SRCDIR(src/main.c)
3
5
AM_CONFIG_HEADER(build-config.h)
4
 
 
5
 
AM_INIT_AUTOMAKE(gpredict, 1.4git)
 
6
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip 1.6])
6
7
 
7
8
AM_MAINTAINER_MODE
8
9
AC_PROG_INTLTOOL([0.21])
9
10
 
 
11
# kernel style compile messages
 
12
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
13
 
11
 
dnl check for programs
 
14
# check for programs
12
15
AC_PROG_CC
13
16
AC_ISC_POSIX
14
17
AC_HEADER_STDC
20
23
  CFLAGS="${CFLAGS} -Wall"
21
24
fi
22
25
 
23
 
dnl check for libm
 
26
# check for libm
24
27
AC_CHECK_LIB([m], [sin],, AC_MSG_ERROR([Can't find libm. Check your libc installation]))
25
28
 
26
 
dnl check for glib, gtk, and goocanvas libraries
27
 
pkg_modules="gtk+-2.0 >= 2.18.0 glib-2.0 >= 2.22.0 gthread-2.0 >= 2.22.0 goocanvas >= 0.15 libcurl >= 7.19.0"
28
 
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 
29
# check for goocanvas (depends on gtk and glib)
 
30
if pkg-config --atleast-version=7.19 libcurl; then
 
31
    CFLAGS="$CFLAGS `pkg-config --cflags libcurl`"
 
32
    LIBS="$LIBS `pkg-config --libs libcurl`"
 
33
else
 
34
    AC_MSG_ERROR(Gpredict requires libcurl-dev 7.19 or later)
 
35
fi
 
36
 
 
37
# check for goocanvas (depends on gtk and glib)
 
38
if pkg-config --atleast-version=0.15 goocanvas; then
 
39
    CFLAGS="$CFLAGS `pkg-config --cflags goocanvas`"
 
40
    LIBS="$LIBS `pkg-config --libs goocanvas`"
 
41
else
 
42
    AC_MSG_ERROR(Gpredict requires libgoocanvas-dev 0.15 or later)
 
43
fi
 
44
 
 
45
# check for libgps (optional)
 
46
if pkg-config --atleast-version=2.90 libgps; then
 
47
    CFLAGS="$CFLAGS `pkg-config --cflags libgps`"
 
48
    LIBS="$LIBS `pkg-config --libs libgps`"
 
49
    havelibgps=true;
 
50
    AC_DEFINE(HAS_LIBGPS, 1, [Define if libgps is available])
 
51
else
 
52
    havelibgps=false;
 
53
fi
 
54
 
29
55
AC_SUBST(PACKAGE_CFLAGS)
30
56
AC_SUBST(PACKAGE_LIBS)
31
57
 
32
 
dnl optional check for libgps
33
 
PKG_CHECK_MODULES(LIBGPS, [ libgps >= 2.90 ], [
34
 
       CFLAGS="$CFLAGS $LIBGPS_CFLAGS";
35
 
       LIBS="$LIBS $LIBGPS_LIBS"; 
36
 
        havelibgps=true;            
37
 
        AC_DEFINE(HAS_LIBGPS, 1, [Define if libgps is available])
38
 
   ], [
39
 
        havelibgps=false;            
40
 
])
41
 
 
42
 
dnl Hamlib not needed if we go for the TCP based I/F
43
 
dnl check for hamlib
44
 
dnl PKG_CHECK_MODULES(HAMLIB, hamlib, [
45
 
dnl        CFLAGS="$CFLAGS $HAMLIB_CFLAGS";
46
 
dnl        LIBS="$LIBS $HAMLIB_LIBS"; 
47
 
dnl        havehamlib=true;            
48
 
dnl        AC_DEFINE(HAVE_HAMLIB, 1, [Define if hamlib is available])
49
 
dnl   ], [
50
 
dnl        havehamlib=false;            
51
 
dnl        AC_DEFINE(HAVE_HAMLIB, 0, [Define if hamlib is unvailable])
52
 
 
53
 
dnl])
54
 
 
55
 
dnl Add the languages which your application supports here.
56
 
dnl Note that other progs only have ALL_LINGUAS and AM_GLIB_GNU_GETTEXT
 
58
# Add the languages which your application supports here.
 
59
# Note that other progs only have ALL_LINGUAS and AM_GLIB_GNU_GETTEXT
57
60
ALL_LINGUAS="cs da de en_GB en_US es fi fr it lt ru th uk"
58
61
GETTEXT_PACKAGE=gpredict
59
62
AC_SUBST(GETTEXT_PACKAGE)
63
66
                   "definition of GETTEXT_PACKAGE")
64
67
 
65
68
 
66
 
dnl compiler flags to enable generating coverage report
67
 
dnl using gcov
 
69
# compiler flags to enable generating coverage report
 
70
# using gcov
68
71
AC_ARG_ENABLE(coverage, [  --enable-coverage       enable coverge reports],enable_coerage=yes,enable_coverage=no)
69
72
if test "$enable_coverage" = yes ; then
70
73
        CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage";
75
78
AM_CONDITIONAL(UPDATE_CACHES, test x"$enable_caches" = "xyes")
76
79
 
77
80
 
78
 
 
79
 
 
80
81
GLIB_V=`pkg-config --modversion glib-2.0`
81
82
GIO_V=`pkg-config --modversion gio-2.0`
82
83
GTHR_V=`pkg-config --modversion gthread-2.0`
87
88
if test "$havelibgps" = true ; then
88
89
   GPS_V=`pkg-config --modversion libgps`
89
90
fi
90
 
dnl SQL_V=`pkg-config --modversion sqlite3`
91
 
dnl if test "$havehamlib" = true ; then
92
 
dnl    HAML_V=`pkg-config --modversion hamlib`
93
 
dnl fi
94
91
 
95
92
 
96
93
AC_SUBST(CFLAGS)
129
126
if test "$havelibgps" = true ; then
130
127
   echo Libgps version..... : $GPS_V
131
128
fi
132
 
dnl echo SQLite version..... : $SQL_V
133
 
dnl if test "$havehamlib" = true ; then
134
 
dnl echo Hamlib version..... : $HAML_V
135
 
dnl else
136
 
dnl echo Hamlib version..... : none
137
 
dnl fi
138
 
dnl echo Enable coverage.... : $enable_coverage
139
 
dnl echo
 
129
# echo Enable coverage.... : $enable_coverage
 
130
# echo
140
131