[4/5] sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBS

Message ID 20221103100403.26278-4-vapier@gentoo.org
State Committed
Headers
Series [1/5] sim: build: switch to libtool for linking |

Commit Message

Mike Frysinger Nov. 3, 2022, 10:04 a.m. UTC
  With more C libraries moving functions entirely into the main -lc,
change the AC_CHECK_LIB calls to AC_SEARCH_LIBS so we look in there
first and avoid extra linkage when possible.
---
 sim/config.h.in           |  12 --
 sim/configure             | 235 +++++++++++++++++++++++---------------
 sim/m4/sim_ac_platform.m4 |  10 +-
 3 files changed, 150 insertions(+), 107 deletions(-)
  

Patch

diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index 92fb00a3d795..74ac7fe14d45 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -145,12 +145,12 @@  AC_TYPE_UID_T
 LT_INIT
 
 dnl Libraries.
-AC_CHECK_LIB(socket, bind)
-AC_CHECK_LIB(nsl, gethostbyname)
-AC_CHECK_LIB(m, fabs)
-AC_CHECK_LIB(m, log2)
+AC_SEARCH_LIBS([bind], [socket])
+AC_SEARCH_LIBS([gethostbyname], [nsl])
+AC_SEARCH_LIBS([fabs], [m])
+AC_SEARCH_LIBS([log2], [m])
 
-AC_CHECK_LIB(dl, dlopen)
+AC_SEARCH_LIBS([dlopen], [dl])
 if test "${ac_cv_lib_dl_dlopen}" = "yes"; then
   PKG_CHECK_MODULES(SDL, sdl2, [dnl
     SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL=2"