2013-08-12 22:12:09 +02:00
|
|
|
dnl configure.ac
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
2013-11-06 22:43:54 +01:00
|
|
|
AC_PREREQ([2.63])
|
2015-03-19 15:40:53 +01:00
|
|
|
AC_INIT([libglvnd], [0.0.0], [kbrenneman@nvidia.com])
|
2013-08-12 22:12:09 +02:00
|
|
|
AC_CONFIG_SRCDIR([config.h.in])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR([bin])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2013-09-27 02:11:26 +02:00
|
|
|
AM_INIT_AUTOMAKE([1.11 foreign silent-rules])
|
|
|
|
AM_SILENT_RULES([yes])
|
2013-08-12 22:12:09 +02:00
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_AWK
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AM_PROG_AS
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_CHECK_PROGS([PYTHON2], [python2 python])
|
Re-implement libGL such that ELF symbol filtering is optional
Unfortunately, glibc has a bug where dlopening a shared library with
DT_FILTER or DT_AUXILIARY ELF headers can cause the application to
segfault (see https://sourceware.org/bugzilla/show_bug.cgi?id=16272).
Hence, for now, we can't rely on ELF symbol filtering to implement the
libGL compatibility library for libGLdispatch and libGLX. This change
re-implements libGL such that this is no longer necessary, by building
in the glapi static dispatch stubs and implementing thin wrapper
functions around GLX entrypoints.
- Rename getCachedProcAddress() to __glXGetCachedProcAddress() and give
this public visibility. This is used by the libGL wrapper library to
retrieve GLX entrypoints at load time.
- Link libGLX with the -Bsymbolic flag so __glXGetCachedProcAddress()
avoids referencing functions in the libGL wrapper library when libGL
and libGLX are both loaded.
- Replace the hand-coded no-op definitions in libglxnoopdefs.h with
a spec file, glx_funcs.spec, and a simple Perl script, gen_stubs.pl,
which parses the file and generates no-op functions as well as
pass-through functions that are used by libGL.
- Restructure GLdispatch/vnd-glapi/mapi/entry.c such that the pure C
fallback code is in its own header, entry_pure_c.h. In each of the
entry_*.h headers, separate code not related to implementing the
static dispatch stubs into an "#if !defined(STATIC_DISPATCH_ONLY)"
block.
- Give u_current (which is #defined as _glapi_Current or
_glapi_tls_Current depending on the thread storage model used) public
visibility so it can be referenced from outside of libGLdispatch.so.
- When building libGL, include GLdispatch/vnd-glapi/mapi/entry.c in the
sources, and define STATIC_DISPATCH_ONLY so that only the static
entrypoints are compiled. Remove the -Wl,--auxiliary flags from
Makefile.am.
Bonus: fix "make distcheck" by adding GLdispatchABI.h to noinst_HEADERS.
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
2013-12-03 21:06:47 +01:00
|
|
|
AC_CHECK_PROGS([PERL], [perl])
|
2013-08-12 22:12:09 +02:00
|
|
|
|
2013-12-04 00:03:09 +01:00
|
|
|
dnl
|
|
|
|
dnl Auxiliary ELF symbol filtering support
|
|
|
|
dnl
|
|
|
|
AC_ARG_ENABLE([dt-auxiliary],
|
|
|
|
[AS_HELP_STRING([--enable-dt-auxiliary],
|
|
|
|
[enable auxiliary ELF symbol filtering @<:@default=disabled@:>@])],
|
|
|
|
[enable_dt_auxiliary="$enableval"],
|
|
|
|
[enable_dt_auxiliary=no]
|
|
|
|
)
|
|
|
|
AC_MSG_CHECKING([whether to enable auxiliary ELF symbol filtering])
|
|
|
|
|
|
|
|
if test "x$enable_dt_auxiliary" = xyes; then
|
|
|
|
(
|
|
|
|
LDFLAGS='-shared -Wl,--auxiliary=libc.so.6'
|
|
|
|
AC_LINK_IFELSE([AC_LANG_SOURCE([])],
|
|
|
|
[dt_auxiliary_supported=yes],
|
|
|
|
[dt_auxiliary_supported=no])
|
|
|
|
if test "x$dt_auxiliary_supported" = xyes; then
|
|
|
|
AC_MSG_RESULT([yes, supported])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no, not supported])
|
|
|
|
fi
|
|
|
|
test "x$dt_auxiliary_supported" = xyes
|
|
|
|
) && dt_auxiliary_supported=yes
|
|
|
|
else
|
|
|
|
dt_auxiliary_supported=no
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([USE_DT_AUXILIARY], [test "x$dt_auxiliary_supported" = xyes])
|
|
|
|
|
2013-08-12 22:12:09 +02:00
|
|
|
dnl
|
|
|
|
dnl Arch/platform-specific settings. Copied from mesa
|
|
|
|
dnl
|
|
|
|
AC_ARG_ENABLE([asm],
|
|
|
|
[AS_HELP_STRING([--disable-asm],
|
|
|
|
[disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
|
|
|
|
[enable_asm="$enableval"],
|
|
|
|
[enable_asm=yes]
|
|
|
|
)
|
|
|
|
asm_arch=""
|
|
|
|
AC_MSG_CHECKING([whether to enable assembly])
|
|
|
|
test "x$enable_asm" = xno && AC_MSG_RESULT([no])
|
|
|
|
# disable if cross compiling on x86/x86_64 since we must run gen_matypes
|
|
|
|
if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
|
|
|
|
case "$host_cpu" in
|
|
|
|
i?86 | x86_64)
|
|
|
|
enable_asm=no
|
|
|
|
AC_MSG_RESULT([no, cross compiling])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
# check for supported arches
|
|
|
|
if test "x$enable_asm" = xyes; then
|
|
|
|
case "$host_cpu" in
|
|
|
|
i?86)
|
|
|
|
case "$host_os" in
|
|
|
|
linux* | *freebsd* | dragonfly* | *netbsd*)
|
|
|
|
test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
|
|
|
|
;;
|
|
|
|
gnu*)
|
|
|
|
asm_arch=x86
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
x86_64)
|
|
|
|
case "$host_os" in
|
|
|
|
linux* | *freebsd* | dragonfly* | *netbsd*)
|
|
|
|
test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
sparc*)
|
|
|
|
case "$host_os" in
|
|
|
|
linux*)
|
|
|
|
asm_arch=sparc
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$asm_arch" in
|
|
|
|
x86)
|
|
|
|
DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
|
|
|
|
AC_MSG_RESULT([yes, x86])
|
|
|
|
;;
|
|
|
|
x86_64)
|
|
|
|
DEFINES="$DEFINES -DUSE_X86_64_ASM"
|
|
|
|
AC_MSG_RESULT([yes, x86_64])
|
|
|
|
;;
|
|
|
|
sparc)
|
|
|
|
DEFINES="$DEFINES -DUSE_SPARC_ASM"
|
|
|
|
AC_MSG_RESULT([yes, sparc])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT([no, platform not supported])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Various conditionals.
|
|
|
|
AM_CONDITIONAL([GCC], [test x$GCC = xyes ])
|
|
|
|
|
2013-08-12 22:12:10 +02:00
|
|
|
dnl
|
|
|
|
dnl mapi top-relative paths: defined here so mapi can be used elsewhere
|
|
|
|
dnl
|
|
|
|
|
2013-09-27 05:08:04 +02:00
|
|
|
AC_SUBST([MAPI_PREFIX], [src/GLdispatch/vnd-glapi/mapi])
|
2013-08-12 22:12:10 +02:00
|
|
|
AC_SUBST([MAPI_MESA_PREFIX], [src/GLdispatch/mesa])
|
|
|
|
|
2013-08-12 22:12:09 +02:00
|
|
|
AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
|
|
|
|
AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
|
|
|
|
AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
2015-03-25 22:32:30 +01:00
|
|
|
AX_PTHREAD()
|
2013-08-12 22:12:09 +02:00
|
|
|
|
|
|
|
PKG_CHECK_MODULES([X11], [x11])
|
|
|
|
PKG_CHECK_MODULES([XEXT], [xext])
|
|
|
|
PKG_CHECK_MODULES([XORG], [xorg-server >= 1.11.0])
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_PATH_X
|
|
|
|
AC_CHECK_HEADERS([fcntl.h inttypes.h stddef.h stdlib.h string.h sys/param.h sys/time.h unistd.h])
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_TYPEOF
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_CHECK_TYPES([ptrdiff_t])
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_REALLOC
|
|
|
|
AC_FUNC_STRNLEN
|
|
|
|
AC_CHECK_FUNCS([getpagesize gettimeofday memmove memset strdup strerror])
|
|
|
|
|
|
|
|
dnl TLS detection
|
2015-03-25 22:32:30 +01:00
|
|
|
dnl Note: The x86 TLS build doesn't work yet. Fall back to the TSD version until it does.
|
2013-08-12 22:12:09 +02:00
|
|
|
AC_MSG_CHECKING([for initial-exec TLS])
|
2015-03-25 22:32:30 +01:00
|
|
|
if test "x$asm_arch" != xx86; then
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
|
|
|
__thread int foo __attribute__((tls_model("initial-exec")));
|
|
|
|
])],
|
|
|
|
[GLX_USE_TLS=yes],[GLX_USE_TLS=no])
|
|
|
|
else
|
|
|
|
GLX_USE_TLS=no
|
|
|
|
fi
|
2013-08-12 22:12:09 +02:00
|
|
|
|
|
|
|
AC_MSG_RESULT($GLX_USE_TLS)
|
|
|
|
AS_IF([test "x$GLX_USE_TLS" = "xyes"],
|
|
|
|
[AC_DEFINE([GLX_USE_TLS], 1,
|
|
|
|
[Define to 1 if ELF TLS with initial-exec addressing is available.])])
|
|
|
|
|
|
|
|
dnl default CFLAGS
|
|
|
|
CFLAGS="$CFLAGS -Wall -Werror -std=gnu99 -include config.h -fvisibility=hidden $DEFINES"
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
2013-08-23 01:20:01 +02:00
|
|
|
src/Makefile
|
2013-08-12 22:12:10 +02:00
|
|
|
src/GL/Makefile
|
|
|
|
src/OpenGL/Makefile
|
2013-08-23 01:20:01 +02:00
|
|
|
src/GLX/Makefile
|
2013-08-12 22:12:09 +02:00
|
|
|
src/x11glvnd/Makefile
|
2013-08-12 22:12:09 +02:00
|
|
|
src/GLdispatch/Makefile
|
2013-09-27 05:08:04 +02:00
|
|
|
src/GLdispatch/vnd-glapi/Makefile
|
2013-09-27 00:48:30 +02:00
|
|
|
src/util/Makefile
|
2013-08-12 22:12:09 +02:00
|
|
|
src/util/glvnd_pthread/Makefile
|
2013-08-12 22:12:10 +02:00
|
|
|
src/util/trace/Makefile
|
2013-08-12 22:12:10 +02:00
|
|
|
tests/Makefile
|
|
|
|
tests/GLX_dummy/Makefile])
|
2013-08-12 22:12:09 +02:00
|
|
|
AC_OUTPUT
|