From 5170f42a9d6bef7306fefb79028746e60e182cff Mon Sep 17 00:00:00 2001
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Fri, 5 Nov 2021 04:43:52 +0000
Subject: [PATCH] Move libdl check to RTS configure

---
 configure.ac     | 7 ++-----
 rts/configure.ac | 5 +++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index bcc542de4dca..1a8733c2581b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -972,11 +972,8 @@ FP_FIND_LIBFFI
 AC_SUBST(UseSystemLibFFI)
 
 dnl ** check whether we need -ldl to get dlopen()
-AC_CHECK_LIB([dl], [dlopen])
-AC_CHECK_LIB([dl], [dlopen], HaveLibdl=YES, HaveLibdl=NO)
-AC_SUBST([UseLibdl],[$HaveLibdl])
-dnl ** check whether we have dlinfo
-AC_CHECK_FUNCS([dlinfo])
+AC_CHECK_LIB([dl], [dlopen], UseLibdl=YES, UseLibdl=NO)
+AC_SUBST([UseLibdl])
 
 dnl ** check for leading underscores in symbol names
 FP_LEADING_UNDERSCORE
diff --git a/rts/configure.ac b/rts/configure.ac
index e39d0730cfc9..82e23c9c88e5 100644
--- a/rts/configure.ac
+++ b/rts/configure.ac
@@ -33,6 +33,11 @@ GHC_CONVERT_PLATFORM_PARTS([host], [Host])
 FPTOOLS_SET_PLATFORM_VARS([host], [Host])
 FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
 
+dnl ** check whether we need -ldl to get dlopen()
+AC_CHECK_LIB([dl], [dlopen])
+dnl ** check whether we have dlinfo
+AC_CHECK_FUNCS([dlinfo])
+
 dnl --------------------------------------------------
 dnl * Miscellaneous feature tests
 dnl --------------------------------------------------
-- 
GitLab