From 259136845d082d02b359c1dbc993b0d294de7b76 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 6 Dec 2013 13:40:30 -0800 Subject: Start porting the GL dispatch code to win32. It now builds successfully builds a .dll file. Not that it's usable or anything yet. --- configure.ac | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 440059c..5255c7a 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AC_CHECK_PROGS([PYTHON], [python3 python2 python]) # Initialize libtool AC_DISABLE_STATIC +AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_SYS_LARGEFILE @@ -51,13 +52,22 @@ case $host_os in mingw*) build_egl=no build_glx=no + # On windows, the DLL has to have all of its functions + # resolved at link time, so we have to link directly aginst + # opengl32.dll. But that's the only GL provider, anyway. + EPOXY_LINK_LIBS="-lopengl32" ;; *) build_egl=yes build_glx=yes + # On platforms with dlopen, we load everything dynamically and + # don't link against a specific window system or GL implementation. + EPOXY_LINK_LIBS="" ;; esac +AC_SUBST(EPOXY_LINK_LIBS) + AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes) if test x$build_egl = xyes; then AC_DEFINE([BUILD_EGL], [1], [build EGL tests]) @@ -68,17 +78,26 @@ if test x$build_glx = xyes; then AC_DEFINE([BUILD_GLX], [1], [build GLX tests]) fi -if test "x$GCC" = xyes; then - save_CFLAGS="$CFLAGS" - AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) - VISIBILITY_CFLAGS="-fvisibility=hidden" - CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" - AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), - [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); - # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. - CFLAGS=$save_CFLAGS -fi +case $host_os in + mingw*) + # visibility flags aren't supported for windows DLLs, and the + # compiler whines to tell you so, so don't set them up. + ;; + *) + if test "x$GCC" = xyes; then + save_CFLAGS="$CFLAGS" + AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) + VISIBILITY_CFLAGS="-fvisibility=hidden" + CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), + [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); + + # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. + CFLAGS=$save_CFLAGS + fi + ;; +esac AC_SUBST([VISIBILITY_CFLAGS]) -- cgit v1.2.1