From b7527923bdd261aea353cd086600fedf34b674ea Mon Sep 17 00:00:00 2001 From: Marcus Sundberg Date: Wed, 19 Jan 2000 01:21:28 +0000 Subject: [PATCH] Check for dlfcn.h and dlopen(). Due to re-designed gl_vidglx.c we don't need XMesaSetFXmode in the GL library if we have dlopen(). Define DYN_LIBS for Makefiles. --- acconfig.h | 4 +++- configure.in | 28 ++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/acconfig.h b/acconfig.h index 50c462a..da55435 100644 --- a/acconfig.h +++ b/acconfig.h @@ -17,6 +17,9 @@ /* Define this to something sane if you don't have stricmp */ #undef stricmp +/* Define if you have the dlopen function. */ +#undef HAVE_DLOPEN + /* Define this if you are using Mesa */ #undef XMESA @@ -34,4 +37,3 @@ /* Define this to use experimental code */ #undef _EXPERIMENTAL_ - diff --git a/configure.in b/configure.in index 24c17f0..1834f5d 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ AC_PROG_CPP AC_PROG_MAKE_SET dnl Checks for header files. -AC_CHECK_HEADERS(unistd.h fcntl.h windows.h sys/ioctl.h sys/mman.h \ +AC_CHECK_HEADERS(unistd.h fcntl.h dlfcn.h windows.h sys/ioctl.h sys/mman.h \ sys/io.h asm/io.h \ sys/stat.h sys/time.h sys/timeb.h \ sys/socket.h netinet/in.h netdb.h arpa/inet.h sys/filio.h \ @@ -58,7 +58,7 @@ AC_FUNC_MMAP AC_FUNC_VPRINTF AC_CHECK_FUNCS(gethostname gethostbyname connect gettimeofday getwd mkdir \ ftime _ftime fcntl stat putenv select socket strerror strstr \ - snprintf _snprintf vsnprintf _vsnprintf strsep) + snprintf _snprintf vsnprintf _vsnprintf strsep dlopen) AC_ARG_ENABLE(experimental, [ --enable-experimental compile with experimental code. Use at your @@ -101,6 +101,15 @@ if test "x$ac_cv_func_vsnprintf" = "xno" -a \ AC_CHECK_LIB(db,vsnprintf) fi +dnl Check for dlopen +if test "x$ac_cv_func_dlopen" = "xno"; then + AC_CHECK_LIB(dl, dlopen, DYN_LIBS="$DYN_LIBS -ldl" + have_dynload=yes + AC_DEFINE(HAVE_DLOPEN)) +else + have_dynload=yes +fi + dnl Checks for working -lm AC_CHECK_LIB(m, pow,, AC_MSG_ERROR([math library (-lm) appears broken])) @@ -355,15 +364,21 @@ dnl Make sure -lGL or -lMesaGL works if test "x$HAS_OGL" = xyes; then AC_CHECK_LIB(GL, glColor4f, OGL_LIBS="$OGL_LIBS -lGL" HAS_OGL=yes - AC_CHECK_LIB(GL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, - [ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]), + if test "x$have_dynload" != "xyes"; then + AC_CHECK_LIB(GL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, + [ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) + fi + , HAS_OGL=no, [$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) if test "x$HAS_OGL" != xyes; then AC_CHECK_LIB(MesaGL, glColor4f, OGL_LIBS="$OGL_LIBS -lMesaGL" HAS_OGL=yes - AC_CHECK_LIB(MesaGL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, - [ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]), + if test "x$have_dynload" != "xyes"; then + AC_CHECK_LIB(MesaGL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, + [ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) + fi + , HAS_OGL=no, [$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi @@ -714,6 +729,7 @@ AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AC_SUBST(SND_STYLE) AC_SUBST(SND_LIBS) +AC_SUBST(DYN_LIBS) AC_SUBST(INTEL_ARCH) AC_SUBST(NET_LIBS) AC_SUBST(SYS_SRC)