Blame configure.ac

Packit Service 7a208c
# Copyright © 2011 Intel Corporation
Packit Service 7a208c
#
Packit Service 7a208c
# Permission is hereby granted, free of charge, to any person obtaining a
Packit Service 7a208c
# copy of this software and associated documentation files (the "Software"),
Packit Service 7a208c
# to deal in the Software without restriction, including without limitation
Packit Service 7a208c
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit Service 7a208c
# and/or sell copies of the Software, and to permit persons to whom the
Packit Service 7a208c
# Software is furnished to do so, subject to the following conditions:
Packit Service 7a208c
#
Packit Service 7a208c
# The above copyright notice and this permission notice (including the next
Packit Service 7a208c
# paragraph) shall be included in all copies or substantial portions of the
Packit Service 7a208c
# Software.
Packit Service 7a208c
#
Packit Service 7a208c
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 7a208c
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 7a208c
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit Service 7a208c
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit Service 7a208c
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
Packit Service 7a208c
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
Packit Service 7a208c
# IN THE SOFTWARE.
Packit Service 7a208c
Packit Service 7a208c
dnl Process this file with autoconf to create configure.
Packit Service 7a208c
Packit Service 7a208c
AC_PREREQ([2.59])
Packit Service 7a208c
AC_INIT([glw], [8.0.0],
Packit Service 7a208c
    [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Packit Service 7a208c
AC_CANONICAL_HOST
Packit Service 7a208c
Packit Service 7a208c
AM_INIT_AUTOMAKE([dist-bzip2])
Packit Service 7a208c
Packit Service 7a208c
dnl Check for progs
Packit Service 7a208c
AC_PROG_CPP
Packit Service 7a208c
AC_PROG_CC
Packit Service 7a208c
AC_PROG_LIBTOOL
Packit Service 7a208c
AM_PROG_CC_C_O
Packit Service 7a208c
Packit Service 7a208c
# Enable quiet compiles on automake 1.11.
Packit Service 7a208c
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Packit Service 7a208c
Packit Service 7a208c
dnl Make sure the pkg-config macros are defined
Packit Service 7a208c
m4_ifndef([PKG_PROG_PKG_CONFIG],
Packit Service 7a208c
    [m4_fatal([Could not locate the pkg-config autoconf macros.
Packit Service 7a208c
  These are usually located in /usr/share/aclocal/pkg.m4. If your macros
Packit Service 7a208c
  are in a different location, try setting the environment variable
Packit Service 7a208c
  ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Packit Service 7a208c
PKG_PROG_PKG_CONFIG()
Packit Service 7a208c
Packit Service 7a208c
AC_ARG_ENABLE([motif],
Packit Service 7a208c
    [AS_HELP_STRING([--enable-motif],
Packit Service 7a208c
        [use Motif widgets @<:@default=disabled@:>@])],
Packit Service 7a208c
    [enable_motif="$enableval"],
Packit Service 7a208c
    [enable_motif=no])
Packit Service 7a208c
AM_CONDITIONAL([ENABLE_MOTIF], [test "$enable_motif" = yes])
Packit Service 7a208c
Packit Service 7a208c
dnl Get the pkg-config definitions for libGL.  We include a fallback
Packit Service 7a208c
dnl path for GL implementation that don't provide a .pc file
Packit Service 7a208c
PKG_CHECK_MODULES(GL, [gl], [], [
Packit Service 7a208c
		  AC_CHECK_HEADER([GL/gl.h],
Packit Service 7a208c
				  [],
Packit Service 7a208c
				  AC_MSG_ERROR([GL not found]))
Packit Service 7a208c
		  AC_CHECK_LIB([GL],
Packit Service 7a208c
			       [glBegin],
Packit Service 7a208c
			       [GL_LIBS=-lGL],
Packit Service 7a208c
			       AC_MSG_ERROR([GL required]))
Packit Service 7a208c
		  ])
Packit Service 7a208c
Packit Service 7a208c
PKG_CHECK_MODULES([GLW],[x11 xt])
Packit Service 7a208c
Packit Service 7a208c
MOTIF_CFLAGS=
Packit Service 7a208c
if test "x$enable_motif" = xyes; then
Packit Service 7a208c
    AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
Packit Service 7a208c
    if test "x$MOTIF_CONFIG" != xno; then
Packit Service 7a208c
        MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
Packit Service 7a208c
        MOTIF_LIBS=`$MOTIF_CONFIG --libs`
Packit Service 7a208c
    else
Packit Service 7a208c
        AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
Packit Service 7a208c
            [AC_MSG_ERROR([Can't locate Motif headers])])
Packit Service 7a208c
        AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
Packit Service 7a208c
            [AC_MSG_ERROR([Can't locate Motif Xm library])])
Packit Service 7a208c
    fi
Packit Service 7a208c
    # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
Packit Service 7a208c
    GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
Packit Service 7a208c
    GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Packit Service 7a208c
fi
Packit Service 7a208c
Packit Service 7a208c
AC_SUBST([GLW_PC_LIB_PRIV])
Packit Service 7a208c
AC_SUBST([GLW_PC_CFLAGS])
Packit Service 7a208c
Packit Service 7a208c
CFLAGS="$CFLAGS $GL_CFLAGS"
Packit Service 7a208c
LIBS="$LIBS $GL_LIBS $MOTIF_LIBS"
Packit Service 7a208c
Packit Service 7a208c
dnl Set up C warning flags.  Copy of XORG_CWARNFLAGS.
Packit Service 7a208c
if  test "x$GCC" = xyes ; then
Packit Service 7a208c
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
Packit Service 7a208c
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
Packit Service 7a208c
-Wbad-function-cast"
Packit Service 7a208c
    case `$CC -dumpversion` in
Packit Service 7a208c
    3.4.* | 4.*)
Packit Service 7a208c
	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
Packit Service 7a208c
	;;
Packit Service 7a208c
    esac
Packit Service 7a208c
else
Packit Service 7a208c
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
Packit Service 7a208c
    if test "x$SUNCC" = "xyes"; then
Packit Service 7a208c
	CWARNFLAGS="-v"
Packit Service 7a208c
    fi
Packit Service 7a208c
fi
Packit Service 7a208c
CFLAGS="$CFLAGS $CWARNFLAGS"
Packit Service 7a208c
Packit Service 7a208c
PKG_CHECK_MODULES(X11, [x11 xext], [x11_enabled=yes], [enable_x11=no])
Packit Service 7a208c
Packit Service 7a208c
AC_CONFIG_FILES([glw.pc])
Packit Service 7a208c
AC_OUTPUT([
Packit Service 7a208c
	Makefile
Packit Service 7a208c
])