Blame configure.ac

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