Skip to contentSkip to conversation

2.0.1-rc6: support LZO 2.01 (liblzo.* -> liblzo2.*)

PATCH In review Matthias Andree 2 participants 2 messages Jul 20, 2005 – Jul 21, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 2.0.1-rc6: support LZO 2.01 (liblzo.* -> liblzo2.*)

The attached patch checks for liblzo2 if LZO v2 headers have been found, to support LZO 2.01 and newer, which renamed the library to liblzo2.

This was tested on SUSE Linux 9.3 without LZO, with LZO 1.08, 2.00 and 2.01.

Signature · 1 line
Matthias Andree
ChangeLog renamed from ChangeLog~ +1 -0
@@ -5,6 +5,7 @@
 
 2005.XX.XX -- Version 2.0.1-rc7
 
+* Support LZO 2.01 which renamed its library to lzo2 (Matthias Andree).
 * Include linux/types.h before checking for linux/errqueue.h (Matthias
   Andree).
 
configure.ac renamed from configure.ac~ +20 -13
@@ -467,22 +467,29 @@
 if test "$LZO" = "yes"; then
    LZO_H=""
    AC_CHECKING([for LZO Library and Header files])
-   AC_CHECK_HEADER(lzo/lzo1x.h, 
-        [ LZO_H="2" ],
-	[ AC_CHECK_HEADER(lzo1x.h, [ LZO_H="1" ])]
+   AC_CHECK_HEADER(lzo/lzo1x.h,
+	[ LZO_H="2"
+	  lzolibs="lzo2 lzo"
+	  AC_DEFINE(LZO_HEADER_DIR, 1, [Use lzo/ directory prefix for LZO header files (for LZO 2.0)])
+	],
+	[ AC_CHECK_HEADER(lzo1x.h, [ LZO_H="1" ; lzolibs=lzo ]) ]
    )
 
    if test -n "$LZO_H"; then
-     AC_CHECK_LIB(lzo, lzo1x_1_15_compress,
-       [
-         OPENVPN_ADD_LIBS(-llzo)
-	 AC_DEFINE(USE_LZO, 1, [Use LZO compression library])
-	 if test "$LZO_H" = "2"; then
-	   AC_DEFINE(LZO_HEADER_DIR, 1, [Use lzo/ directory prefix for LZO header files (for LZO 2.0)])
-         fi
-       ],
-       [AC_MSG_ERROR([LZO headers were found but LZO library was not found])]
-     )
+     havelzolib=0
+     for i in $lzolibs ; do
+	if test $havelzolib = 1 ; then break ; fi
+	AC_CHECK_LIB($i, lzo1x_1_15_compress,
+          [
+	    OPENVPN_ADD_LIBS(-l$i)
+	    AC_DEFINE(USE_LZO, 1, [Use LZO compression library])
+	    havelzolib=1
+	  ]
+        )
+     done
+     if test $havelzolib = 0 ; then
+       AC_MSG_ERROR([LZO headers were found but LZO library was not found])
+     fi
    else
      AC_MSG_RESULT([LZO headers were not found])
      AC_MSG_RESULT([LZO library available from http://www.oberhumer.com/opensource/lzo/])
#1 lore raw

Matthias,

Thanks -- I've released your 2 patches as 2.0.1-rc7.

James

Quoted 8 lines · Matthias Andree

The attached patch checks for liblzo2 if LZO v2 headers have been found, to support LZO 2.01 and newer, which renamed the library to liblzo2.

This was tested on SUSE Linux 9.3 without LZO, with LZO 1.08, 2.00 and 2.01.

Signature · 1 line
Matthias Andree