Skip to content

Commit

Permalink
Re-work test for extended regex
Browse files Browse the repository at this point in the history
So it doesn't hang on "lean" CI builds
  • Loading branch information
ndptech committed Aug 20, 2024
1 parent a2028c7 commit d5700b5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
36 changes: 28 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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 <regex.h>
#ifdef REG_EXTENDED
yes
#endif
#include <stdlib.h>
#include <regex.h>
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
Expand All @@ -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
Expand Down
20 changes: 13 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <regex.h>
#ifdef REG_EXTENDED
yes
#endif
],

AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h>
#include <regex.h>
]],
[[
#ifdef REG_EXTENDED
exit(1);
#endif
]]
)],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_REG_EXTENDED, [1], [define this if we have REG_EXTENDED (from <regex.h>)])
Expand Down

0 comments on commit d5700b5

Please sign in to comment.