Patch for Review: Add regex functions checks to fastjar/configure.in

Ranjit Mathew rmathew@hotmail.com
Sat Jan 18 17:49:00 GMT 2003


Hi,

     The following is my attempt to address the fact that the
regex functions like regexec, regcomp, etc. might not be defined
in libc (as on Linux) and might need a separate library like
libregex (as on MinGW).

Unfortunately, the current fastjar configuration assumes otherwise.

I really wanted to define a straightforward:

AC_CHECK_FUNC( regexec, ,
    AC_CHECK_LIB( regex, regexec, ,
       AC_MSG_ERROR([regex functions not found - get libregex])))

but autoconf does not accept this due to recursive definition
errors from m4.

This patch relies on the fact that the default success action of
AC_CHECK_LIB for a library "foo" is to prefix "-lfoo" to the shell
variable "LIBS".

Finally, "configure" needs to be regenerated after this patch.

ChangeLog:

2003-01-18  Ranjit Mathew  <rmathew@hotmail.com>

	* configure.in: Check if libc really has regex functions,
         otherwise try libregex.
         * configure: Rebuilt.

Patch:
------------------------------- 8< -------------------------------
--- configure.in	2003-01-18 20:27:39.000000000 +0530
+++ configure.in	2003-01-18 21:53:31.000000000 +0530
@@ -34,4 +34,13 @@
  gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG

+dnl Check for regex functions
+regex_impl=unknown
+AC_CHECK_FUNC( regexec, regex_impl=libc)
+
+if test "$regex_impl" = unknown; then
+   AC_CHECK_LIB( regex, regexec, ,
+      AC_MSG_ERROR([regex functions not found - get libregex]))
+fi
+
  dnl Check for type-widths
  gcc_AC_COMPILE_CHECK_SIZEOF(char)
------------------------------- 8< -------------------------------

Sincerely Yours,
Ranjit.

-- 
Ranjit Mathew        Email: rmathew AT hotmail DOT com
Bangalore,
INDIA.               Web: http://ranjitmathew.tripod.com/




More information about the Java-patches mailing list