summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-06 13:40:30 -0800
committerEric Anholt <eric@anholt.net>2013-12-06 18:34:46 -0800
commit259136845d082d02b359c1dbc993b0d294de7b76 (patch)
tree51a7ecd6ada111b960c8be2d9d725a902cdee02d /configure.ac
parent0e7b9c09397304e745a3b8a9f71f660209ca8beb (diff)
downloadlibepoxy-259136845d082d02b359c1dbc993b0d294de7b76.tar.gz
Start porting the GL dispatch code to win32.
It now builds successfully builds a .dll file. Not that it's usable or anything yet.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac39
1 files changed, 29 insertions, 10 deletions
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])