~ubuntu-branches/ubuntu/trusty/liblas/trusty-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2014-01-05 17:00:29 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140105170029-ddtp0j63x5jvck2u
Tags: 1.7.0+dfsg-2
Fixed missing linking of system boost component.
(closes: #733282)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl $Id$
2
 
dnl
3
 
dnl This is main autoconf bootstrap script of libLAS project.
4
 
dnl
5
 
m4_define([liblas_version_major], [1])
6
 
m4_define([liblas_version_minor], [2])
7
 
m4_define([liblas_version_micro], [1])
8
 
m4_define([liblas_version],
9
 
          [liblas_version_major.liblas_version_minor.liblas_version_micro])
10
 
 
11
 
AC_PREREQ([2.59])
12
 
AC_INIT([las], [liblas_version], [hobu.inc@gmail.com],[liblas-src])
13
 
AC_CANONICAL_BUILD
14
 
 
15
 
RELEASE_VERSION=liblas_version
16
 
AC_SUBST([RELEASE_VERSION])
17
 
 
18
 
dnl #########################################################################
19
 
dnl Default compilation flags
20
 
dnl #########################################################################
21
 
 
22
 
m4_define([debug_default],[no])
23
 
 
24
 
CFLAGS="-Wall -Wno-long-long -pedantic $CFLAGS"
25
 
CXXFLAGS="-Wall -Wno-long-long -pedantic -std=c++98 $CXXFLAGS"
26
 
 
27
 
dnl #########################################################################
28
 
dnl Checks for programs.
29
 
dnl #########################################################################
30
 
 
31
 
AM_INIT_AUTOMAKE([dist-bzip2])
32
 
AC_PROG_CXX
33
 
AC_PROG_CXXCPP
34
 
AC_PROG_INSTALL
35
 
AC_PROG_LN_S
36
 
AC_PROG_MAKE_SET
37
 
AC_PROG_LIBTOOL
38
 
 
39
 
dnl #########################################################################
40
 
dnl Check platform endianness
41
 
dnl #########################################################################
42
 
 
43
 
AC_C_BIGENDIAN
44
 
 
45
 
dnl #########################################################################
46
 
dnl Checks for header files.
47
 
dnl #########################################################################
48
 
 
49
 
AC_CHECK_HEADERS([string.h],, [AC_MSG_ERROR([cannot find string.h, bailing out])])
50
 
AC_CHECK_HEADERS([stdio.h],, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
51
 
AC_CHECK_HEADERS([stdlib.h],, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
52
 
 
53
 
 
54
 
LIBS="${LIBS}"
55
 
 
56
 
 
57
 
dnl #########################################################################
58
 
dnl Build mode configuration (debug/optimized)
59
 
dnl #########################################################################
60
 
 
61
 
AC_ARG_ENABLE([debug],
62
 
     AC_HELP_STRING([--enable-debug=ARG], [Enable debug compilation mode @<:@yes|no@:>@, default=debug_default]),,)
63
 
     
64
 
AC_MSG_CHECKING([for debug enabled])
65
 
 
66
 
if test "x$enable_debug" = "xyes"; then
67
 
    CFLAGS="$CFLAGS -g -DDEBUG"
68
 
    CXXFLAGS="$CXXFLAGS -g -DDEBUG"
69
 
    AC_MSG_RESULT(yes)
70
 
else
71
 
    CFLAGS="$CFLAGS -O3 -DNDEBUG"
72
 
    CXXFLAGS="$CXXFLAGS -O3 -DNDEBUG"
73
 
    AC_MSG_RESULT(no)
74
 
fi
75
 
 
76
 
dnl #########################################################################
77
 
dnl Definition of custom Autoconf macros
78
 
dnl #########################################################################
79
 
 
80
 
AC_DEFUN([LOC_MSG],[
81
 
echo "$1"
82
 
])
83
 
 
84
 
AC_DEFUN([AC_HAVE_LONG_LONG],
85
 
[
86
 
    AC_MSG_CHECKING([for 64bit integer type])
87
 
 
88
 
    echo 'int main() { long long off=0; }' >> conftest.c
89
 
    if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then
90
 
        AC_DEFINE(HAVE_LONG_LONG, 1, [Define to 1, if your compiler supports long long data type])
91
 
        AC_MSG_RESULT([long long])
92
 
    else
93
 
        AC_MSG_RESULT([no])
94
 
    fi
95
 
    rm -f conftest*
96
 
])
97
 
 
98
 
 
99
 
 
100
 
HAVE_GDAL="no"
101
 
GDAL_CONFIG="no"
102
 
HAVE_GEOTIFF="no"
103
 
GEOTIFF_CONFIG="no"
104
 
 
105
 
USE_GDAL_SOURCE_TREE="no"
106
 
 
107
 
dnl #########################################################################
108
 
dnl Determine GDAL Support
109
 
dnl #########################################################################
110
 
 
111
 
AC_ARG_WITH([gdal],
112
 
    AC_HELP_STRING([--with-gdal=ARG], [Path to gdal-config]),,)
113
 
AC_MSG_CHECKING([for GDAL])
114
 
 
115
 
if test "$with_gdal" = "no" -o "$with_gdal" = "" ; then
116
 
    AC_MSG_RESULT([no])
117
 
else
118
 
 
119
 
    dnl Check if full path to gdal-config provided
120
 
    if test "`basename xx/$with_gdal`" = "gdal-config" ; then
121
 
        AC_MSG_RESULT([GDAL enabled with provided gdal-config])
122
 
        GDAL_CONFIG="$with_gdal"
123
 
    elif test -f ${with_gdal}/frmts/gtiff/libgeotiff/geotiff.h; then
124
 
        GDAL_INC="-I$with_gdal/port -I$with_gdal/ogr -I$with_gdal/alg -I$with_gdal/frmts"
125
 
        GDAL_PREFIX="$with_gdal"
126
 
        HAVE_GDAL="yes"
127
 
        HAVE_GEOTIFF="yes"
128
 
        GEOTIFF_CONFIG="yes"
129
 
        GDAL_CONFIG="yes"
130
 
        USE_GDAL_SOURCE_TREE="yes"
131
 
        LIBS="-L${with_gdal}/.libs -lgdal -L${with_gdal}/ -lgdal $LIBS"
132
 
        AC_MSG_RESULT([GDAL and GeoTIFF enabled with provided GDAL source tree])
133
 
    else
134
 
        dnl --with-gdal=yes given, so try to find gdal-config in PATH
135
 
        GDAL_CONFIG_TMP=`which gdal-config`
136
 
        if test "`basename xx/${GDAL_CONFIG_TMP}`" = "gdal-config" ; then
137
 
            AC_MSG_RESULT([GDAL enabled with gdal-config found in PATH])
138
 
            GDAL_CONFIG=${GDAL_CONFIG_TMP}
139
 
        else
140
 
            AC_MSG_ERROR([--with-gdal should be yes, a path to gdal-config, or a path to GDAL's source tree])
141
 
        fi
142
 
    fi
143
 
fi
144
 
 
145
 
if test "$GDAL_CONFIG" != "no" ; then
146
 
 
147
 
dnl if we are already yes, we don't need to run gdal-config
148
 
  if test "$GDAL_CONFIG" != "yes" ; then
149
 
 
150
 
    GDAL_VERSION=`$GDAL_CONFIG --version`
151
 
    AC_MSG_RESULT([$GDAL_CONFIG reports version $GDAL_VERSION])
152
 
    LIBS="`$GDAL_CONFIG --libs` $LIBS"
153
 
    GDAL_INC=`$GDAL_CONFIG --cflags`
154
 
    GDAL_PREFIX=`$GDAL_CONFIG --prefix`
155
 
    OGR=`$GDAL_CONFIG --ogr-enabled`
156
 
    if test "$OGR" != "yes" ; then
157
 
        AC_MSG_ERROR([$GDAL_CONFIG says OGR is not enabled])
158
 
    fi
159
 
    HAVE_GDAL="yes"
160
 
  fi
161
 
fi
162
 
 
163
 
AC_SUBST([GDAL_INC])
164
 
AC_SUBST([GDAL_PREFIX])
165
 
AM_CONDITIONAL([GDAL_IS_CONFIG], [test ! x$GDAL_CONFIG = xno])
166
 
 
167
 
dnl #########################################################################
168
 
dnl Determine GeoTIFF Support
169
 
dnl #########################################################################
170
 
 
171
 
AC_ARG_WITH([geotiff],
172
 
    AC_HELP_STRING([--with-geotiff=ARG], [libgeotiff library to use (no or path)]),,)
173
 
 
174
 
if test "$with_geotiff" != "no" -a "$with_geotiff" != "" -a "${GEOTIFF_CONFIG}" != "yes" ; then
175
 
    dnl We now require libgeotiff 1.2.5 (for ST_Create the simpletags stuff). 
176
 
    dnl first check if $with_geotiff/lib has the library:
177
 
    AC_CHECK_LIB([geotiff], [ST_Create],
178
 
                 [GEOTIFF_CONFIG=external], [GEOTIFF_CONFIG=no],
179
 
                 [-L$with_geotiff/lib])
180
 
fi
181
 
 
182
 
if test "${GEOTIFF_CONFIG}" != "no" ; then
183
 
    dnl libgeotiff 1.2.5, is first version with geo_simpletags.h
184
 
    AC_MSG_CHECKING([for geo_simpletags.h of libgeotiff >= 1.2.5])
185
 
    if test -f ${with_geotiff}/include/geo_simpletags.h ; then
186
 
        GEOTIFF_INC="-I$with_geotiff/include"
187
 
    AC_MSG_RESULT([yes])
188
 
    elif test -f ${with_geotiff}/include/geotiff/geo_simpletags.h ; then
189
 
        GEOTIFF_INC="-I$with_geotiff/include/geotiff"
190
 
    AC_MSG_RESULT([yes])
191
 
    elif test -f ${with_gdal}/frmts/gtiff/libgeotiff/geo_simpletags.h ; then
192
 
        GEOTIFF_INC="-I$with_gdal/frmts/gtiff/libgeotiff/ -I$with_gdal/frmts/gtiff/libtiff"
193
 
    AC_MSG_RESULT([yes, from GDAL]) 
194
 
    else
195
 
        GEOTIFF_CONFIG="no"
196
 
    AC_MSG_RESULT([no])
197
 
    fi
198
 
fi
199
 
    
200
 
AC_MSG_CHECKING([for libgeotiff])
201
 
if test "${GEOTIFF_CONFIG}" = "no" ; then
202
 
    HAVE_GEOTIFF="no"
203
 
    AC_MSG_RESULT([no])
204
 
else
205
 
    if test "${USE_GDAL_SOURCE_TREE}" != "yes" ; then
206
 
        LIBS="-L$with_geotiff/lib -lgeotiff $LIBS"
207
 
        HAVE_GEOTIFF="yes"
208
 
        AC_MSG_RESULT([yes])
209
 
    else
210
 
        AC_MSG_RESULT([use GDAL source])
211
 
    fi
212
 
fi
213
 
 
214
 
AC_SUBST([GEOTIFF_INC])
215
 
AC_SUBST([GEOTIFF_PREFIX])
216
 
AM_CONDITIONAL([GEOTIFF_IS_CONFIG], [test ! x$GEOTIFF_CONFIG = xno])
217
 
 
218
 
dnl #########################################################################
219
 
dnl If GDAL was requested, but geotiff is not configured, complain
220
 
dnl #########################################################################
221
 
 
222
 
if test "${HAVE_GDAL}" != "no" ; then
223
 
        if test "${GEOTIFF_CONFIG}" = "no" -a "${USE_GDAL_SOURCE_TREE}" != "yes"; then
224
 
                AC_MSG_ERROR([You must configure a libgeotiff if you are using GDAL binaries.  You can configure using a GDAL source tree without libgeotiff, but not from binaries.])
225
 
        fi
226
 
fi
227
 
 
228
 
dnl #########################################################################
229
 
dnl Determine other features of compiler
230
 
dnl #########################################################################
231
 
 
232
 
AC_HAVE_LONG_LONG
233
 
 
234
 
dnl #########################################################################
235
 
dnl Checks for library functions.
236
 
dnl #########################################################################
237
 
 
238
 
AC_CHECK_FUNCS([gettimeofday bzero memset memcpy bcopy])
239
 
 
240
 
dnl #########################################################################
241
 
dnl Generate makefiles
242
 
dnl #########################################################################
243
 
 
244
 
AC_CONFIG_FILES([
245
 
    Makefile
246
 
    include/Makefile
247
 
    src/Makefile
248
 
    apps/Makefile
249
 
    apps/liblas-config
250
 
    test/Makefile
251
 
    test/unit/Makefile
252
 
])
253
 
 
254
 
AC_OUTPUT
255
 
 
256
 
dnl #########################################################################
257
 
dnl Print configuration summary
258
 
dnl #########################################################################
259
 
 
260
 
LOC_MSG()
261
 
LOC_MSG([libLAS configuration summary:])
262
 
LOC_MSG()
263
 
LOC_MSG([  Version..................: ${RELEASE_VERSION}])
264
 
LOC_MSG([  Installation directory...: ${prefix}])
265
 
LOC_MSG([  C compiler...............: ${CC} ${CFLAGS}])
266
 
LOC_MSG([  C++ compiler.............: ${CXX} ${CXXFLAGS}])
267
 
LOC_MSG([  Debugging support........: ${enable_debug}])
268
 
LOC_MSG([  GDAL support.............: ${HAVE_GDAL}])
269
 
if test "${HAVE_GDAL}" != "no" ; then
270
 
    LOC_MSG([   - gdal-config...........: ${GDAL_CONFIG}])
271
 
    if test -n "${GDAL_INC}" ; then
272
 
        LOC_MSG([   - INCLUDE directories...: ${GDAL_INC}])
273
 
    fi
274
 
fi
275
 
LOC_MSG([  GeoTIFF SRS support......: ${HAVE_GEOTIFF}])
276
 
if test "${HAVE_GEOTIFF}" != "no" ; then
277
 
    LOC_MSG([   - libgeotiff............: ${GEOTIFF_CONFIG}])
278
 
    if test -n "${GEOTIFF_INC}" ; then
279
 
        LOC_MSG([   - INCLUDE directories...: ${GEOTIFF_INC}])
280
 
    fi
281
 
fi
282
 
LOC_MSG()
283
 
LOC_MSG([  LIBS.....................: ${LIBS}])
284
 
LOC_MSG()
285
 
LOC_MSG([  libLAS - http://liblas.org])
286
 
LOC_MSG()
287
 
 
288
 
dnl EOF