# Process this file with autoconf to produce a configure script. AC_INIT(src/glitz.h) dnl =========================================================================== # Package version number, (as distinct from shared library version) # This must be manually synchronized with the version in src/glitz.h GLITZ_VERSION=0.4.2 # libtool shared library version # Increment if the interface has additions, changes, removals. LT_CURRENT=1 # Increment any time the source changes; set to # 0 if you increment CURRENT LT_REVISION=0 # Increment if any interfaces have been added; set to 0 # if any interfaces have been removed. removal has # precedence over adding, so set to 0 if both happened. LT_AGE=0 VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE" AC_SUBST(VERSION_INFO) dnl =========================================================================== AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(glitz, $GLITZ_VERSION) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_PROG_CPP AC_PROG_AWK AM_PROG_LIBTOOL AC_STDC_HEADERS if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[[\ \ ]]-Wall[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac case " $CFLAGS " in *[[\ \ ]]-Wpointer-arith[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wpointer-arith" ;; esac case " $CFLAGS " in *[[\ \ ]]-Wstrict-prototypes[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wstrict-prototypes" ;; esac case " $CFLAGS " in *[[\ \ ]]-Wmissing-prototypes[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;; esac case " $CFLAGS " in *[[\ \ ]]-Wmissing-declarations[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac case " $CFLAGS " in *[[\ \ ]]-Wnested-externs[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -Wnested-externs" ;; esac case " $CFLAGS " in *[[\ \ ]]-fno-strict-aliasing[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -fno-strict-aliasing" ;; esac if test "x$enable_ansi" = "xyes"; then case " $CFLAGS " in *[[\ \ ]]-ansi[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -ansi" ;; esac case " $CFLAGS " in *[[\ \ ]]-pedantic[[\ \ ]]*) ;; *) CFLAGS="$CFLAGS -pedantic" ;; esac fi fi AC_C_BIGENDIAN dnl =========================================================================== GLITZ_LIB='-L$(top_builddir)/src -lglitz' GLITZ_INC='-I$(top_builddir)/src -I$(top_srcdir)/src' AC_SUBST(GLITZ_LIB) AC_SUBST(GLITZ_INC) dnl =========================================================================== AC_ARG_ENABLE(glx, AC_HELP_STRING([--disable-glx], [Disable glitz's GLX backend]), [use_glx=$enableval], [use_glx=yes]) AH_TEMPLATE([XTHREADS], [Define if Xlib supports XTHREADS]) if test "x$use_glx" = "xyes"; then AC_PATH_XTRA if test "x$have_x" = "xyes"; then GLX_LIBS="$X_LIBS -lX11 -lGL" GLX_CFLAGS="$X_CFLAGS" save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $GLX_CFLAGS" LIBS="$LIBS $GLX_LIBS" AC_MSG_CHECKING([for XTHREADS in Xlib]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[return XInitThreads() == 0 ? 0 : 1;]])], [xthreads=no], [xthreads=yes], [xthreads=yes]) AC_MSG_RESULT($xthreads) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" if test "x$xthreads" = "xyes" then GLX_LIBS="$GLX_LIBS -lpthread" AC_DEFINE(XTHREADS, 1) fi use_glx="yes" else use_glx="no" fi fi if test "x$use_glx" = "xyes"; then AM_CONDITIONAL(GLITZ_BUILD_GLX_BACKEND, true) else AM_CONDITIONAL(GLITZ_BUILD_GLX_BACKEND, false) fi AC_SUBST(GLX_CFLAGS) AC_SUBST(GLX_LIBS) dnl =========================================================================== AC_ARG_ENABLE(agl, AC_HELP_STRING([--disable-agl], [Disable glitz's AGL backend]), [use_agl=$enableval], [use_agl=yes]) AH_TEMPLATE([PTHREADS], [Define if PTHREADS are supported]) if test "x$use_agl" = "xyes"; then AC_MSG_CHECKING([for AGL.framework]) save_libs="$LIBS" LIBS="-framework AGL" AC_TRY_LINK_FUNC(aglCreateContext, [use_agl=yes], [use_agl=no]) LIBS="$save_libs" AC_MSG_RESULT([$use_agl]) if test "x$use_agl" = "xyes"; then save_libs="$LIBS" LIBS="-lpthread" AC_MSG_CHECKING([for PTHREADS]) AC_TRY_LINK_FUNC(pthread_key_create, [use_pthreads=yes], [use_pthreads=no]) LIBS="$save_LIBS" if test "x$use_pthreads" = "xyes" then AGL_LIBS="$AGL_LIBS -lpthread" AC_DEFINE(PTHREADS, 1) fi AC_MSG_RESULT($use_pthreads) fi fi if test "x$use_agl" = "xyes"; then AM_CONDITIONAL(GLITZ_BUILD_AGL_BACKEND, true) else AM_CONDITIONAL(GLITZ_BUILD_AGL_BACKEND, false) fi AC_SUBST(AGL_CFLAGS) AC_SUBST(AGL_LIBS) dnl =========================================================================== AC_OUTPUT([ Makefile src/Makefile src/glx/Makefile src/agl/Makefile src/glitz.pc src/glx/glitz-glx.pc src/agl/glitz-agl.pc ]) dnl =========================================================================== echo "" echo "glitz will be compiled with the following backends:" echo " GLX: $use_glx" echo " AGL: $use_agl" echo ""