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

Last change on this file since 520 was 520, checked in by david, 9 years ago
  • check libxslt install
File size: 19.2 KB
Line 
1AC_INIT([ZOO Kernel], [1.4.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
48
49
50
51AC_ARG_WITH([cgi-dir],
52    [AS_HELP_STRING([--with-cgi-dir=PATH], [specify an alternative cgi directory path ( default: /usr/lib/cgi-bin) ])],
53    [CGI_DIR="$withval"], [CGI_DIR="/usr/lib/cgi-bin"])
54AC_SUBST([CGI_DIR])
55
56#============================================================================
57# Detect if gdal is installed
58#============================================================================
59
60AC_ARG_WITH([gdal-config],
61        [AS_HELP_STRING([--with-gdal-config=FILE], [specify an alternative gdal-config file])],
62        [GDAL_CONFIG="$withval"], [GDAL_CONFIG=""])
63if test -z $GDAL_CONFIG;
64then
65        AC_PATH_PROG([GDAL_CONFIG], [gdal-config])
66        if test -z $GDAL_CONFIG;
67        then
68                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.])
69        fi
70       
71else
72        if test -f $GDAL_CONFIG; then
73                AC_MSG_RESULT([Using user-specified gdal-config file: $GDAL_CONFIG])
74        else
75                AC_MSG_ERROR([the user-specified gdal-config file $GDAL_CONFIG does not exist])
76        fi
77fi
78
79GDAL_CFLAGS="`$GDAL_CONFIG --cflags`"
80GDAL_LIBS="`$GDAL_CONFIG --libs`"
81
82AC_SUBST([GDAL_CFLAGS])
83AC_SUBST([GDAL_LIBS])
84
85# ===========================================================================
86# Detect if libyaml is available
87# ===========================================================================
88
89AC_ARG_WITH([yaml],
90        [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the fastcgi library])],
91        [YAMLPATH="$withval"], [YAMLPATH=""])
92
93if test -z "$YAMLPATH"
94then
95        YAML_LDFLAGS=""
96        YAML_CPPFLAGS=""
97        YAML_FILE=""
98        YAML_FILE1=""
99else
100
101        # Extract the linker and include flags
102        YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml"
103        YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML"
104        YAML_FILE="service_yaml.o"
105        YAML_FILE1="zcfg2yaml"
106       
107        # Check headers file
108        CPPFLAGS_SAVE="$CPPFLAGS"
109        CPPFLAGS="$YAML_CPPFLAGS"
110        LDFLAGS_SAVE="$LDFLAGS"
111        LDFLAGS="YAML_LDFLAGS"
112        AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan])
113        AC_CHECK_HEADERS([yaml.h],
114                 [], [AC_MSG_ERROR([could not find headers include related to YAML])])
115
116fi
117AC_SUBST([YAML_CPPFLAGS])
118AC_SUBST([YAML_LDFLAGS])
119AC_SUBST([YAML_FILE])
120AC_SUBST([YAML_FILE1])
121
122# ===========================================================================
123# Detect if fastcgi is available
124# ===========================================================================
125
126AC_ARG_WITH([fastcgi],
127        [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])],
128        [FCGIPATH="$withval"], [FCGIPATH="/usr"])
129
130# Extract the linker and include flags
131FCGI_LDFLAGS="-L$FCGIPATH/lib"
132FCGI_CPPFLAGS="-I$FCGIPATH/include"
133
134# Check headers file
135CPPFLAGS_SAVE="$CPPFLAGS"
136CPPFLAGS="$FCGI_CPPFLAGS"
137LDFLAGS_SAVE="LDFLAGS"
138LDFLAGS="$FCGI_LDFLAGS"
139AC_CHECK_LIB([fcgi], [main])
140AC_CHECK_HEADERS([fcgi_stdio.h],
141                 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])])
142
143AC_SUBST([FCGI_CPPFLAGS])
144AC_SUBST([FCGI_LDFLAGS])
145
146# ===========================================================================
147# Detect if proj is installed
148# ===========================================================================
149
150AC_ARG_WITH([proj],
151        [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])],
152        [PROJPATH="$withval"], [PROJPATH=""])
153
154# Extract the linker and include flags
155PROJ_LDFLAGS="-L$PROJPATH/lib"
156PROJ_CPPFLAGS="-I$PROJPATH/include"
157
158# Check headers file
159CPPFLAGS_SAVE="$CPPFLAGS"
160CPPFLAGS="$PROJ_CPPFLAGS"
161AC_CHECK_HEADERS([proj_api.h],
162                 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])])
163
164AC_SUBST([PROJ_CPPFLAGS])
165AC_SUBST([PROJ_LDFLAGS])
166
167# ===========================================================================
168# Detect if libxml2 is installed
169# ===========================================================================
170
171AC_ARG_WITH([xml2config],
172        [AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
173        [XML2CONFIG="$withval"], [XML2CONFIG=""])
174
175if test "x$XML2CONFIG" = "x"; then
176        # XML2CONFIG was not specified, so search within the current path
177        AC_PATH_PROG([XML2CONFIG], [xml2-config])
178
179        # If we couldn't find xml2-config, display a warning
180        if test "x$XML2CONFIG" = "x"; then
181                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.])
182        fi
183else
184        # XML2CONFIG was specified; display a message to the user
185        if test "x$XML2CONFIG" = "xyes"; then
186                AC_MSG_ERROR([you must specify a parameter to --with-xml2config, e.g. --with-xml2config=/path/to/xml2-config])
187        else
188                if test -f $XML2CONFIG; then
189                        AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
190                else
191                        AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
192                fi     
193        fi
194fi
195
196# Extract the linker and include flags
197XML2_LDFLAGS=`$XML2CONFIG --libs`
198XML2_CPPFLAGS=`$XML2CONFIG --cflags`
199
200# Check headers file
201CPPFLAGS_SAVE="$CPPFLAGS"
202CPPFLAGS="$XML2_CPPFLAGS"
203AC_CHECK_HEADERS([libxml/tree.h libxml/parser.h libxml/xpath.h libxml/xpathInternals.h],
204                 [], [AC_MSG_ERROR([could not find headers include related to libxml2])])
205
206# Ensure we can link against libxml2
207LIBS_SAVE="$LIBS"
208LIBS="$XML2_LDFLAGS"
209AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([could not find libxml2])], [])
210
211AC_SUBST([XML2_CPPFLAGS])
212AC_SUBST([XML2_LDFLAGS])
213
214
215
216# ===========================================================================
217# Detect if libxslt is installed
218# ===========================================================================
219
220AC_ARG_WITH([xsltconfig],
221        [AS_HELP_STRING([--with-xsltconfig=FILE], [specify an alternative xslt-config file])],
222        [XSLTCONFIG="$withval"], [XSLTCONFIG=""])
223
224if test "x$XSLTCONFIG" = "x"; then
225        # XSLTCONFIG was not specified, so search within the current path
226        AC_PATH_PROG([XSLTCONFIG], [xslt-config])
227
228        # If we couldn't find xslt-config, display a warning
229        if test "x$XSLTCONFIG" = "x"; then
230                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.])
231        fi
232else
233        # XSLTCONFIG was specified; display a message to the user
234        if test "x$XSLTCONFIG" = "xyes"; then
235                AC_MSG_ERROR([you must specify a parameter to --with-xsltconfig, e.g. --with-xsltconfig=/path/to/xslt-config])
236        else
237                if test -f $XSLTCONFIG; then
238                        AC_MSG_RESULT([Using user-specified xslt-config file: $XSLTCONFIG])
239                else
240                        AC_MSG_ERROR([the user-specified xslt-config file $XSLTCONFIG does not exist])
241                fi     
242        fi
243fi
244
245# Extract the linker and include flags
246XSLT_LDFLAGS=`$XSLTCONFIG --libs`
247XSLT_CPPFLAGS=`$XSLTCONFIG --cflags`
248
249# Check headers file
250CPPFLAGS_SAVE="$CPPFLAGS"
251CPPFLAGS="$XML2_CPPFLAGS"
252AC_CHECK_HEADERS([libxslt/xslt.h libxslt/xsltInternals.h libxslt/transform.h libxslt/xsltutils.h],
253                 [], [AC_MSG_ERROR([could not find headers include related to libxlst])])
254
255# Ensure we can link against libxslt
256LIBS_SAVE="$LIBS"
257LIBS="$XSLT_LDFLAGS"
258
259AC_SUBST([XSLT_CPPFLAGS])
260AC_SUBST([XSLT_LDFLAGS])
261
262
263
264
265
266#============================================================================
267# Detect if mapserver is installed
268#============================================================================
269
270AC_ARG_WITH([mapserver],
271       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
272       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
273
274if test -z $MS_SRC_PATH;
275then
276        MS_CPPFLAGS=""
277        MS_LDFLAGS=""
278else
279       if test "x$MS_SRC_PATH" = "xmacos";
280       then
281               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
282               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
283               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
284               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
285       else
286               if test -d $MS_SRC_PATH; then
287                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
288                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
289               
290                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
291               else
292                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
293               fi
294       fi
295       MS_FILE="service_internal_ms.o"
296fi
297
298MS_CFLAGS="$MS_CPPFLAGS"
299MS_LIBS="$MS_LDFLAGS"
300
301AC_SUBST([MS_CFLAGS])
302AC_SUBST([MS_LIBS])
303AC_SUBST([MS_FILE])
304
305# ===========================================================================
306# Detect if ruby is installed
307# ===========================================================================
308AC_ARG_WITH([ruby],
309        [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation,  disabled by default])],
310        [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""])
311
312AC_ARG_WITH([rvers],
313        [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])],
314        [RUBY_VERS="$withval"], [RUBY_VERS=""])
315
316
317if test -z "$RUBY_ENABLED"
318then
319        RUBY_FILE=""
320else
321        RUBY_FILE="service_internal_ruby.o"
322
323        # Extract the linker and include flags
324        RUBY_LDFLAGS="-lruby"
325        RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS"
326
327        # Check headers file
328        CPPFLAGS_SAVE="$CPPFLAGS"
329        CPPFLAGS="$RUBY_CPPFLAGS"
330        AC_CHECK_HEADERS([ruby.h],
331                 [], [AC_MSG_ERROR([could not find headers include related to libruby])])
332
333        # Ensure we can link against libphp
334        LIBS_SAVE="$LIBS"
335        LIBS="$RUBY_LDFLAGS"
336        # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
337        AC_SUBST([RUBY_CPPFLAGS])
338        AC_SUBST([RUBY_LDFLAGS])
339fi
340
341AC_SUBST([RUBY_ENABLED])
342AC_SUBST([RUBY_FILE])
343
344# ===========================================================================
345# Detect if python is installed
346# ===========================================================================
347
348AC_ARG_WITH([python],
349        [AS_HELP_STRING([--with-python=PATH], [To enable python support or specify an alternative directory for python installation,  disabled by default])],
350        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
351
352AC_ARG_WITH([pyvers],
353        [AS_HELP_STRING([--with-pyvers=NUM], [To use a specific python version])],
354        [PYTHON_VERS="$withval"], [PYTHON_VERS=""])
355
356
357if test -z "$PYTHON_ENABLED"
358then
359        PYTHON_FILE=""
360else
361        PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
362        PYTHON_FILE="service_internal_python.o"
363        if test  "$PYTHON_PATH" = "yes"
364        then
365                # PHP was not specified, so search within the current path
366                PYTHONCFG_PATH=`which python${PYTHON_VERS}-config`
367                if test -z "${PYTHONCFG_PATH}" ; then
368                AC_PATH_PROG([PYTHONCONFIG], [python-config-${PYTHON_VERS}])
369                else
370                AC_PATH_PROG([PYTHONCONFIG], [python${PYTHON_VERS}-config])
371                fi
372        else
373                PYTHONCONFIG="$PYTHON_PATH/bin/python${PYTHON_VERS}-config"
374        fi
375
376        # Extract the linker and include flags
377        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
378        PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes`
379
380        # Check headers file
381        CPPFLAGS_SAVE="$CPPFLAGS"
382        CPPFLAGS="$PYTHON_CPPFLAGS"
383        AC_CHECK_HEADERS([Python.h],
384                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
385
386        # Ensure we can link against libphp
387        LIBS_SAVE="$LIBS"
388        LIBS="$PYTHON_LDFLAGS"
389        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
390        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
391        AC_SUBST([PYTHON_CPPFLAGS])
392        AC_SUBST([PYTHON_LDFLAGS])
393fi
394
395AC_SUBST([PYTHON_ENABLED])
396AC_SUBST([PYTHON_FILE])
397
398# ===========================================================================
399# Detect if php is installed
400# ===========================================================================
401
402AC_ARG_WITH([php],
403        [AS_HELP_STRING([--with-php=PATH], [To enable php support or specify an alternative directory for php installation,  disabled by default])],
404        [PHP_PATH="$withval"; PHP_ENABLED="-DUSE_PHP"], [PHP_ENABLED=""])
405
406
407if test -z "$PHP_ENABLED"
408then
409        PHP_FILE=""
410else
411        PHPCONFIG="$PHP_PATH/bin/php-config"
412        PHP_FILE="service_internal_php.o"
413        if test  "$PHP_PATH" = "yes"
414        then
415                # PHP was not specified, so search within the current path
416                AC_PATH_PROG([PHPCONFIG], [php-config])
417        else
418                PHPCONFIG="$PHP_PATH/bin/php-config"
419        fi
420
421        # Extract the linker and include flags
422        PHP_LDFLAGS="-L/`$PHPCONFIG --prefix`/lib -lphp5"
423        PHP_CPPFLAGS=`$PHPCONFIG --includes`
424
425        # Check headers file
426        CPPFLAGS_SAVE="$CPPFLAGS"
427        CPPFLAGS="$PHP_CPPFLAGS"
428        AC_CHECK_HEADERS([sapi/embed/php_embed.h],
429                 [], [AC_MSG_ERROR([could not find headers include related to libphp])])
430
431        # Ensure we can link against libphp
432        LIBS_SAVE="$LIBS"
433        LIBS="$PHP_LDFLAGS"
434        # Shouldn't we get php here rather than php5 :) ??
435        AC_CHECK_LIB([php5], [call_user_function], [], [AC_MSG_ERROR([could not find libphp])], [])
436        AC_SUBST([PHP_CPPFLAGS])
437        AC_SUBST([PHP_LDFLAGS])
438fi
439
440AC_SUBST([PHP_ENABLED])
441AC_SUBST([PHP_FILE])
442
443# ===========================================================================
444# Detect if perl is installed
445# ===========================================================================
446
447AC_ARG_WITH([perl],
448        [AS_HELP_STRING([--with-perl=PATH], [To enable perl support or specify an alternative directory for perl installation,  disabled by default])],
449        [PERL_PATH="$withval"; PERL_ENABLED="-DUSE_PERL"], [PERL_ENABLED=""])
450
451
452if test -z "$PERL_ENABLED"
453then
454        PERL_FILE=""
455else
456        PERL_FILE="service_internal_perl.o"
457        if test  "$PERL_PATH" = "yes"
458        then
459                # Perl was not specified, so search within the current path
460                AC_PATH_PROG([PERLCONFIG], [perl])
461        else
462                PERLCONFIG="$PERL_PATH/bin/perl"
463        fi
464
465        # Extract the linker and include flags
466        PERL_LDFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ldopts`
467        PERL_CPPFLAGS=`$PERLCONFIG -MExtUtils::Embed -e ccopts`
468
469        # Check headers file
470        CPPFLAGS_SAVE="$CPPFLAGS"
471        CPPFLAGS="$PERL_CPPFLAGS"
472        AC_CHECK_HEADERS([EXTERN.h],
473                 [], [AC_MSG_ERROR([could not find headers include related to libperl])])
474
475        AC_SUBST([PERL_CPPFLAGS])
476        AC_SUBST([PERL_LDFLAGS])
477fi
478
479AC_SUBST([PERL_ENABLED])
480AC_SUBST([PERL_FILE])
481
482# ===========================================================================
483# Detect if java is installed
484# ===========================================================================
485
486AC_ARG_WITH([java],
487        [AS_HELP_STRING([--with-java=PATH], [To enable java support, specify a JDK_HOME,  disabled by default])],
488        [JDKHOME="$withval"; JAVA_ENABLED="-DUSE_JAVA"], [JAVA_ENABLED=""])
489
490if test -z "$JAVA_ENABLED"
491then
492        JAVA_FILE=""
493else
494        JAVA_FILE="service_internal_java.o"
495        if test "x$JDKHOME" = "x";
496        then
497                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.])
498        fi      # JAVA was specified; display a message to the user
499        if test "x$JDKHOME" = "xyes";
500        then
501                AC_MSG_ERROR([you must specify a parameter to --with-java, e.g. --with-java=/path/to/java])
502        fi
503
504        # Extract the linker and include flags
505        if test "x$JDKHOME" = "xmacos";
506        then
507                JAVA_LDFLAGS="-framework JavaVM"
508                JAVA_CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/"
509        else
510                if test -d "$JDKHOME/jre/lib/i386";
511                then
512                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/i386/client/ -ljvm -lpthread"
513                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
514                else
515                        JAVA_LDFLAGS="-L$JDKHOME/jre/lib/amd64/client/ -ljvm -lpthread"
516                        JAVA_CPPFLAGS="-I$JDKHOME/include -I$JDKHOME/include/linux"
517                fi
518        fi
519
520        # Check headers file (second time we check that in fact)
521        CPPFLAGS_SAVE="$CPPFLAGS"
522        CPPFLAGS="$JAVA_CPPFLAGS"
523        AC_CHECK_HEADERS([jni.h],
524                         [], [AC_MSG_ERROR([could not find headers include related to libjava])])
525
526        # Ensure we can link against libjava
527        LIBS_SAVE="$LIBS"
528        LIBS="$JAVA_LDFLAGS"
529        if test "x$JDKHOME" != "xmacos";
530        then
531                AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [], [AC_MSG_ERROR([could not find libjava])], [])
532        fi
533
534        AC_SUBST([JAVA_CPPFLAGS])
535        AC_SUBST([JAVA_LDFLAGS])
536fi
537
538AC_SUBST([JAVA_ENABLED])
539AC_SUBST([JAVA_FILE])
540
541# ===========================================================================
542# Detect if spidermonkey is installed
543# ===========================================================================
544
545AC_ARG_WITH([js],
546        [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 ])],
547        [JSHOME="$withval";JS_ENABLED="-DUSE_JS"], [JS_ENABLED=""])
548
549if test -z "$JS_ENABLED"
550then
551        JS_FILE=""
552else
553        JS_FILE="service_internal_js.o"
554        if test "$JSHOME" = "yes"
555        then
556
557                #on teste si on est sous debian like
558                if test -f "/usr/bin/dpkg"
559                then
560                        if test -n "`dpkg -l | grep libmozjs185-dev`"
561                        then
562                                JS_CPPFLAGS="-I/usr/include/js/"
563                                JS_LDFLAGS="-L/usr/lib -lmozjs185 -lm"
564                                JS_LIB="mozjs185"
565                        else
566                                XUL_VERSION="`dpkg -l | grep xulrunner | grep dev | head -1| awk '{print $3;}' | cut -d'+' -f1`"
567                                if test -n "$XUL_VERSION"
568                                then
569                                        JS_CPPFLAGS="-I/usr/include/xulrunner-$XUL_VERSION"
570                                        JS_LDFLAGS="-L/usr/lib/xulrunner-$XUL_VERSION -lmozjs -lm"
571                                        JS_LIB="mozjs"
572                                else
573                                        AC_MSG_ERROR([You must install libmozjs185-dev or xulrunner-dev ])
574                                fi
575                        fi
576                else
577                        AC_MSG_ERROR([You must  specify your custom install of libmozjs185])
578                fi
579        else
580                JS_CPPFLAGS="-I$JSHOME/include/js/"
581                JS_LDFLAGS="-L$JSHOME/lib -lmozjs185 -lm"
582                JS_LIB="mozjs185"
583
584        fi
585        CPPFLAGS_SAVE="$CPPFLAGS"
586        CPPFLAGS="$JS_CPPFLAGS"
587
588        #AC_CHECK_HEADERS([jsapi.h],
589        #                [], [AC_MSG_ERROR([could not find headers include related to libjs])])
590
591       
592        LIBS_SAVE="$LIBS"
593        LIBS="$JS_LDFLAGS"
594
595        AC_CHECK_LIB([$JS_LIB], [JS_CompileFile,JS_CallFunctionName], [], [AC_MSG_ERROR([could not find $JS_LIB])], [])
596                       
597        AC_SUBST([JS_CPPFLAGS])
598        AC_SUBST([JS_LDFLAGS])
599fi
600
601AC_SUBST([JS_ENABLED])
602AC_SUBST([JS_FILE])
603
604AC_CONFIG_FILES([Makefile])
605AC_CONFIG_FILES([ZOOMakefile.opts])
606AC_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