libetpan: correctly link with curl and expat

This commit is contained in:
Đoàn Trần Công Danh 2024-06-09 22:33:34 +07:00
parent 786b912c4c
commit 506b128c8b
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,46 @@
--- a/configure.ac
+++ b/configure.ac
@@ -622,9 +622,10 @@ elif test "x$with_curl" != "xauto"; then
fi
AC_CHECK_HEADER(curl/curl.h, [libcurl=yes])
if test "x$libcurl" = "xyes"; then
- AC_MSG_CHECKING([whether with-curl compiles and links fine])
- AC_TRY_LINK([], [curl_easy_init();], [libcurl=yes], [libcurl=no])
- AC_MSG_RESULT([$libcurl])
+ AC_CHECK_LIB([curl], [curl_easy_init],
+ [libcurl=yes; LIBS="$LIBS -lcurl -lz";],
+ [libcurl=no],
+ [-lz])
fi
if test "x$libcurl" = "xno"; then
CPPFLAGS="$OCPPFLAGS"
@@ -680,9 +681,8 @@ elif test "x$with_expat" != "xauto"; the
fi
AC_CHECK_HEADER(expat.h, [libexpat=yes])
if test "x$libexpat" = "xyes"; then
- AC_MSG_CHECKING([whether with-expat compiles and links fine])
- AC_TRY_LINK([], [XML_SetElementHandler();], [libexpat=yes], [libexpat=no])
- AC_MSG_RESULT([$libexpat])
+ AC_CHECK_LIB([expat], [XML_SetElementHandler],
+ [libexpat=yes;LIBS="$LIBS -lexpat";], [libexpat=no])
fi
if test "x$libexpat" = "xno"; then
CPPFLAGS="$OCPPFLAGS"
@@ -691,13 +691,10 @@ elif test "x$with_expat" != "xauto"; the
else
AC_CHECK_HEADER(expat.h, [libexpat=yes])
if test "x$libexpat" = "xyes"; then
- AC_MSG_CHECKING([whether libexpat compiles and links fine])
- OLDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -lexpat"
- AC_TRY_LINK([], [XML_SetElementHandler();], [libexpat=yes], [libexpat=no])
- AC_MSG_RESULT([$libexpat])
- if test "x$libexpat" = "xno"; then
- LDFLAGS="$OLDFLAGS"
+ AC_CHECK_LIB([expat], [XML_SetElementHandler],
+ [libexpat=yes;LIBS="$LIBS -lexpat"], [libexpat=no])
+ if test "x$libexpat" = "xyes"; then
+ LDFLAGS="$LDFLAGS -lexpat"
fi
fi
fi

View File

@ -1,7 +1,7 @@
# Template file for 'libetpan'
pkgname=libetpan
version=1.9.3
revision=5
revision=6
build_style=gnu-configure
configure_args="--enable-ipv6 --with-curl --with-expat --with-openssl
--with-zlib --with-sasl"