Corinna Vinschen
2001-Nov-22 12:06 UTC
[PATCH]: Fix configure.ac to allow linking against PCRE on Cygwin
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.
The following patch changes that. The static $LIBS setting in the
Cygwin case doesn't include -lregex. Instead it checks the setting
of --with-pcre afterwards and adds -lregex only if -lpcreposix isn't
already contained in $LIBS.
Corinna
Index: configure.ac
==================================================================RCS file:
/cvs/openssh_cvs/configure.ac,v
retrieving revision 1.4
diff -u -p -r1.4 configure.ac
--- configure.ac 2001/11/03 19:09:33 1.4
+++ configure.ac 2001/11/22 11:57:34
@@ -65,7 +65,7 @@ case "$host" in
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)
@@ -367,6 +367,17 @@ if test "x$with_tcp_wrappers" != "xno"
;
AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp
-lrpc)
fi
fi
+
+case "$host" in
+*-*-cygwin*)
+ # Check if linking agains pcre is requested, otherwise use
+ # regex lib on Cygwin
+ echo "$LIBS" | grep "pcreposix" > /dev/null 2>&1
+ if test $? -ne 0 ; then
+ LIBS="$LIBS -lregex "
+ fi
+ ;;
+esac
AC_CHECK_FUNC(getspnam, ,
AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat.com
Tim Rice
2001-Nov-23 03:12 UTC
[PATCH]: Fix configure.ac to allow linking against PCRE on Cygwin
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 --------------------< cut >-------------------- --- configure.ac.old Sat Nov 3 11:09:33 2001 +++ configure.ac Thu Nov 22 18:43:51 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) @@ -409,7 +409,10 @@ LIBS="$LIBS -lpcreposix -lpcre" ], [ + AC_CHECK_LIB(regex, regcomp, LIBS="$LIBS -lregex", + [ AC_MSG_ERROR([*** No regex library found.]) + ]) ]) ] ) --------------------< end cut >-------------------- -- Tim Rice Multitalents (707) 887-1469 tim at multitalents.net