source: trunk/zoo-project/zoo-kernel/configure.ac @ 639

Last change on this file since 639 was 637, checked in by djay, 9 years ago

Fixes in zcfg generator and fixes to build correctly on GNU/Linux.

File size: 25.4 KB
Line 
1AC_INIT([ZOO Kernel], [1.5.0], [bugs@zoo-project.org])
2
3# Checks for programs.
4AC_PROG_YACC
5AC_PROG_CC
6AC_PROG_LEX
7AC_PROG_CXX
8AC_PROG_SED
9
10# Checks for libraries.
11AC_CHECK_LIB([cgic], [cgiMain])
12AC_CHECK_LIB([curl], [curl_easy_init curl_easy_setopt curl_easy_cleanup curl_easy_perform])
13AC_CHECK_LIB([dl], [dlopen dlsym dlerror dlclose])
14AC_CHECK_LIB([fl], [main])
15AC_CHECK_LIB([pthread], [main])
16AC_CHECK_LIB([ssl], [main])
17
18# Checks for header files.
19AC_FUNC_ALLOCA
20AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h malloc.h stddef.h stdlib.h string.h unistd.h])
21
22# Checks for typedefs, structures, and compiler characteristics.
23AC_HEADER_STDBOOL
24AC_TYPE_INT16_T
25AC_TYPE_INT32_T
26AC_TYPE_INT8_T
27AC_TYPE_PID_T
28AC_TYPE_SIZE_T
29AC_TYPE_UINT16_T
30AC_TYPE_UINT32_T
31AC_TYPE_UINT8_T
32
33# Checks for library functions.
34AC_FUNC_FORK
35AC_FUNC_MALLOC
36AC_FUNC_REALLOC
37AC_CHECK_FUNCS([dup2 getcwd memset setenv strdup strstr])
38
39#============================================================================
40# Detect if run on debian / ubuntu
41#============================================================================
42if test -f "/usr/bin/dpkg"
43then
44        DEB_DEF=-DDEB
45fi
46AC_SUBST([DEB_DEF])
47
48AC_ARG_WITH([cgi-dir],
49    [AS_HELP_STRING([--with-cgi-dir=PATH], [specify an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])],
50    [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"])
51AC_SUBST([CGI_DIR])
52
53# ===========================================================================
54# Detect if python is installed
55# ===========================================================================
56
57AC_ARG_WITH([python],
58        [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation,  disabled by default])],
59        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
60
61AC_ARG_WITH([pyvers],
62        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
63        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
64
65
66if test -z "$PYTHON_ENABLED"
67then
68        PYTHON_FILE=""
69else
70        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
71        PYTHON_FILE="service_internal_python.o"
72        if test  "$PYTHON_PATH" = "yes"
73        then
74                # PHP was not specified, so search within the current path
75                PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
76                if test -z "${PYTHONCFG_PATH}" ; then
77                AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}])
78                else
79                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
80                fi
81        else
82                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
83        fi
84
85        # Extract the linker and include flags
86        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
87        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
88
89        # Check headers file
90        CPPFLAGS_SAVE="$CPPFLAGS"
91        CPPFLAGS="$PYTHON_CPPFLAGS"
92        AC_CHECK_HEADERS([Python.h],
93                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
94
95        # Ensure we can link against libphp
96        LIBS_SAVE="$LIBS"
97        LIBS="$PYTHON_LDFLAGS"
98        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
99        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
100        AC_SUBST([PYTHON_CPPFLAGS])
101        AC_SUBST([PYTHON_LDFLAGS])
102fi
103
104AC_SUBST([PYTHON_ENABLED])
105AC_SUBST([PYTHON_FILE])
106
107# ===========================================================================
108# Detect if spidermonkey is installed
109# ===========================================================================
110
111AC_ARG_WITH([js],
112        [AS_HELP_STRING([--with-js=PATH], [specify --with-js=path-to-js to enable js support, specify --with-js on linux debian like, js support is disabled by default ])],
113        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
114
115if test -z "$JS_ENABLED"
116then
117        JS_FILE=""
118else
119        JS_FILE="service_internal_js.o"
120        if test "$JSHOME" = "yes"
121        then
122
123                #on teste si on est sous debian like
124                if test -f "/usr/bin/dpkg"
125                then
126                        if test -n "`dpkg -l | grep libmozjs185-dev`"
127                        then
128                                JS_CPPFLAGS="-I/usr/include/js/"
129                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
130                                JS_LIB="mozjs185"
131                        else
132                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
133                                if test -n "$XUL_VERSION"
134                                then
135                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
136                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
137                                        JS_LIB="mozjs"
138                                else
139                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
140                                fi
141                        fi
142                else
143                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
144                fi
145        else
146                JS_CPPFLAGS="-I$JSHOME/include/js/"
147                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
148                JS_LIB="mozjs185"
149
150        fi
151        CPPFLAGS_SAVE="$CPPFLAGS"
152        CPPFLAGS="$JS_CPPFLAGS"
153
154        #AC_CHECK_HEADERS([jsapi.h],
155        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
156
157       
158        LIBS_SAVE="$LIBS"
159        LIBS="$JS_LDFLAGS"
160
161        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
162                       
163        AC_SUBST([JS_CPPFLAGS])
164        AC_SUBST([JS_LDFLAGS])
165fi
166
167AC_SUBST([JS_ENABLED])
168AC_SUBST([JS_FILE])
169
170# ===========================================================================
171# Detect if php is installed
172# ===========================================================================
173
174AC_ARG_WITH([php],
175        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
176        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
177
178
179if test -z "$PHP_ENABLED"
180then
181        PHP_FILE=""
182else
183        PHPCONFIG="$PHP_PATH/bin/php-config"
184        PHP_FILE="service_internal_php.o"
185        if test  "$PHP_PATH" = "yes"
186        then
187                # PHP was not specified, so search within the current path
188                AC_PATH_PROG([PHPCONFIG], [php-config])
189        else
190                PHPCONFIG="$PHP_PATH/bin/php-config"
191        fi
192
193        # Extract the linker and include flags
194        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
195        PHP_CPPFLAGS=`$PHPCONFIG --includes`
196
197        # Check headers file
198        CPPFLAGS_SAVE="$CPPFLAGS"
199        CPPFLAGS="$PHP_CPPFLAGS"
200        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
201                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
202
203        # Ensure we can link against libphp
204        LIBS_SAVE="$LIBS"
205        LIBS="$PHP_LDFLAGS"
206        # Shouldn't we get php here rather than php5 :) ??
207        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
208        AC_SUBST([PHP_CPPFLAGS])
209        AC_SUBST([PHP_LDFLAGS])
210fi
211
212AC_SUBST([PHP_ENABLED])
213AC_SUBST([PHP_FILE])
214
215# ===========================================================================
216# Detect if java is installed
217# ===========================================================================
218
219AC_ARG_WITH([java],
220        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
221        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
222
223if test -z "$JAVA_ENABLED"
224then
225        JAVA_FILE=""
226else
227        JAVA_FILE="service_internal_java.o"
228        if test "x$JDKHOME" = "x";
229        then
230                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.])
231        fi      # JAVA was specified; display a message to the user
232        if test "x$JDKHOME" = "xyes";
233        then
234                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
235        fi
236
237        # Extract the linker and include flags
238        if test "x$JDKHOME" = "xmacos";
239        then
240                JAVA_LDFLAGS="-framework JavaVM"
241                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
242        else
243                if test -d "$JDKHOME/jre/lib/i386";
244                then
245                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/server/ -ljvm -lpthread"
246                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
247                else
248                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/server/ -ljvm -lpthread"
249                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
250                fi
251        fi
252
253        # Check headers file (second time we check that in fact)
254        CPPFLAGS_SAVE="$CPPFLAGS"
255        CPPFLAGS="$JAVA_CPPFLAGS"
256        AC_CHECK_HEADERS([jni.h],
257                         [], [AC_MSG_ERROR([could not find jni.h file])])
258
259        # Ensure we can link against libjava
260        LIBS_SAVE="$LIBS"
261        LIBS="$JAVA_LDFLAGS"
262        if test "x$JDKHOME" != "xmacos";
263        then
264                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjvm])], [])
265        fi
266
267        AC_SUBST([JAVA_CPPFLAGS])
268        AC_SUBST([JAVA_LDFLAGS])
269fi
270
271AC_SUBST([JAVA_ENABLED])
272AC_SUBST([JAVA_FILE])
273
274# ===========================================================================
275# Detect if ruby is installed
276# ===========================================================================
277AC_ARG_WITH([ruby],
278        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
279        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
280
281AC_ARG_WITH([rvers],
282        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
283        [RUBY_VERS="$withval"], [RUBY_VERS=""])
284
285
286if test -z "$RUBY_ENABLED"
287then
288        RUBY_FILE=""
289else
290        RUBY_FILE="service_internal_ruby.o"
291
292        # Extract the linker and include flags
293        RUBY_LDFLAGS="-lruby"
294        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
295
296        # Check headers file
297        CPPFLAGS_SAVE="$CPPFLAGS"
298        CPPFLAGS="$RUBY_CPPFLAGS"
299        AC_CHECK_HEADERS([ruby.h],
300                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
301
302        # Ensure we can link against libphp
303        LIBS_SAVE="$LIBS"
304        LIBS="$RUBY_LDFLAGS"
305        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
306        AC_SUBST([RUBY_CPPFLAGS])
307        AC_SUBST([RUBY_LDFLAGS])
308fi
309
310AC_SUBST([RUBY_ENABLED])
311AC_SUBST([RUBY_FILE])
312
313# ===========================================================================
314# Detect if perl is installed
315# ===========================================================================
316
317AC_ARG_WITH([perl],
318        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
319        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
320
321
322if test -z "$PERL_ENABLED"
323then
324        PERL_FILE=""
325else
326        PERL_FILE="service_internal_perl.o"
327        if test  "$PERL_PATH" = "yes"
328        then
329                # Perl was not specified, so search within the current path
330                AC_PATH_PROG([PERLCONFIG], [perl])
331        else
332                PERLCONFIG="$PERL_PATH/bin/perl"
333        fi
334
335        # Extract the linker and include flags
336        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
337        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
338
339        # Check headers file
340        CPPFLAGS_SAVE="$CPPFLAGS"
341        CPPFLAGS="$PERL_CPPFLAGS"
342        AC_CHECK_HEADERS([EXTERN.h],
343                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
344
345        AC_SUBST([PERL_CPPFLAGS])
346        AC_SUBST([PERL_LDFLAGS])
347fi
348
349AC_SUBST([PERL_ENABLED])
350AC_SUBST([PERL_FILE])
351
352# ===========================================================================
353# Detect if otb is available
354# ===========================================================================
355
356AC_ARG_WITH([itk],
357        [AS_HELP_STRING([--with-itk=PATH], [specify an alternative location for the itk library])],
358        [ITKPATH="$withval"], [ITKPATH=""])
359
360AC_ARG_WITH([itk-version],
361        [AS_HELP_STRING([--with-itk-version=VERSION], [specify an alternative version for the itk library])],
362        [ITKVERS="$withval"], [ITKVERS=""])
363
364AC_ARG_WITH([otb],
365        [AS_HELP_STRING([--with-otb=PATH], [specify an alternative location for the otb library])],
366        [OTBPATH="$withval"], [OTBPATH=""])
367
368if test -z "$OTBPATH"
369then
370        OTB_LDFLAGS=""
371        OTB_CPPFLAGS=""
372        OTB_FILE=""
373        OTB_ENABLED=""
374else
375        if test -z "$ITKVERS"
376        then
377                ITKVERS="4.5"
378        fi
379        OTB_ENABLED="-DUSE_OTB"
380        OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -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 -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
381        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"
382        OTB_FILE="otbZooWatcher.o service_internal_otb.o"
383       
384        AC_LANG_PUSH([C++])
385        # Check headers file
386        CPPFLAGS_SAVE="$CPPFLAGS"
387        CPPFLAGS="$OTB_CPPFLAGS"
388        LDFLAGS_SAVE="$LDFLAGS"
389        LDFLAGS="$OTB_LDFLAGS"
390        AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h],
391                        [], [AC_MSG_ERROR([could not find header file $i related to OTB])])
392        AC_LANG_POP([C++])
393fi
394AC_SUBST([OTB_CPPFLAGS])
395AC_SUBST([OTB_LDFLAGS])
396AC_SUBST([OTB_FILE])
397AC_SUBST([OTB_ENABLED])
398
399# ===========================================================================
400# Detect if saga-gis is available
401# ===========================================================================
402
403AC_ARG_WITH([wx-config],
404        [AS_HELP_STRING([--with-wx-config=PATH], [specify an alternative path for the wx-config tool])],
405        [WXCFG="$withval"], [WXCFG=""])
406
407AC_ARG_WITH([saga],
408        [AS_HELP_STRING([--with-saga=PATH], [specify an alternative location for the SAGA-GIS library])],
409        [SAGAPATH="$withval"], [SAGAPATH=""])
410
411if test -z "$SAGAPATH"
412then
413        SAGA_LDFLAGS=""
414        SAGA_CPPFLAGS=""
415        SAGA_FILE=""
416        SAGA_ENABLED=""
417else
418        if test -z "$WXCFG" ; then
419           WXCFG="$(which wx-config)"
420        fi
421        if test "`$WXCFG --list | grep unicode`" == "" ; then
422           AC_MSG_ERROR(SAGA requires a unicode build of wxGTK)
423        fi
424        WX_ISSUE="-D_WX_WXCRTVARARG_H_"
425        SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\""
426        SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"
427        SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api"
428        SAGA_ENABLED="-DUSE_SAGA"
429        SAGA_FILE="service_internal_saga.o"
430       
431        AC_LANG_PUSH([C++])
432        # Check headers file
433        CPPFLAGS_SAVE="$CPPFLAGS"
434        CPPFLAGS="$SAGA_CPPFLAGS"
435        LIBS_SAVE="$LIBS"
436        LIBS="$SAGA_LDFLAGS"
437        AC_MSG_RESULT(CPPFLAGS are $CPPFLAGS)
438        AC_CHECK_HEADERS([module_library.h],
439                        [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])])
440        LIBS_SAVE="$LIBS"
441        AC_CHECK_LIB([saga_api], [SG_Set_UI_Callback,SG_Get_Module_Library_Manager])
442        AC_LANG_POP([C++])
443fi
444AC_SUBST([SAGA_CPPFLAGS])
445AC_SUBST([SAGA_LDFLAGS])
446AC_SUBST([SAGA_FILE])
447AC_SUBST([SAGA_ENABLED])
448
449# ===========================================================================
450# Detect if libyaml is available
451# ===========================================================================
452
453AC_ARG_WITH([yaml],
454        [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the yaml library])],
455        [YAMLPATH="$withval"], [YAMLPATH=""])
456
457if test -z "$YAMLPATH"
458then
459        YAML_LDFLAGS=""
460        YAML_CPPFLAGS=""
461        YAML_FILE=""
462        YAML_FILE1=""
463else
464
465        # Extract the linker and include flags
466        YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
467        YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
468        YAML_FILE="service_yaml.o"
469        YAML_FILE1="zcfg2yaml"
470       
471        # Check headers file
472        CPPFLAGS_SAVE="$CPPFLAGS"
473        CPPFLAGS="$YAML_CPPFLAGS"
474        LIBS_SAVE="$LIBS"
475        LIBS="$YAML_LDFLAGS"
476        AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
477        AC_CHECK_HEADERS([yaml.h],
478                 [], [AC_MSG_ERROR([could not find headers include related to YAML])])
479        LIBS="$LIBS_SAVE"
480fi
481AC_SUBST([YAML_CPPFLAGS])
482AC_SUBST([YAML_LDFLAGS])
483AC_SUBST([YAML_FILE])
484AC_SUBST([YAML_FILE1])
485
486# ===========================================================================
487# Detect if fastcgi is available
488# ===========================================================================
489
490AC_ARG_WITH([fastcgi],
491        [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
492        [FCGIPATH="$withval"], [FCGIPATH="/usr"])
493
494# Extract the linker and include flags
495FCGI_LDFLAGS="-L$FCGIPATH/lib"
496FCGI_CPPFLAGS="-I$FCGIPATH/include"
497
498# Check headers file
499CPPFLAGS_SAVE="$CPPFLAGS"
500CPPFLAGS="$FCGI_CPPFLAGS"
501LIBS_SAVE="$LIBS"
502LIBS="$FCGI_LDFLAGS"
503AC_CHECK_LIB([fcgi], [main])
504AC_CHECK_HEADERS([fcgi_stdio.h],
505                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
506LIBS="$LIBS_SAVE"
507AC_SUBST([FCGI_CPPFLAGS])
508AC_SUBST([FCGI_LDFLAGS])
509
510
511# ===========================================================================
512# Detect if libxml2 is installed
513# ===========================================================================
514
515AC_ARG_WITH([xml2config],
516        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
517        [XML2CONFIG="$withval"], [XML2CONFIG=""])
518
519if test "x$XML2CONFIG" = "x"; then
520        # XML2CONFIG was not specified, so search within the current path
521        AC_PATH_PROG([XML2CONFIG], [xml2-config])
522
523        # If we couldn't find xml2-config, display a warning
524        if test "x$XML2CONFIG" = "x"; then
525                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.])
526        fi
527else
528        # XML2CONFIG was specified; display a message to the user
529        if test "x$XML2CONFIG" = "xyes"; then
530                AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
531        else
532                if test -f $XML2CONFIG; then
533                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
534                else
535                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
536                fi     
537        fi
538fi
539
540# Extract the linker and include flags
541XML2_LDFLAGS=`$XML2CONFIG --libs`
542XML2_CPPFLAGS=`$XML2CONFIG --cflags`
543
544# Check headers file
545CPPFLAGS_SAVE="$CPPFLAGS"
546CPPFLAGS="$XML2_CPPFLAGS"
547AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
548                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
549
550# Ensure we can link against libxml2
551LIBS_SAVE="$LIBS"
552LIBS="$XML2_LDFLAGS"
553AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
554
555AC_SUBST([XML2_CPPFLAGS])
556AC_SUBST([XML2_LDFLAGS])
557
558# ===========================================================================
559# Detect if libxslt is installed
560# ===========================================================================
561
562AC_ARG_WITH([xsltconfig],
563        [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
564        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
565
566if test "x$XSLTCONFIG" = "x"; then
567        # XSLTCONFIG was not specified, so search within the current path
568        AC_PATH_PROG([XSLTCONFIG], [xslt-config])
569
570        # If we couldn't find xslt-config, display a warning
571        if test "x$XSLTCONFIG" = "x"; then
572                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.])
573        fi
574else
575        # XSLTCONFIG was specified; display a message to the user
576        if test "x$XSLTCONFIG" = "xyes"; then
577                AC_MSG_ERROR([you must specify a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
578        else
579                if test -f $XSLTCONFIG; then
580                        AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
581                else
582                        AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
583                fi     
584        fi
585fi
586
587# Extract the linker and include flags
588XSLT_LDFLAGS=`$XSLTCONFIG --libs`
589XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
590
591# Check headers file
592CPPFLAGS_SAVE="$CPPFLAGS"
593CPPFLAGS="$XSLT_CPPFLAGS"
594AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
595                 [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
596
597AC_SUBST([XSLT_CPPFLAGS])
598AC_SUBST([XSLT_LDFLAGS])
599
600#============================================================================
601# Detect if gdal is installed
602#============================================================================
603
604AC_ARG_WITH([gdal-config],
605        [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
606        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
607if test -z $GDAL_CONFIG;
608then
609        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
610        if test -z $GDAL_CONFIG;
611        then
612                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.])
613        fi
614       
615else
616        if test -f $GDAL_CONFIG; then
617                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
618        else
619                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
620        fi
621fi
622
623GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
624GDAL_LIBS="`$GDAL_CONFIG --libs`"
625
626AC_SUBST([GDAL_CFLAGS])
627AC_SUBST([GDAL_LIBS])
628
629# ===========================================================================
630# Detect if proj is installed
631# ===========================================================================
632
633AC_ARG_WITH([proj],
634        [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
635        [PROJPATH="$withval"], [PROJPATH=""])
636
637# Extract the linker and include flags
638PROJ_LDFLAGS="-L$PROJPATH/lib"
639PROJ_CPPFLAGS="-I$PROJPATH/include"
640
641# Check headers file
642CPPFLAGS_SAVE="$CPPFLAGS"
643CPPFLAGS="$PROJ_CPPFLAGS"
644AC_CHECK_HEADERS([proj_api.h],
645                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
646
647AC_SUBST([PROJ_CPPFLAGS])
648AC_SUBST([PROJ_LDFLAGS])
649
650# ===========================================================================
651# Detect if libgeos is installed
652# ===========================================================================
653
654AC_ARG_WITH([geosconfig],
655        [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])],
656        [GEOSCONFIG="$withval"], [GEOSCONFIG=""])
657
658if test "x$GEOSCONFIG" = "x"; then
659        # GEOSCONFIG was not specified, so search within the current path
660        AC_PATH_PROG([GEOSCONFIG], [geos-config])
661
662        # If we couldn't find geos-config, display a warning
663        if test "x$GEOSCONFIG" = "x"; then
664                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.])
665        fi
666else
667        # GEOSCONFIG was specified; display a message to the user
668        if test "x$GEOSCONFIG" = "xyes"; then
669                AC_MSG_WARN([you must specify a parameter to --with-geosconfig, e.g. --with-geosconfig=/path/to/geos-config])
670        else
671                if test -f $GEOSCONFIG; then
672                        AC_MSG_RESULT([Using user-specified geos-config file: $GEOSCONFIG])
673                else
674                        AC_MSG_ERROR([the user-specified geos-config file $GEOSCONFIG does not exist])
675                fi     
676        fi
677fi
678
679GEOS_LDFLAGS=`$GEOSCONFIG --libs`
680GEOS_CPPFLAGS=`$GEOSCONFIG --cflags`
681
682# Check headers file
683CPPFLAGS_SAVE="$CPPFLAGS"
684CPPFLAGS="$GEOS_CPPFLAGS"
685AC_CHECK_HEADERS([geos_c.h],
686                 [], [AC_MSG_WARN([could not find headers include related to libgeos])])
687
688AC_SUBST([GEOS_CPPFLAGS])
689AC_SUBST([GEOS_LDFLAGS])
690
691
692# ===========================================================================
693# Detect if cgal is installed
694# ===========================================================================
695
696AC_ARG_WITH([cgal],
697        [AS_HELP_STRING([--with-cgal=PATH], [specify an alternative location for CGAL setup])],
698        [CGALPATH="$withval"], [CGALPATH="/usr"])
699
700
701# Check headers file
702CPPFLAGS_SAVE="$CPPFLAGS"
703CPPFLAGS="$CGAL_CPPFLAGS"
704AC_CHECK_HEADERS([CGAL/Delaunay_triangulation_2.h],
705         [], [AC_MSG_WARN([could not find headers include related to libCGAL])])
706
707# Extract the linker and include flags
708CGAL_LDFLAGS="-L$CGALPATH/lib"
709CGAL_CPPFLAGS="-I$CGALPATH/include"
710
711
712AC_SUBST([CGAL_CPPFLAGS])
713AC_SUBST([CGAL_LDFLAGS])
714#============================================================================
715# Detect if mapserver is installed
716#============================================================================
717
718AC_ARG_WITH([mapserver],
719       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
720       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
721
722if test -z $MS_SRC_PATH;
723then
724        MS_CPPFLAGS=""
725        MS_LDFLAGS=""
726else
727       if test "x$MS_SRC_PATH" = "xmacos";
728       then
729               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
730               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
731               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
732               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
733       else
734               if test -d $MS_SRC_PATH; then
735                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
736                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
737               
738                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
739               else
740                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
741               fi
742       fi
743       MS_FILE="service_internal_ms.o"
744fi
745
746MS_CFLAGS="$MS_CPPFLAGS"
747MS_LIBS="$MS_LDFLAGS"
748
749AC_SUBST([MS_CFLAGS])
750AC_SUBST([MS_LIBS])
751AC_SUBST([MS_FILE])
752
753AC_CONFIG_FILES([Makefile])
754AC_CONFIG_FILES([ZOOMakefile.opts])
755AC_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