-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
49 lines (39 loc) · 1.47 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(IMPERIAL, 1.0, [email protected])
AC_CONFIG_SRCDIR([src])
AM_INIT_AUTOMAKE()
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
# Get required Proj.4 library and include locations
AC_ARG_WITH([proj4-include-path],
[AS_HELP_STRING([--with-proj4-include-path],
[location of the Proj.4 headers])],
[PROJ4_INCL="-I$withval"],
[PROJ4_INCL=""])
AC_ARG_WITH([proj4-lib-path],
[AS_HELP_STRING([--with-proj4-lib-path], [location of the Proj.4 libraries])],
[PROJ4_LIB="-L$withval -lproj -pthread"],
[PROJ4_LIB="-lproj -pthread"])
# Check required PROJ4 installation
CFLAGS="$PROJ4_INCL $CHECK_CFLAGS"
LDFLAGS="$CHECK_LDFLAGS $PROJ4_LIB"
AC_CHECK_LIB(proj, pj_init_plus, [AC_CHECK_HEADER([proj_api.h], [], [AC_MSG_ERROR([Proj4 header not found in $PROJ4_INCL; use --with-proj4-include-path"])
], [AC_INCLUDES_DEFAULT])],[AC_MSG_ERROR(["Proj4 library not found; use --with-proj4-lib-path"])], [-pthread -lm])
# Set final CFLAGS and LDFLAGS
CFLAGS="$CHECK_CFLAGS $ETREE_INCL $PROJ4_INCL"
LDFLAGS="$CHECK_LDFLAGS $ETREE_LIB $PROJ4_LIB"
LDFLAGS="$LDFLAGS -lm"
AC_CONFIG_FILES([Makefile
data/Makefile
src/Makefile
tests/Makefile])
AC_OUTPUT