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.
This commit is contained in:
Marcus Sundberg 2000-01-19 01:21:28 +00:00
parent c3035f6f7a
commit b7527923bd
2 changed files with 25 additions and 7 deletions

View File

@ -17,6 +17,9 @@
/* Define this to something sane if you don't have stricmp */ /* Define this to something sane if you don't have stricmp */
#undef stricmp #undef stricmp
/* Define if you have the dlopen function. */
#undef HAVE_DLOPEN
/* Define this if you are using Mesa */ /* Define this if you are using Mesa */
#undef XMESA #undef XMESA
@ -34,4 +37,3 @@
/* Define this to use experimental code */ /* Define this to use experimental code */
#undef _EXPERIMENTAL_ #undef _EXPERIMENTAL_

View File

@ -23,7 +23,7 @@ AC_PROG_CPP
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
dnl Checks for header files. 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/io.h asm/io.h \
sys/stat.h sys/time.h sys/timeb.h \ sys/stat.h sys/time.h sys/timeb.h \
sys/socket.h netinet/in.h netdb.h arpa/inet.h sys/filio.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_FUNC_VPRINTF
AC_CHECK_FUNCS(gethostname gethostbyname connect gettimeofday getwd mkdir \ AC_CHECK_FUNCS(gethostname gethostbyname connect gettimeofday getwd mkdir \
ftime _ftime fcntl stat putenv select socket strerror strstr \ ftime _ftime fcntl stat putenv select socket strerror strstr \
snprintf _snprintf vsnprintf _vsnprintf strsep) snprintf _snprintf vsnprintf _vsnprintf strsep dlopen)
AC_ARG_ENABLE(experimental, AC_ARG_ENABLE(experimental,
[ --enable-experimental compile with experimental code. Use at your [ --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) AC_CHECK_LIB(db,vsnprintf)
fi 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 dnl Checks for working -lm
AC_CHECK_LIB(m, pow,, AC_MSG_ERROR([math library (-lm) appears broken])) 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 if test "x$HAS_OGL" = xyes; then
AC_CHECK_LIB(GL, glColor4f, OGL_LIBS="$OGL_LIBS -lGL" AC_CHECK_LIB(GL, glColor4f, OGL_LIBS="$OGL_LIBS -lGL"
HAS_OGL=yes HAS_OGL=yes
AC_CHECK_LIB(GL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, if test "x$have_dynload" != "xyes"; then
[ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]), AC_CHECK_LIB(GL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no,
[ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi
,
HAS_OGL=no, HAS_OGL=no,
[$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) [$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
if test "x$HAS_OGL" != xyes; then if test "x$HAS_OGL" != xyes; then
AC_CHECK_LIB(MesaGL, glColor4f, OGL_LIBS="$OGL_LIBS -lMesaGL" AC_CHECK_LIB(MesaGL, glColor4f, OGL_LIBS="$OGL_LIBS -lMesaGL"
HAS_OGL=yes HAS_OGL=yes
AC_CHECK_LIB(MesaGL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no, if test "x$have_dynload" != "xyes"; then
[ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]), AC_CHECK_LIB(MesaGL, XMesaSetFXmode, qwfoo=qwfoo, HAS_XMESA=no,
[ $OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi
,
HAS_OGL=no, HAS_OGL=no,
[$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) [$OGL_LIBS $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi fi
@ -714,6 +729,7 @@ AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS) AC_SUBST(SDL_LIBS)
AC_SUBST(SND_STYLE) AC_SUBST(SND_STYLE)
AC_SUBST(SND_LIBS) AC_SUBST(SND_LIBS)
AC_SUBST(DYN_LIBS)
AC_SUBST(INTEL_ARCH) AC_SUBST(INTEL_ARCH)
AC_SUBST(NET_LIBS) AC_SUBST(NET_LIBS)
AC_SUBST(SYS_SRC) AC_SUBST(SYS_SRC)