-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
74 lines (59 loc) · 2.35 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT(Calcelestial, 0.5, https://github.com/stv0g/calcelestial/issues, calcelestial, https://github.com/stv0g/calcelestial)
AC_CONFIG_SRCDIR([src/calcelestial.c])
AC_CONFIG_HEADERS([config.h])
# Extra args
AC_ARG_ENABLE(
[geonames],
[AS_HELP_STRING([--enable-geonames], [enable support geonames.org geocoding (def=yes)])],
[enable_geonames=$enableval],
[enable_geonames=yes]
)
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING([--enable-debug], [enable debug data generation (def=no)])],
[debug=$enableval],
[debug=no]
)
AM_CONDITIONAL([GEONAMES_SUPPORT], [test x"$enable_geonames" = x"yes"])
if test x"$enable_geonames" = x"yes"; then
AC_DEFINE([GEONAMES_SUPPORT], [1], [compile with geonames.org lookup capabilities])
PKG_CHECK_MODULES([DEPS_GEONAMES], [libcurl >= 7.21, json-c >= 0.11])
fi
if test x"$debug" = x"yes"; then
AC_DEFINE([DEBUG], [], [enable debugging])
AM_CFLAGS="$AM_CFLAGS -g -Wall -Werror -Wno-uninitialized -O0 -fno-omit-frame-pointer"
else
AM_CFLAGS="$AM_CFLAGS -O3"
fi
# Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
# Checks for libraries.
AC_CHECK_LIB([nova],[ln_get_version],[],[AC_MSG_ERROR([Couldn't find libnova])])
if test x"$enable_geonames" = x"yes"; then
AC_CHECK_LIB([curl],[curl_version],[],[AC_MSG_ERROR([Couldn't find libcurl])])
AC_CHECK_LIB([json-c],[json_c_version],[],[AC_MSG_ERROR([Couldn't find libjson-c library])])
AC_CHECK_LIB([db],[db_create],[],[AC_MSG_ERROR([Couldn't find libdb])])
fi
# Checks for header files.
AC_CHECK_HEADERS([libnova/libnova.h],[],[AC_MSG_ERROR([Couldn't find or include libnova headers])])
if test x"$enable_geonames" = x"yes"; then
AC_CHECK_HEADERS([curl/curl.h],[],[AC_MSG_ERROR([Couldn't find or include libcurl headers])])
AC_CHECK_HEADERS([json-c/json.h],[],[AC_MSG_ERROR([Couldn't find libjson-c headers])])
AC_CHECK_HEADERS([db.h],[],[AC_MSG_ERROR([Couldn't find libdb headers])])
fi
# Automake
AM_INIT_AUTOMAKE([foreign])
AM_PROG_CC_C_O
# Conditionals
AM_CONDITIONAL([WITH_GEONAMES], [test x"$enable_geonames" = x"yes"])
AM_CONDITIONAL([DEBUG], [test x"$enable_debug" = x"yes"])
AM_CONDITIONAL([HAS_JSONC], [test x"$has_lib_jsonc" = x"yes"])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT