aboutsummaryrefslogtreecommitdiff
path: root/sim/m4
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-09-13 22:45:19 -0400
committerMike Frysinger <vapier@gentoo.org>2021-09-13 22:45:19 -0400
commitf050cfdd82625e6214c4a77ae3b4b364dede1b52 (patch)
treefad9fa0ead2de1313e2a285be6badbda5ebffcd1 /sim/m4
parent924e660d528c985f526584313a4564cd2618962b (diff)
downloadgdb-f050cfdd82625e6214c4a77ae3b4b364dede1b52.zip
gdb-f050cfdd82625e6214c4a77ae3b4b364dede1b52.tar.gz
gdb-f050cfdd82625e6214c4a77ae3b4b364dede1b52.tar.bz2
sim: bfin: add support for SDL2
This probably should have been ported long ago, but better late than never. We keep support for both versions for now since both projects tend to have long lifetimes. Maybe consider dropping SDL1 in another ten years.
Diffstat (limited to 'sim/m4')
-rw-r--r--sim/m4/sim_ac_platform.m419
1 files changed, 14 insertions, 5 deletions
diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index b0abe62..766f577 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -163,12 +163,21 @@ AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(m, fabs)
AC_CHECK_LIB(m, log2)
-PKG_CHECK_MODULES(SDL, sdl, [dnl
- AC_CHECK_LIB(dl, dlopen, [dnl
- SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
+AC_CHECK_LIB(dl, dlopen)
+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"
- ], [SDL_CFLAGS= SDL_LIBS=])
- ], [:])
+ ], [
+ PKG_CHECK_MODULES(SDL, sdl, [dnl
+ SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL=1"
+ SDL_LIBS="-ldl"
+ ], [:])
+ ])
+else
+ SDL_CFLAGS=
+ SDL_LIBS=
+fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)