From: Nick Porter Date: Tue, 20 Aug 2024 09:48:11 +0000 (+0100) Subject: Re-work test for extended regex X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5700b51d2e4af431f1c91cb10efd81d581ed2d9;p=thirdparty%2Ffreeradius-server.git Re-work test for extended regex So it doesn't hang on "lean" CI builds --- diff --git a/configure b/configure index 1e0d2f59ac3..80419fb1c54 100755 --- a/configure +++ b/configure @@ -15867,17 +15867,34 @@ smart_prefix= REGEX=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for extended regular expressions" >&5 printf %s "checking for extended regular expressions... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #ifdef REG_EXTENDED - yes - #endif + #include + #include +int +main (void) +{ + + #ifdef REG_EXTENDED + exit(1); + #endif + + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 +if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -15894,7 +15911,10 @@ printf "%s\n" "no" >&6; } ;; esac fi -rm -rf conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for regcomp in -lregex" >&5 diff --git a/configure.ac b/configure.ac index 20e0be2dad6..5d6c019f6bf 100644 --- a/configure.ac +++ b/configure.ac @@ -2272,13 +2272,19 @@ if test "x$REGEX" = "x"; then if test "x$ac_cv_header_regex_h" = "xyes"; then REGEX=yes AC_MSG_CHECKING([for extended regular expressions]) - AC_EGREP_CPP(yes, - [ - #include - #ifdef REG_EXTENDED - yes - #endif - ], + + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #include + ]], + [[ + #ifdef REG_EXTENDED + exit(1); + #endif + ]] + )], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_REG_EXTENDED, [1], [define this if we have REG_EXTENDED (from )])