[PATCH]: Fix configure.ac to allow linking against PCRE on Cygwin

Tim Rice tim at multitalents.net
Sat Nov 24 05:51:53 EST 2001


On Fri, 23 Nov 2001, Corinna Vinschen wrote:

> On Thu, Nov 22, 2001 at 07:12:40PM -0800, Tim Rice wrote:
> > On Thu, 22 Nov 2001, Corinna Vinschen wrote:
> >
> > > Hi,
> > >
> > > the current configure.ac file contains an unfortunately static
> > > setting of $LIBS when the host system is Cygwin.  It always
> > > adds -lregex to $LIBS before the --with-pcre setting is evaluated.
> > > The later adding of -lpcreposix -lpcre doesn't work correctly
> > > since it follows later in the link order.
> > >
> > > +case "$host" in
> > > +*-*-cygwin*)
> > I'd rather not see another case $host
> > Please try this patch and see if it solves your problem
>
> No, it doesn't, unfortunately.  recomp is defined in Cygwin even
> without the external regex library but it's a very old implementation
> which is incompatible with POSIX regex and which is still in Cygwin
> for some sort of backward compatibility.  That means the test for
> regcomp() works successfully and so the test is sure that using regex
> is sure even without linking against -lregex.  But the compiled ssh
> doesn't work then.
>
> Corinna

Try this patch.
It gives preference to libregex over regex functions in libc.

>
>
--------------------< cut >--------------------
--- configure.ac.old	Sat Nov  3 11:09:33 2001
+++ configure.ac	Fri Nov 23 10:14:32 2001
@@ -65,7 +65,7 @@
 	AC_DEFINE(DISABLE_LASTLOG)
 	;;
 *-*-cygwin*)
-	LIBS="$LIBS -lregex /usr/lib/textmode.o"
+	LIBS="$LIBS /usr/lib/textmode.o"
 	AC_DEFINE(HAVE_CYGWIN)
 	AC_DEFINE(USE_PIPES)
 	AC_DEFINE(DISABLE_SHADOW)
@@ -400,8 +400,9 @@

 # We don't want to check if we did an pcre override.
 if test -z "$no_comp_check" ; then
-	AC_CHECK_FUNC(regcomp,
-		[ AC_DEFINE(HAVE_REGCOMP)],
+	AC_CHECK_LIB(regex, regcomp, LIBS="$LIBS -lregex",
+	[
+		AC_CHECK_FUNC(regcomp, [ AC_DEFINE(HAVE_REGCOMP)],
 		[
 			AC_CHECK_LIB(pcre, pcre_info,
 			[
@@ -411,8 +412,8 @@
 			[
 				AC_MSG_ERROR([*** No regex library found.])
 			])
-		]
-	)
+		])
+	])
 fi

 dnl UnixWare 2.x
--------------------< end cut >--------------------

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net





More information about the openssh-unix-dev mailing list