]> granicus.if.org Git - libevent/commitdiff
build: use AC_CHECK_LIB over AC_HAVE_LIBRARY
authorfanquake <fanquake@gmail.com>
Tue, 23 Mar 2021 01:52:14 +0000 (09:52 +0800)
committerfanquake <fanquake@gmail.com>
Tue, 23 Mar 2021 01:52:14 +0000 (09:52 +0800)
AC_HAVE_LIBRARY is deprecated, see
https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Obsolete-Macros.html,
and has been prior to Autoconf 2.67, which is the minimum required by
the project. It's usage also causes warnings with newer versions of autoconf:
```bash
configure.ac:319: warning: The macro `AC_HAVE_LIBRARY' is obsolete.
configure.ac:319: You should run autoupdate.
```

`AC_HAVE_LIBRARY` was introduced in #969, although it's not clear why it
was decided to revert to using an obselete macro.

configure.ac

index a143224eb7850e12f254e62652522683bd49fdc1..5489c0809a7d6fa918d13fa8e4cffb20be185a23 100644 (file)
@@ -316,7 +316,7 @@ AM_CONDITIONAL(BUILD_MIDIPIX, test x$midipix = xtrue)
 AM_CONDITIONAL(BUILD_WITH_NO_UNDEFINED, test x$bwin32 = xtrue || test x$cygwin = xtrue || test x$midipix = xtrue)
 
 if test x$bwin32 = xtrue; then
-  AC_HAVE_LIBRARY([ws2_32])
+  AC_CHECK_LIB([ws2_32], [main])
 fi
 
 dnl Checks for typedefs, structures, and compiler characteristics.