aboutsummaryrefslogtreecommitdiff
path: root/sim/m4
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-03 17:38:46 +0700
committerMike Frysinger <vapier@gentoo.org>2022-11-04 13:50:37 +0700
commitc55c1f6e9d7bcc400bc23a0e29ac9e2681ed4c31 (patch)
tree4ce61fe9a67b0253830a3cd7093f075b6d3314fd /sim/m4
parent01d8ce742c257b697eed52de5520d0a4489e4e5b (diff)
downloadgdb-c55c1f6e9d7bcc400bc23a0e29ac9e2681ed4c31.zip
gdb-c55c1f6e9d7bcc400bc23a0e29ac9e2681ed4c31.tar.gz
gdb-c55c1f6e9d7bcc400bc23a0e29ac9e2681ed4c31.tar.bz2
sim: don't hardcode -ldl for SDL support
Since we use AC_SEARCH_LIBS to find dlopen, we don't need to hardcode -ldl when using SDL ourselves.
Diffstat (limited to 'sim/m4')
-rw-r--r--sim/m4/sim_ac_platform.m412
1 files changed, 8 insertions, 4 deletions
diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index 74ac7fe..467987e 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -154,19 +154,23 @@ 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"
- SDL_LIBS="-ldl"
], [
PKG_CHECK_MODULES(SDL, sdl, [dnl
SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL=1"
- SDL_LIBS="-ldl"
], [:])
])
+ dnl If we use SDL, we need dlopen support.
+ AS_IF([test -n "$SDL_CFLAGS"], [dnl
+ AS_IF([test "$ac_cv_search_dlopen" = no], [dnl
+ AC_MSG_WARN([SDL support requires dlopen support])
+ ])
+ ])
else
SDL_CFLAGS=
- SDL_LIBS=
fi
+dnl We dlopen the libs at runtime, so never pass down SDL_LIBS.
+SDL_LIBS=
AC_SUBST(SDL_CFLAGS)
-AC_SUBST(SDL_LIBS)
dnl In the Cygwin environment, we need some additional flags.
AC_CACHE_CHECK([for cygwin], sim_cv_os_cygwin,