Mercurial > octave-nkf
comparison configure.in @ 8621:f1534e248260
configure.in: check for pcre_compile, don't check for other regex functions if pcre library is found
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 28 Jan 2009 18:58:15 -0500 |
parents | f8b3ece45bda |
children | 53fb843ca498 |
comparison
equal
deleted
inserted
replaced
8620:a2dd2ffc504d | 8621:f1534e248260 |
---|---|
455 PCRE_HAS_MACROS_WE_NEED | 455 PCRE_HAS_MACROS_WE_NEED |
456 #endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) | 456 #endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) |
457 WITH_PCRE="$ac_cv_pcre_h_macros_present" | 457 WITH_PCRE="$ac_cv_pcre_h_macros_present" |
458 | 458 |
459 REGEX_LIBS= | 459 REGEX_LIBS= |
460 if test $WITH_PCRE = yes; then | 460 using_pcre=no |
461 AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.]) | 461 using_regex=no |
462 if test $WITH_PCRE_CONFIG = yes; then | 462 if test "$WITH_PCRE" = yes; then |
463 if test "$WITH_PCRE_CONFIG" = yes; then | |
463 REGEX_LIBS=$(pcre-config --libs) | 464 REGEX_LIBS=$(pcre-config --libs) |
464 else | 465 else |
465 REGEX_LIBS=-lpcre | 466 REGEX_LIBS=-lpcre |
466 fi | 467 fi |
468 save_LIBS="$LIBS" | |
469 LIBS="$REGEX_LIBS $LIBS" | |
470 AC_CHECK_FUNCS(pcre_compile, [using_pcre=yes | |
471 AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE library is available.])], [ | |
472 REGEX_LIBS= | |
473 warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." | |
474 AC_MSG_WARN($warn_pcre)]) | |
475 LIBS="$save_LIBS" | |
467 else | 476 else |
468 warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." | 477 warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." |
469 AC_MSG_WARN($warn_pcre) | 478 AC_MSG_WARN($warn_pcre) |
470 fi | 479 fi |
471 | 480 |
472 AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [ | 481 if test "$using_pcre" = no; then |
473 AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)]) | 482 AC_CHECK_FUNCS(regexec, [using_regex=yes], [ |
474 if test $WITH_REGEX = yes ; then | 483 AC_CHECK_LIB(regex, regexec, [using_regex=yes |
475 AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.]) | 484 REGEX_LIBS="-lregex"], [ |
476 AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [ | 485 warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." |
477 AC_CHECK_LIB(regex, regexec, REGEX_LIBS="$REGEX_LIBS -lregex")]) | 486 AC_MSG_WARN($warn_regex)])]) |
478 fi | 487 if test "$using_regex" = yes; then |
479 if test $WITH_REGEX = no; then | 488 AC_DEFINE(HAVE_REGEX, 1, [Define if regex library is available.]) |
480 warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." | 489 fi |
481 AC_MSG_WARN($warn_regex) | 490 fi |
482 fi | |
483 | |
484 AC_SUBST(REGEX_LIBS) | 491 AC_SUBST(REGEX_LIBS) |
485 | 492 |
486 ### Check for ZLIB library. | 493 ### Check for ZLIB library. |
487 | 494 |
488 WITH_ZLIB=true | 495 WITH_ZLIB=true |