source: branches/prototype-v0/zoo-project/zoo-kernel/configure.ac @ 822

Last change on this file since 822 was 822, checked in by djay, 7 years ago

Commit the minimal requirements for remote HPC support

File size: 35.4 KB
Line 
1AC_INIT([ZOO Kernel], [1.7.0], [bugs@zoo-project.org])
2
3AC_CONFIG_MACRO_DIR([macros])
4
5# Checks for programs.
6AC_PROG_YACC
7AC_PROG_CC
8AC_PROG_LEX
9AC_PROG_CXX
10AC_PROG_SED
11
12# Checks for libraries.
13AC_CHECK_LIB([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform])
14AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose])
15AC_CHECK_LIB([crypto], [EVP_DigestInit,EVP_md5,EVP_DigestUpdate,BIO_f_base64,BIO_new])
16
17DEFAULT_LIBS="$LIBS"
18AC_SUBST([DEFAULT_LIBS])
19
20
21# Checks for header files.
22AC_FUNC_ALLOCA
23AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h stddef.h stdlib.h string.h unistd.h])
24
25# Checks for typedefs, structures, and compiler characteristics.
26AC_HEADER_STDBOOL
27AC_TYPE_INT16_T
28AC_TYPE_INT32_T
29AC_TYPE_INT8_T
30AC_TYPE_PID_T
31AC_TYPE_SIZE_T
32AC_TYPE_UINT16_T
33AC_TYPE_UINT32_T
34AC_TYPE_UINT8_T
35
36# Checks for library functions.
37AC_FUNC_FORK
38AC_FUNC_MALLOC
39AC_FUNC_REALLOC
40AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr])
41
42#============================================================================
43# Detect if uuid is available
44#============================================================================
45
46AC_ARG_WITH([uuid],
47    [AS_HELP_STRING([--with-uuid=PATH], [Specifies an alternative location for the ossp-uuid library])],
48    [UUID_DIR="$withval"], [UUID_DIR="/usr/"])
49UUID_CFLAGS="-I$UUID_DIR/include"
50UUID_LDFLAGS="-L$UUID_DIR/lib -luuid"
51CPPFLAGS_SAVE="$CPPFLAGS"
52CPPFLAGS="$UUID_CFLAGS"
53LIBS_SAVE="$LIBS"
54LIBS="$UUID_LDFLAGS"
55AC_CHECK_HEADERS([uuid/uuid.h],
56                        [], [AC_MSG_ERROR([could not find header file uuid.h])])
57AC_CHECK_LIB([uuid], [uuid_generate_time],
58                        [], [AC_MSG_ERROR([could not find function in uuid library])])
59CPPFLAGS="$CPPFLAGS_SAVE"
60AC_SUBST([UUID_CFLAGS])
61AC_SUBST([UUID_LDFLAGS])
62
63#============================================================================
64# Detect if openssl is available
65#============================================================================
66
67AC_ARG_WITH([openssl],
68    [AS_HELP_STRING([--with-openssl=PATH], [Specifies an alternative location for the openssl library])],
69    [OPENSSL_DIR="$withval"], [OPENSSL_DIR="/usr/"])
70OPENSSL_CFLAGS="-I$OPENSSL_DIR/include"
71OPENSSL_LDFLAGS="-lcrypto -L$OPENSSL_DIR/lib -lssl"
72CPPFLAGS_SAVE="$CPPFLAGS"
73CPPFLAGS="$OPENSSL_CFLAGS"
74LIBS_SAVE="$LIBS"
75LIBS="$OPENSSL_LDFLAGS"
76AC_CHECK_HEADERS([openssl/md5.h openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h],
77                        [], [AC_MSG_ERROR([could not find header file $i related to openssl])])
78AC_CHECK_LIB(crypto, BIO_f_base64,
79                        [], [AC_MSG_ERROR([could not find $i function in openssl library])])
80CPPFLAGS="$CPPFLAGS_SAVE"
81AC_SUBST([OPENSSL_CFLAGS])
82AC_SUBST([OPENSSL_LDFLAGS])
83
84#============================================================================
85# Detect if gettext is available
86#============================================================================
87
88AC_ARG_WITH([gettext],
89    [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],
90    [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])
91GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"
92GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"
93CFLAGS_SAVE="$CFLAGS"
94CFLAGS="$GETTEXT_CFLAGS"
95LIBS_SAVE="$LIBS"
96LIBS="$GETTEXT_LDFLAGS"
97AM_GNU_GETTEXT([external], [], [])
98AC_CHECK_LIB(intl,
99                        [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])])
100AC_SUBST([GETTEXT_CFLAGS])
101AC_SUBST([GETTEXT_LDFLAGS])
102
103#============================================================================
104# Detect if run on debian / ubuntu
105#============================================================================
106if test -f "/usr/bin/dpkg"
107then
108        DEB_DEF=-DDEB
109fi
110AC_SUBST([DEB_DEF])
111
112AC_ARG_WITH([etc-dir],
113    [AS_HELP_STRING([--with-etc-dir=PATH], [Specifies an alternative path to store the main.cfg file ( default: ZOO-Kernel location) ])],
114    [ETC_DEF="#define ETC_DIR \\\"${sysconfdir}\\\""], [ETC_DEF=""])
115AC_SUBST([ETC_DEF])
116
117AC_ARG_WITH([cgi-dir],
118    [AS_HELP_STRING([--with-cgi-dir=PATH], [Specifies an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])],
119    [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"])
120AC_SUBST([CGI_DIR])
121
122AC_ARG_WITH([db-backend],
123    [AS_HELP_STRING([--with-db-backend], [Relies on a database for storing status messages and response files ])],
124    [RELY_ON_DB="-DRELY_ON_DB"], [RELY_ON_DB=""])
125AC_SUBST([RELY_ON_DB])
126
127
128# ===========================================================================
129# Detect if libyaml is available
130# ===========================================================================
131
132AC_ARG_WITH([yaml],
133        [AS_HELP_STRING([--with-yaml=PATH], [Specifies an alternative location for the yaml library])],
134        [YAMLPATH="$withval"], [YAMLPATH=""])
135
136if test -z "$YAMLPATH"
137then
138        YAML_LDFLAGS=""
139        YAML_CPPFLAGS=""
140        YAML_FILE=""
141        YAML_FILE1=""
142else
143
144        # Extract the linker and include flags
145        YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
146        YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
147        YAML_FILE="service_yaml.o"
148        YAML_FILE1="zcfg2yaml"
149       
150        # Check headers file
151        CPPFLAGS_SAVE="$CPPFLAGS"
152        CPPFLAGS="$YAML_CPPFLAGS"
153        LIBS_SAVE="$LIBS"
154        LIBS="$YAML_LDFLAGS"
155        AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
156        AC_CHECK_HEADERS([yaml.h],
157                 [], [AC_MSG_ERROR([could not find headers include related to YAML])])
158        LIBS="$LIBS_SAVE"
159fi
160AC_SUBST([YAML_CPPFLAGS])
161AC_SUBST([YAML_LDFLAGS])
162AC_SUBST([YAML_FILE])
163AC_SUBST([YAML_FILE1])
164
165# ===========================================================================
166# Detect if fastcgi is available
167# ===========================================================================
168
169AC_ARG_WITH([fastcgi],
170        [AS_HELP_STRING([--with-fastcgi=PATH], [Specifies an alternative location for the fastcgi library])],
171        [FCGIPATH="$withval"], [FCGIPATH="/usr"])
172
173# Extract the linker and include flags
174FCGI_LDFLAGS="-L$FCGIPATH/lib -lfcgi"
175FCGI_CPPFLAGS="-I$FCGIPATH/include"
176
177# Check headers file
178CPPFLAGS_SAVE="$CPPFLAGS"
179CPPFLAGS="$FCGI_CPPFLAGS"
180LIBS_SAVE="$LIBS"
181LIBS="$FCGI_LDFLAGS"
182AC_CHECK_LIB([fcgi], [main])
183AC_CHECK_HEADERS([fcgi_stdio.h],
184                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
185LIBS="$LIBS_SAVE"
186AC_SUBST([FCGI_CPPFLAGS])
187AC_SUBST([FCGI_LDFLAGS])
188
189AC_ARG_WITH([metadb],
190        [AS_HELP_STRING([--with-metadb=yes], [Activates the metadata database support])],
191        [WITHMETADB="$withval"], [WITHMETADB=""])
192
193if test "x$WITHMETADB" = "xyes"; then
194        METADB="-DMETA_DB"
195        METADB_FILE="meta_sql.o sqlapi.o"
196else
197        METADB=""
198        METADB_FILE=""
199fi
200
201AC_SUBST([METADB])
202AC_SUBST([METADB_FILE])
203
204AC_ARG_WITH([hpc],
205        [AS_HELP_STRING([--with-hpc=yes], [Specifies if you need to activate HPC support])],
206        [HPCWITH="$withval"], [HPCWITH="no"])
207
208if test "x$HPCWITH" = "xyes"; then
209        HPC_FILES="service_internal_hpc.o sshapi.o"
210        HPC_ENABLED="-DUSE_HPC"
211        HPC_CPPFLAGS=""
212        HPC_LDFLAGS=""
213fi
214
215AC_SUBST([HPC_CPPFLAGS])
216AC_SUBST([HPC_LDFLAGS])
217AC_SUBST([HPC_ENABLED])
218AC_SUBST([HPC_FILES])
219
220AC_ARG_WITH([ssh2],
221        [AS_HELP_STRING([--with-ssh2=PATH], [Specifies an alternative location for the ssh2 library])],
222        [SSH2PATH="$withval"], [SSH2PATH="/usr"])
223
224# Extract the linker and include flags
225SSH2_LDFLAGS="-L$SSH2PATH/lib -lssh2"
226SSH2_CPPFLAGS="-I$SSH2PATH/include"
227# Check headers file
228CPPFLAGS_SAVE="$CPPFLAGS"
229CPPFLAGS="$SSH2_CPPFLAGS"
230LIBS_SAVE="$LIBS"
231LIBS="$SSH2_LDFLAGS"
232echo $CPPFLAGS
233echo $LIBS
234
235AC_CHECK_HEADERS([libssh2.h],
236                 [], [AC_MSG_ERROR([could not find headers related to libssh2])])
237AC_CHECK_LIB([ssh2], [libssh2_session_init])
238
239LIBS="$LIBS_SAVE"
240AC_SUBST([SSH2_CPPFLAGS])
241AC_SUBST([SSH2_LDFLAGS])
242
243# ===========================================================================
244# Detect if libxml2 is installed
245# ===========================================================================
246
247AC_ARG_WITH([xml2config],
248        [AS_HELP_STRING([--with-xml2config=FILE], [Specifies an alternative xml2-config file])],
249        [XML2CONFIG="$withval"], [XML2CONFIG=""])
250
251if test "x$XML2CONFIG" = "x"; then
252        # XML2CONFIG was not specified, so search within the current path
253        AC_PATH_PROG([XML2CONFIG], [xml2-config])
254
255        # If we couldn't find xml2-config, display a warning
256        if test "x$XML2CONFIG" = "x"; then
257                AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
258        fi
259else
260        # XML2CONFIG was specified; display a message to the user
261        if test "x$XML2CONFIG" = "xyes"; then
262                AC_MSG_ERROR([you must Specifies a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
263        else
264                if test -f $XML2CONFIG; then
265                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
266                else
267                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
268                fi     
269        fi
270fi
271
272# Extract the linker and include flags
273XML2_LDFLAGS=`$XML2CONFIG --libs`
274XML2_CPPFLAGS=`$XML2CONFIG --cflags`
275
276# Check headers file
277CPPFLAGS_SAVE="$CPPFLAGS"
278CPPFLAGS="$XML2_CPPFLAGS"
279AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
280                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
281
282# Ensure we can link against libxml2
283LIBS_SAVE="$LIBS"
284LIBS="$XML2_LDFLAGS"
285AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
286
287AC_SUBST([XML2_CPPFLAGS])
288AC_SUBST([XML2_LDFLAGS])
289LIBS="$LIBS_SAVE"
290
291
292# ===========================================================================
293# Detect if libxslt is installed
294# ===========================================================================
295
296AC_ARG_WITH([xsltconfig],
297        [AS_HELP_STRING([--with-xsltconfig=FILE], [Specifies an alternative xslt-config file])],
298        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
299
300if test "x$XSLTCONFIG" = "x"; then
301        # XSLTCONFIG was not specified, so search within the current path
302        AC_PATH_PROG([XSLTCONFIG], [xslt-config])
303
304        # If we couldn't find xslt-config, display a warning
305        if test "x$XSLTCONFIG" = "x"; then
306                AC_MSG_ERROR([could not find xslt-config from libxslt within the current path. You may need to try re-running configure with a --with-xtltconfig parameter.])
307        fi
308else
309        # XSLTCONFIG was specified; display a message to the user
310        if test "x$XSLTCONFIG" = "xyes"; then
311                AC_MSG_ERROR([you must Specifies a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
312        else
313                if test -f $XSLTCONFIG; then
314                        AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
315                else
316                        AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
317                fi     
318        fi
319fi
320
321# Extract the linker and include flags
322XSLT_LDFLAGS=`$XSLTCONFIG --libs`
323XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
324
325# Check headers file
326CPPFLAGS_SAVE="$CPPFLAGS"
327CPPFLAGS="$XSLT_CPPFLAGS"
328AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
329                 [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
330
331AC_SUBST([XSLT_CPPFLAGS])
332AC_SUBST([XSLT_LDFLAGS])
333
334#============================================================================
335# Detect if gdal is installed
336#============================================================================
337
338AC_ARG_WITH([gdal-config],
339        [AS_HELP_STRING([--with-gdal-config=FILE], [Specifies an alternative gdal-config file])],
340        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
341if test -z $GDAL_CONFIG;
342then
343        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
344        if test -z $GDAL_CONFIG;
345        then
346                AC_MSG_ERROR([could not find gdal-config from libgdal within the current path. You may need to try re-running configure with a --with-gdal-config parameter.])
347        fi
348       
349else
350        if test -f $GDAL_CONFIG; then
351                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
352        else
353                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
354        fi
355fi
356
357GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
358GDAL_LIBS="`$GDAL_CONFIG --libs`"
359
360AC_SUBST([GDAL_CFLAGS])
361AC_SUBST([GDAL_LIBS])
362
363# ===========================================================================
364# Detect if proj is installed
365# ===========================================================================
366
367AC_ARG_WITH([proj],
368        [AS_HELP_STRING([--with-proj=PATH], [Specifies an alternative location for PROJ4 setup])],
369        [PROJPATH="$withval"], [PROJPATH=""])
370
371# Extract the linker and include flags
372PROJ_LDFLAGS="-L$PROJPATH/lib"
373PROJ_CPPFLAGS="-I$PROJPATH/include"
374
375# Check headers file
376CPPFLAGS_SAVE="$CPPFLAGS"
377CPPFLAGS="$PROJ_CPPFLAGS"
378AC_CHECK_HEADERS([proj_api.h],
379                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
380
381AC_SUBST([PROJ_CPPFLAGS])
382AC_SUBST([PROJ_LDFLAGS])
383
384# ===========================================================================
385# Detect if libgeos is installed
386# ===========================================================================
387
388AC_ARG_WITH([geosconfig],
389        [AS_HELP_STRING([--with-geosconfig=FILE], [Specifies an alternative geos-config file])],
390        [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
391
392if test "x$GEOSCONFIG" = "x"; then
393        # GEOSCONFIG was not specified, so search within the current path
394        AC_PATH_PROG([GEOSCONFIG], [geos-config])
395
396        # If we couldn't find geos-config, display a warning
397        if test "x$GEOSCONFIG" = "x"; then
398                AC_MSG_WARN([could not find geos-config from libgeos within the current path. You may need to try re-running configure with a --with-geosconfig parameter.])
399        fi
400else
401        # GEOSCONFIG was specified; display a message to the user
402        if test "x$GEOSCONFIG" = "xyes"; then
403                AC_MSG_WARN([you must Specifies a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
404        else
405                if test -f $GEOSCONFIG; then
406                        AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
407                else
408                        AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
409                fi     
410        fi
411fi
412
413GEOS_LDFLAGS=`$GEOSCONFIG --libs`
414GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
415
416# Check headers file
417CPPFLAGS_SAVE="$CPPFLAGS"
418CPPFLAGS="$GEOS_CPPFLAGS"
419AC_CHECK_HEADERS([geos_c.h],
420                 [], [AC_MSG_WARN([could not find headers include related to libgeos])])
421
422AC_SUBST([GEOS_CPPFLAGS])
423AC_SUBST([GEOS_LDFLAGS])
424
425
426# ===========================================================================
427# Detect if cgal is installed
428# ===========================================================================
429
430AC_ARG_WITH([cgal],
431        [AS_HELP_STRING([--with-cgal=PATH], [Specifies an alternative location for CGAL setup])],
432        [CGALPATH="$withval"], [CGALPATH="/usr"])
433
434
435# Check headers file
436CPPFLAGS_SAVE="$CPPFLAGS"
437CGAL_CPPFLAGS="-I$CGALPATH/include"
438CPPFLAGS="$CGAL_CPPFLAGS"
439AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
440         [], [AC_MSG_WARN([could not find headers include related to libCGAL])])
441
442# Extract the linker and include flags
443CGAL_LDFLAGS="-L$CGALPATH/lib"
444CGAL_CPPFLAGS="-I$CGALPATH/include"
445
446
447AC_SUBST([CGAL_CPPFLAGS])
448AC_SUBST([CGAL_LDFLAGS])
449#============================================================================
450# Detect if mapserver is installed
451#============================================================================
452
453AC_ARG_WITH([mapserver],
454       [AS_HELP_STRING([--with-mapserver=PATH], [Specifies the path for MapServer compiled source tree])],
455       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
456
457AC_ARG_WITH([ms-version],
458       [AS_HELP_STRING([--with-ms-version=VERSION], [Specifies the MapServer version to build against])],
459       [MS_VERSION="$withval"], [MS_VERSION=""])
460
461if test -z $MS_SRC_PATH;
462then
463        MS_CPPFLAGS=""
464        MS_LDFLAGS=""
465else
466       if test "x$MS_SRC_PATH" = "xmacos";
467       then
468               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
469               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
470               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
471               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
472       else
473        if test "x$MS_VERSION" = "x7";
474        then
475                MS_LDFLAGS="-L$MS_SRC_PATH/lib -lmapserver"
476                MS_CPPFLAGS="-DUSE_MS -I$MS_SRC_PATH/include/mapserver "
477                AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
478        else
479               if test -d $MS_SRC_PATH; then
480                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
481                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
482               
483                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
484               else
485                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
486               fi
487        fi
488       fi
489       MS_FILE="service_internal_ms.o"
490fi
491
492MS_CFLAGS="$MS_CPPFLAGS"
493MS_LIBS="$MS_LDFLAGS"
494
495AC_SUBST([MS_CFLAGS])
496AC_SUBST([MS_LIBS])
497AC_SUBST([MS_FILE])
498AC_SUBST([MS_VERSION])
499
500# ===========================================================================
501# Detect if python is installed
502# ===========================================================================
503
504AC_ARG_WITH([python],
505        [AS_HELP_STRING([--with-python=PATH], [To enable python support or Specifies an alternative directory for python installation,  disabled by default])],
506        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
507
508AC_ARG_WITH([pyvers],
509        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
510        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
511
512
513if test -z "$PYTHON_ENABLED"
514then
515        PYTHON_FILE=""
516else
517        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
518        PYTHON_FILE="service_internal_python.o"
519        if test  "$PYTHON_PATH" = "yes"
520        then
521                # PYTHON was not specified, so search within the current path
522                PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
523                if test -z "${PYTHONCFG_PATH}" ; then
524                AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}])
525                else
526                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
527                fi
528        else
529                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
530        fi
531
532        # Extract the linker and include flags
533        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
534        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
535
536        # Check headers file
537        CPPFLAGS_SAVE="$CPPFLAGS"
538        CPPFLAGS="$PYTHON_CPPFLAGS"
539        AC_CHECK_HEADERS([Python.h],
540                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
541
542        # Ensure we can link against libphp
543        LIBS_SAVE="$LIBS"
544        LIBS="$PYTHON_LDFLAGS"
545        PY_LIB=`$PYTHONCONFIG --libs | sed \
546                              -e 's/.*\(python[[0-9]]\.[[0-9]]\).*/\1/'`
547        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
548        LIBS="$LIBS_SAVE"
549fi
550
551AC_SUBST([PYTHON_CPPFLAGS])
552AC_SUBST([PYTHON_LDFLAGS])
553AC_SUBST([PYTHON_ENABLED])
554AC_SUBST([PYTHON_FILE])
555
556# ===========================================================================
557# Detect if spidermonkey is installed
558# ===========================================================================
559
560AC_ARG_WITH([js],
561        [AS_HELP_STRING([--with-js=PATH], [Specifies --with-js=path-to-js to enable js support, specify --with-js on linux debian like, js support is disabled by default ])],
562        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
563
564if test -z "$JS_ENABLED"
565then
566        JS_FILE=""
567else
568        JS_FILE="service_internal_js.o"
569        if test "$JSHOME" = "yes"
570        then
571
572                #on teste si on est sous debian like
573                if test -f "/usr/bin/dpkg"
574                then
575                        if test -n "`dpkg -l | grep libmozjs185-dev`"
576                        then
577                                JS_CPPFLAGS="-I/usr/include/js/"
578                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
579                                JS_LIB="mozjs185"
580                        else
581                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
582                                if test -n "$XUL_VERSION"
583                                then
584                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
585                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
586                                        JS_LIB="mozjs"
587                                else
588                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
589                                fi
590                        fi
591                else
592                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
593                fi
594        else
595                JS_CPPFLAGS="-I$JSHOME/include/js/"
596                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
597                JS_LIB="mozjs185"
598
599        fi
600        CPPFLAGS_SAVE="$CPPFLAGS"
601        CPPFLAGS="$JS_CPPFLAGS"
602        AC_LANG_PUSH([C++])
603        AC_CHECK_HEADERS([jsapi.h],
604                        [], [AC_MSG_ERROR([could not find headers include related to libjs])])
605
606        AC_LANG_POP([C++])
607        LIBS_SAVE="$LIBS"
608        LIBS="$JS_LDFLAGS"
609
610        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
611        LIBS="$LIBS_SAVE"
612       
613        AC_SUBST([JS_CPPFLAGS])
614        AC_SUBST([JS_LDFLAGS])
615fi
616
617AC_SUBST([JS_ENABLED])
618AC_SUBST([JS_FILE])
619
620# ===========================================================================
621# Detect if php is installed
622# ===========================================================================
623
624AC_ARG_WITH([php],
625        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
626        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
627
628AC_ARG_WITH([php-version],
629        [AS_HELP_STRING([--with-phpvers=NUM], [To use a specific php version])],
630        [PHP_VERS="$withval"], [PHP_VERS=""])
631
632
633if test -z "$PHP_ENABLED"
634then
635        PHP_FILE=""
636else
637        PHPCONFIG="$PHP_PATH/bin/php-config"
638        if test "x$PHP_VERS" = "x7"
639        then
640                PHP_FILE="service_internal_php7.o"
641        else
642                PHP_FILE="service_internal_php.o"
643        fi
644        if test  "$PHP_PATH" = "yes"
645        then
646                # PHP was not specified, so search within the current path
647                AC_PATH_PROG([PHPCONFIG], [php-config])
648        else
649                PHPCONFIG="$PHP_PATH/bin/php-config"
650        fi
651
652        # Extract the linker and include flags
653        if test "x$PHP_VERS" = "x7"
654        then
655                PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib64 -lphp7"
656        else
657                PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
658        fi
659        PHP_CPPFLAGS=`$PHPCONFIG --includes`
660
661        # Check headers file
662        CPPFLAGS_SAVE="$CPPFLAGS"
663        CPPFLAGS="$PHP_CPPFLAGS"
664        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
665                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
666
667        # Ensure we can link against libphp
668        LIBS_SAVE="$LIBS"
669        LIBS="$PHP_LDFLAGS"
670        # Shouldn't we get php here rather than php5 :) ??
671        if test "x$PHP_VERS" = "x7"
672        then
673                echo $LIBS
674                #AC_CHECK_LIB([php7], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
675        else
676                AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
677        fi
678        LIBS="$LIBS_SAVE"
679        AC_SUBST([PHP_CPPFLAGS])
680        AC_SUBST([PHP_LDFLAGS])
681fi
682
683AC_SUBST([PHP_ENABLED])
684AC_SUBST([PHP_FILE])
685
686# ===========================================================================
687# Detect if java is installed
688# ===========================================================================
689
690AC_ARG_WITH([java],
691        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
692        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
693
694AC_ARG_WITH([java-rpath],
695        [AS_HELP_STRING([--with-java-rpath=yes], [To set rpath for java support, disabled by default])],
696        [JAVA_RPATH="$withval"], [JAVA_RPATH=""])
697
698if test -z "$JAVA_ENABLED"
699then
700        JAVA_FILE=""
701else
702        JAVA_FILE="service_internal_java.o"
703        if test "x$JDKHOME" = "x";
704        then
705                AC_MSG_ERROR([could not find java installation path within the current path. You may need to try re-running configure with a --with-java parameter.])
706        fi      # JAVA was specified; display a message to the user
707        if test "x$JDKHOME" = "xyes";
708        then
709                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
710        fi
711
712        # Extract the linker and include flags
713        if test "x$JDKHOME" = "xmacos";
714        then
715                JAVA_LDFLAGS="-framework JavaVM"
716                for i in `ls /Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/`; do
717                    JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/$i/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
718                done
719        else
720                if test -d "$JDKHOME/jre/lib/i386";
721                then
722                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
723                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
724                        if test x$JAVA_RPATH = "xyes"; then
725                           JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/i386/server/"
726                        fi
727                else
728                        if test -d "$JDKHOME/jre/lib/amd64"; then
729                           JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
730                           JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
731                           if test x$JAVA_RPATH = "xyes"; then
732                              JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/amd64/server/"
733                           fi
734                        else
735                           JAVA_LDFLAGS="-L$JDKHOME/jre/lib/server/ -ljvm -lpthread"
736                           JAVA_CPPFLAGS="-I$JDKHOME/include/ -I$JDKHOME/include/darwin"
737                           if test x$JAVA_RPATH = "xyes"; then
738                              JAVA_LDFLAGS="$JAVA_LDFLAGS -Wl,-rpath,$JDKHOME/jre/lib/server/"
739                           fi
740                        fi
741                fi
742        fi
743
744        AC_LANG([C++])
745        echo $JAVA_CPPFLAGS
746        # Check headers file (second time we check that in fact)
747        CPPFLAGS_SAVE="$CPPFLAGS"
748        CPPFLAGS="$JAVA_CPPFLAGS"
749        AC_CHECK_HEADERS([jni.h],
750                         [], [AC_MSG_ERROR([could not find jni.h file])])
751        CPPFLAGS="$CPPFLAGS_SAVE"
752        # Ensure we can link against libjava
753        LIBS_SAVE="$LIBS"
754        LIBS="$JAVA_LDFLAGS"
755        if test "x$JDKHOME" != "xmacos";
756        then
757                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
758        fi
759        LIBS="$LIBS_SAVE"
760
761        AC_SUBST([JAVA_CPPFLAGS])
762        AC_SUBST([JAVA_LDFLAGS])
763fi
764
765AC_SUBST([JAVA_ENABLED])
766AC_SUBST([JAVA_FILE])
767
768# ===========================================================================
769# Detect if mono is installed
770# ===========================================================================
771
772AC_ARG_WITH([mono],
773        [AS_HELP_STRING([--with-mono=PATH], [To enable mono support, specify the path to find pkg-config,  disabled by default])],
774        [MONOHOME="$withval"; MONO_ENABLED="-DUSE_MONO"], [MONO_ENABLED=""])
775
776if test -z "$MONO_ENABLED"
777then
778        MONO_FILE=""
779else
780        MONO_FILE="service_internal_mono.o"
781        if test "x$MONOHOME" = "x";
782        then
783                MONOHOME="/usr"
784        fi
785        if test "x$MONOHOME" = "xyes";
786        then
787                MONOHOME="/usr"
788        fi
789
790        # Extract the linker and include flags
791        MONO_CFLAGS=`$MONOHOME/bin/pkg-config --cflags mono-2`
792        MONO_LDFLAGS=`$MONOHOME/bin/pkg-config --libs mono-2`
793
794        AC_LANG([C++])
795        echo $JAVA_CPPFLAGS
796        # Check headers file (second time we check that in fact)
797        CPPFLAGS_SAVE="$CFLAGS"
798        CPPFLAGS="$MONO_CFLAGS"
799        AC_CHECK_HEADERS([mono/jit/jit.h],
800                         [], [AC_MSG_ERROR([could not find jit.h file])])
801        CPPFLAGS="$CPPFLAGS_SAVE"
802        # Ensure we can link against libmono-2.0
803        LIBS_SAVE="$LIBS"
804        LIBS="$MONO_LDFLAGS"
805        AC_CHECK_LIB([mono-2.0], [mono_runtime_invoke], [], [AC_MSG_ERROR([could not find libmono])], [])
806        LIBS="$LIBS_SAVE"
807
808        AC_SUBST([MONO_CFLAGS])
809        AC_SUBST([MONO_LDFLAGS])
810fi
811
812AC_SUBST([MONO_ENABLED])
813AC_SUBST([MONO_FILE])
814
815# ===========================================================================
816# Detect if ruby is installed
817# ===========================================================================
818AC_ARG_WITH([ruby],
819        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
820        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
821
822AC_ARG_WITH([rvers],
823        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
824        [RUBY_VERS="$withval"], [RUBY_VERS=""])
825
826
827if test -z "$RUBY_ENABLED"
828then
829        RUBY_FILE=""
830else
831        RUBY_FILE="service_internal_ruby.o"
832
833        # Extract the linker and include flags
834        RUBY_LDFLAGS="-lruby"
835        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
836
837        # Check headers file
838        CPPFLAGS_SAVE="$CPPFLAGS"
839        CPPFLAGS="$RUBY_CPPFLAGS"
840        AC_CHECK_HEADERS([ruby.h],
841                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
842
843        # Ensure we can link against libphp
844        LIBS_SAVE="$LIBS"
845        LIBS="$RUBY_LDFLAGS"
846        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
847        LIBS="$LIBS_SAVE"
848        AC_SUBST([RUBY_CPPFLAGS])
849        AC_SUBST([RUBY_LDFLAGS])
850fi
851
852AC_SUBST([RUBY_ENABLED])
853AC_SUBST([RUBY_FILE])
854
855# ===========================================================================
856# Detect if perl is installed
857# ===========================================================================
858
859AC_ARG_WITH([perl],
860        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
861        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
862
863
864if test -z "$PERL_ENABLED"
865then
866        PERL_FILE=""
867else
868        PERL_FILE="service_internal_perl.o"
869        if test  "$PERL_PATH" = "yes"
870        then
871                # Perl was not specified, so search within the current path
872                AC_PATH_PROG([PERLCONFIG], [perl])
873        else
874                PERLCONFIG="$PERL_PATH/bin/perl"
875        fi
876
877        # Extract the linker and include flags
878        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
879        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
880
881        # Check headers file
882        CPPFLAGS_SAVE="$CPPFLAGS"
883        CPPFLAGS="$PERL_CPPFLAGS"
884        AC_CHECK_HEADERS([EXTERN.h],
885                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
886
887        AC_SUBST([PERL_CPPFLAGS])
888        AC_SUBST([PERL_LDFLAGS])
889fi
890
891AC_SUBST([PERL_ENABLED])
892AC_SUBST([PERL_FILE])
893
894# ===========================================================================
895# Detect if otb is available
896# ===========================================================================
897
898AC_ARG_WITH([itk],
899        [AS_HELP_STRING([--with-itk=PATH], [Specifies an alternative location for the itk library])],
900        [ITKPATH="$withval"], [ITKPATH=""])
901
902AC_ARG_WITH([itk-version],
903        [AS_HELP_STRING([--with-itk-version=VERSION], [Specifies an alternative version for the itk library])],
904        [ITKVERS="$withval"], [ITKVERS=""])
905
906AC_ARG_WITH([otb],
907        [AS_HELP_STRING([--with-otb=PATH], [Specifies an alternative location for the otb library])],
908        [OTBPATH="$withval"], [OTBPATH=""])
909
910AC_ARG_WITH([otb-version],
911        [AS_HELP_STRING([--with-otb-version=PATH], [Specifies an alternative location for the otb library])],
912        [OTBVERS="$withval"], [OTBVERS=""])
913
914if test -z "$OTBPATH"
915then
916        OTB_LDFLAGS=""
917        OTB_CPPFLAGS=""
918        OTB_FILE=""
919        OTB_ENABLED=""
920else
921        if test -z "$ITKVERS"
922        then
923                ITKVERS="4.5"
924        fi
925        OTB_ENABLED="-DUSE_OTB"
926        IVERS="$(echo -e '4.10\n$ITKVERS' | sort -r | head -n1)"
927        if test "$IVERS" == "$ITKVERS"; then
928           ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS"
929        else
930                ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS"
931        fi
932
933        if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then
934                OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/"
935                OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS"
936                OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS"
937        else
938                OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
939                OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS"
940
941        fi
942        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
943       
944        AC_LANG_PUSH([C++])
945        # Check headers file
946        CPPFLAGS_SAVE="$CPPFLAGS"
947        CPPFLAGS="$OTB_CPPFLAGS"
948        LDFLAGS_SAVE="$LDFLAGS"
949        LIBS="$LIBS_SAVE $OTB_LDFLAGS"
950        #echo $OTB_CPPFLAGS
951        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
952                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
953        LDFLAGS_SAVE="$LDFLAGS"
954        LDFLAGS="$OTB_LDFLAGS"
955        #echo $OTB_LDFLAGS
956        #UVERS="$(echo -e '5.8\n$OTBVERS' | sort -r | head -n1)"
957        #if test "$OTBVERS" ==  "$UVERS" ; then
958        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplicationRegistry.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplications();]])],
959                        [AC_MSG_RESULT([checking for GetAvailableApplications... yes])],[AC_MSG_ERROR([checking for GetAvailableApplications... failed])])
960        #else
961        #       AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplication();]])],
962        #                                                  [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])])
963        #fi
964                                                                               
965        LDFLAGS="$LDFLAGS_SAVE"
966        AC_LANG_POP([C++])
967        AC_LANG(C++)
968                       
969fi
970AC_SUBST([OTB_CPPFLAGS])
971AC_SUBST([OTB_LDFLAGS])
972AC_SUBST([OTB_FILE])
973AC_SUBST([OTB_ENABLED])
974
975# ===========================================================================
976# Detect if saga-gis is available
977# ===========================================================================
978
979AC_ARG_WITH([wx-config],
980        [AS_HELP_STRING([--with-wx-config=PATH], [Specifies an alternative path for the wx-config tool])],
981        [WXCFG="$withval"], [WXCFG=""])
982
983AC_ARG_WITH([saga],
984        [AS_HELP_STRING([--with-saga=PATH], [Specifies an alternative location for the SAGA-GIS library])],
985        [SAGAPATH="$withval"], [SAGAPATH=""])
986
987if test -z "$SAGAPATH"
988then
989        SAGA_LDFLAGS=""
990        SAGA_CPPFLAGS=""
991        SAGA_FILE=""
992        SAGA_ENABLED=""
993else
994        if test -z "$WXCFG" ; then
995           WXCFG="$(which wx-config)"
996        fi
997        if test "`$WXCFG --list | grep unicode`" == "" ; then
998           AC_MSG_ERROR(SAGA requires a unicode build of wxGTK)
999        fi
1000        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
1001        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
1002        SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
1003        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
1004        SAGA_ENABLED="-DUSE_SAGA"
1005        SAGA_FILE="service_internal_saga.o"
1006       
1007        AC_LANG_PUSH([C++])
1008        # Check headers file
1009        CPPFLAGS_SAVE="$CPPFLAGS"
1010        CPPFLAGS="$SAGA_CPPFLAGS"
1011        LIBS_SAVE="$LIBS"
1012        LIBS="$SAGA_LDFLAGS"
1013        AC_CHECK_HEADERS([module_library.h],
1014                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
1015        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])],
1016                [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])])
1017        LIBS="$LIBS_SAVE"
1018        AC_LANG_POP([C++])
1019fi
1020AC_SUBST([SAGA_CPPFLAGS])
1021AC_SUBST([SAGA_LDFLAGS])
1022AC_SUBST([SAGA_FILE])
1023AC_SUBST([SAGA_ENABLED])
1024
1025AC_CONFIG_FILES([Makefile])
1026AC_CONFIG_FILES([ZOOMakefile.opts])
1027AC_CONFIG_FILES([main.cfg])
1028AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png