forked from postgis/postgis
/
configure.in
104 lines (89 loc) · 2.23 KB
/
configure.in
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
94
95
96
97
98
99
100
101
102
103
104
AC_INIT(README.postgis)
AC_ARG_ENABLE(autoconf, [ --enable-autoconf really use autoconf],
AC_MSG_RESULT(Using autoconf),
AC_MSG_ERROR([
Autoconf-based configuration is not widely tested.
If you want to use it anyway specify --enable-autoconf.
])
)
AC_SUBST(USE_GEOS)
AC_SUBST(GEOS_DIR)
if test -z "$USE_GEOS"; then
USE_GEOS=0
fi
if test -z "$GEOS_DIR"; then
GEOS_DIR=/usr/local
fi
AC_ARG_WITH(geos,
[ --with-geos[[=DIR]] enable spatial predicate and operator support],
if test "$with_geos" != "no"; then
USE_GEOS=1
if test "$with_geos" != "yes"; then
GEOS_DIR=$with_geos
else
GEOS_DIR=`geos-config --prefix`
fi
fi
)
AC_SUBST(USE_PROJ)
AC_SUBST(PROJ_DIR)
if test -z "$USE_PROJ"; then
USE_PROJ=0
fi
if test -z "$PROJ_DIR"; then
PROJ_DIR=/usr/local
fi
AC_ARG_WITH(proj,
[ --with-proj[[=DIR]] enable reprojection support],
if test "$with_proj" != "no"; then
USE_PROJ=1
if test "$with_proj" != "yes"; then
PROJ_DIR=$with_proj
fi
fi
)
AC_SUBST(PGSQL_SRC)
if test -z "$PGSQL_SRC"; then
PGSQL_SRC=${PWD}/../..
fi
AC_ARG_WITH(pgsql-src,
[ --with-pgsql-src=DIR where to find pgsql sources],
if test -d "$with_pgsql_src"; then
PGSQL_SRC=$with_pgsql_src
else
AC_MSG_RESULT(*--> $with_pgsql_src is not a directory)
fi
)
dnl Search flex and yacc
AC_SUBST(FLEX)
AC_SUBST(YACC)
AC_PATH_PROG([FLEX], [flex])
AC_PATH_PROG([YACC], [yacc])
dnl Some final checks
if test $USE_GEOS -gt 0 -a ! -e $GEOS_DIR/bin/geos-config; then
AC_MSG_ERROR(Can't find $GEOS_DIR/bin/geos-config);
fi
if test $USE_PROJ -gt 0 -a ! -e $PROJ_DIR/include/projects.h; then
AC_MSG_ERROR(Can't find $PROJ_DIR/include/projects.h);
fi
if ! test -e $PGSQL_SRC/src/Makefile.global; then
AC_MSG_ERROR(Can't find $PGSQL_SRC/src/Makefile.global);
fi
if test -z "$FLEX"; then
AC_MSG_ERROR(Can't find 'flex');
fi
if test -z "$YACC"; then
AC_MSG_ERROR(Can't find 'yacc');
fi
AC_MSG_RESULT([ USE_GEOS=$USE_GEOS])
if test $USE_GEOS -gt 0; then
AC_MSG_RESULT([ GEOS_DIR=$GEOS_DIR])
fi
AC_MSG_RESULT([ USE_PROJ=$USE_PROJ])
if test $USE_PROJ -gt 0; then
AC_MSG_RESULT([ PROJ_DIR=$PROJ_DIR])
fi
AC_MSG_RESULT([ PGSQL_SRC=$PGSQL_SRC])
AC_MSG_RESULT([ FLEX=$FLEX])
AC_MSG_RESULT([ YACC=$YACC])
AC_OUTPUT(Makefile.config)