Mercurial > octave
comparison configure.in @ 7173:ff2ff2c09865
[project @ 2007-11-14 18:20:49 by jwe]
author | jwe |
---|---|
date | Wed, 14 Nov 2007 18:20:50 +0000 |
parents | f83b2ca41b05 |
children | ff4a4cc863a9 |
comparison
equal
deleted
inserted
replaced
7172:e9a590a137d8 | 7173:ff2ff2c09865 |
---|---|
27 | 27 |
28 EXTERN_CFLAGS="$CFLAGS" | 28 EXTERN_CFLAGS="$CFLAGS" |
29 EXTERN_CXXFLAGS="$CXXFLAGS" | 29 EXTERN_CXXFLAGS="$CXXFLAGS" |
30 | 30 |
31 AC_INIT | 31 AC_INIT |
32 AC_REVISION($Revision: 1.593 $) | 32 AC_REVISION($Revision: 1.594 $) |
33 AC_PREREQ(2.57) | 33 AC_PREREQ(2.57) |
34 AC_CONFIG_SRCDIR([src/octave.cc]) | 34 AC_CONFIG_SRCDIR([src/octave.cc]) |
35 AC_CONFIG_HEADER(config.h) | 35 AC_CONFIG_HEADER(config.h) |
36 | 36 |
37 OCTAVE_HOST_TYPE | 37 OCTAVE_HOST_TYPE |
421 fi | 421 fi |
422 | 422 |
423 AC_SUBST(TEXINFO_QHULL) | 423 AC_SUBST(TEXINFO_QHULL) |
424 | 424 |
425 ### Check for pcre/regex library. | 425 ### Check for pcre/regex library. |
426 WITH_PCRE=no | 426 |
427 REGEX_LIBS= | 427 ## check for pcre-config, and if so, set CPPFLAGS appropriately |
428 AC_CHECK_LIB(pcre, pcre_compile, [ | 428 AC_CHECK_PROG(WITH_PCRE_CONFIG, pcre-config, yes, no) |
429 m4_foreach_w([hdr], [pcre/pcre.h pcre.h], | 429 if test $WITH_PCRE_CONFIG = yes ; then |
430 [AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([hdr])), | 430 CPPFLAGS="$CPPFLAGS $(pcre-config --cflags)" |
431 [Define to 1 if you have the <]m4_defn([hdr])[> | 431 fi |
432 header file, and it defines PCRE_INFO_NAMECOUNT, | 432 |
433 PCRE_INFO_NAMEENTRYSIZE, and PCRE_INFO_NAMETABLE.])]) | 433 ## NB: no need to do separate check for pcre.h header -- checking macros is good enough |
434 for hdr in pcre/pcre.h pcre.h; do | 434 AC_CACHE_CHECK([whether pcre.h defines the macros we need], [ac_cv_pcre_h_macros_present], [ |
435 AC_MSG_CHECKING([whether $hdr defines the macros we need]) | 435 AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ |
436 AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ | 436 #include <pcre.h> |
437 #include <$hdr> | |
438 #if defined (PCRE_INFO_NAMECOUNT) \ | 437 #if defined (PCRE_INFO_NAMECOUNT) \ |
439 && defined (PCRE_INFO_NAMEENTRYSIZE) \ | 438 && defined (PCRE_INFO_NAMEENTRYSIZE) \ |
440 && defined (PCRE_INFO_NAMETABLE) | 439 && defined (PCRE_INFO_NAMETABLE) |
441 PCRE_HAS_MACROS_WE_NEED | 440 PCRE_HAS_MACROS_WE_NEED |
442 #endif], [ | 441 #endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) |
443 dnl We check the header after the egrep to avoid defining HAVE_X_H macros | 442 WITH_PCRE="$ac_cv_pcre_h_macros_present" |
444 dnl for headers that we can't use. | 443 |
445 AC_MSG_RESULT([yes]) | 444 REGEX_LIBS= |
446 AC_CHECK_HEADER($hdr, [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$hdr), 1)]) | 445 if test $WITH_PCRE = yes; then |
447 AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.]) | 446 AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.]) |
448 WITH_PCRE=yes | 447 if test $WITH_PCRE_CONFIG = yes; then |
449 REGEX_LIBS=-lpcre | 448 REGEX_LIBS=$(pcre-config --libs) |
450 break | 449 else |
451 ], [AC_MSG_RESULT([no])]) | 450 REGEX_LIBS=-lpcre |
452 done | 451 fi |
453 ]) | 452 fi |
454 | |
455 if test $WITH_PCRE = no; then | 453 if test $WITH_PCRE = no; then |
456 warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." | 454 warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." |
457 AC_MSG_WARN($warn_pcre) | 455 AC_MSG_WARN($warn_pcre) |
458 fi | 456 fi |
459 | 457 |
458 ## not sure why we need to check for regex like this if pcre is defined, but it was like this when I got here ... | |
460 AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [ | 459 AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [ |
461 AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)]) | 460 AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)]) |
462 if test $WITH_REGEX = yes ; then | 461 if test $WITH_REGEX = yes ; then |
463 AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.]) | 462 AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.]) |
464 if test $WITH_PCRE = no ; then | 463 if test $WITH_PCRE = no ; then |
468 fi | 467 fi |
469 if test $WITH_REGEX = no; then | 468 if test $WITH_REGEX = no; then |
470 warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." | 469 warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." |
471 AC_MSG_WARN($warn_regex) | 470 AC_MSG_WARN($warn_regex) |
472 fi | 471 fi |
472 | |
473 AC_SUBST(REGEX_LIBS) | 473 AC_SUBST(REGEX_LIBS) |
474 | 474 |
475 ### Check for ZLIB library. | 475 ### Check for ZLIB library. |
476 | 476 |
477 WITH_ZLIB=true | 477 WITH_ZLIB=true |