Home | History | Annotate | Line # | Download | only in dist
configure.ac revision 1.1.1.1.18.3
      1  1.1.1.1.18.2  yamt #  Copyright 2005 Adam Jackson.
      2  1.1.1.1.18.2  yamt #
      3  1.1.1.1.18.2  yamt #  Permission is hereby granted, free of charge, to any person obtaining a
      4  1.1.1.1.18.2  yamt #  copy of this software and associated documentation files (the "Software"),
      5  1.1.1.1.18.2  yamt #  to deal in the Software without restriction, including without limitation
      6  1.1.1.1.18.2  yamt #  on the rights to use, copy, modify, merge, publish, distribute, sub
      7  1.1.1.1.18.2  yamt #  license, and/or sell copies of the Software, and to permit persons to whom
      8  1.1.1.1.18.2  yamt #  the Software is furnished to do so, subject to the following conditions:
      9  1.1.1.1.18.2  yamt #
     10  1.1.1.1.18.2  yamt #  The above copyright notice and this permission notice (including the next
     11  1.1.1.1.18.2  yamt #  paragraph) shall be included in all copies or substantial portions of the
     12  1.1.1.1.18.2  yamt #  Software.
     13  1.1.1.1.18.2  yamt #
     14  1.1.1.1.18.2  yamt #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15  1.1.1.1.18.2  yamt #  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16  1.1.1.1.18.2  yamt #  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
     17  1.1.1.1.18.2  yamt #  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
     18  1.1.1.1.18.2  yamt #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
     19  1.1.1.1.18.2  yamt #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     20  1.1.1.1.18.2  yamt 
     21  1.1.1.1.18.2  yamt AC_PREREQ(2.57)
     22  1.1.1.1.18.3  yamt AC_INIT([libdrm], 2.4.11, [dri-devel (a] lists.sourceforge.net], libdrm)
     23  1.1.1.1.18.2  yamt AC_CONFIG_SRCDIR([Makefile.am])
     24  1.1.1.1.18.2  yamt AM_INIT_AUTOMAKE([dist-bzip2])
     25  1.1.1.1.18.2  yamt 
     26  1.1.1.1.18.2  yamt AM_CONFIG_HEADER([libdrm/config.h])
     27  1.1.1.1.18.2  yamt 
     28  1.1.1.1.18.2  yamt AC_DISABLE_STATIC
     29  1.1.1.1.18.2  yamt AC_PROG_LIBTOOL
     30  1.1.1.1.18.2  yamt AC_PROG_CC
     31  1.1.1.1.18.2  yamt 
     32  1.1.1.1.18.2  yamt AC_HEADER_STDC
     33  1.1.1.1.18.2  yamt AC_SYS_LARGEFILE
     34  1.1.1.1.18.2  yamt 
     35  1.1.1.1.18.3  yamt PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
     36  1.1.1.1.18.3  yamt AC_SUBST(PTHREADSTUBS_CFLAGS)
     37  1.1.1.1.18.3  yamt AC_SUBST(PTHREADSTUBS_LIBS)
     38  1.1.1.1.18.3  yamt 
     39  1.1.1.1.18.2  yamt pkgconfigdir=${libdir}/pkgconfig
     40  1.1.1.1.18.2  yamt AC_SUBST(pkgconfigdir)
     41  1.1.1.1.18.3  yamt AC_ARG_ENABLE(udev,	AS_HELP_STRING([--enable-udev],
     42  1.1.1.1.18.3  yamt 				[Enable support for using udev instead of mknod (default: disabled)]),
     43  1.1.1.1.18.3  yamt 				[UDEV=$enableval], [UDEV=no])
     44  1.1.1.1.18.3  yamt 
     45  1.1.1.1.18.3  yamt AC_ARG_ENABLE(nouveau-experimental-api,
     46  1.1.1.1.18.3  yamt 	      AS_HELP_STRING([--enable-nouveau-experimental-api],
     47  1.1.1.1.18.3  yamt 	      [Enable support for nouveau's experimental API (default: disabled)]),
     48  1.1.1.1.18.3  yamt 	      [NOUVEAU=$enableval], [NOUVEAU=no])
     49  1.1.1.1.18.3  yamt 
     50  1.1.1.1.18.3  yamt dnl ===========================================================================
     51  1.1.1.1.18.3  yamt dnl check compiler flags
     52  1.1.1.1.18.3  yamt AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
     53  1.1.1.1.18.3  yamt   AC_MSG_CHECKING([whether $CC supports $1])
     54  1.1.1.1.18.3  yamt 
     55  1.1.1.1.18.3  yamt   libdrm_save_CFLAGS="$CFLAGS"
     56  1.1.1.1.18.3  yamt   CFLAGS="$CFLAGS $1"
     57  1.1.1.1.18.3  yamt 
     58  1.1.1.1.18.3  yamt   AC_COMPILE_IFELSE([ ], [libdrm_cc_flag=yes], [libdrm_cc_flag=no])
     59  1.1.1.1.18.3  yamt   CFLAGS="$libdrm_save_CFLAGS"
     60  1.1.1.1.18.3  yamt 
     61  1.1.1.1.18.3  yamt   if test "x$libdrm_cc_flag" = "xyes"; then
     62  1.1.1.1.18.3  yamt     ifelse([$2], , :, [$2])
     63  1.1.1.1.18.3  yamt   else
     64  1.1.1.1.18.3  yamt     ifelse([$3], , :, [$3])
     65  1.1.1.1.18.3  yamt   fi
     66  1.1.1.1.18.3  yamt   AC_MSG_RESULT([$libdrm_cc_flag])
     67  1.1.1.1.18.3  yamt ])
     68  1.1.1.1.18.3  yamt 
     69  1.1.1.1.18.3  yamt dnl We use clock_gettime to check for timeouts in drmWaitVBlank
     70  1.1.1.1.18.3  yamt 
     71  1.1.1.1.18.3  yamt AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
     72  1.1.1.1.18.3  yamt                [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
     73  1.1.1.1.18.3  yamt                              [AC_MSG_ERROR([Couldn't find clock_gettime])])])
     74  1.1.1.1.18.3  yamt AC_SUBST([CLOCK_LIB])
     75  1.1.1.1.18.3  yamt 
     76  1.1.1.1.18.3  yamt dnl Use lots of warning flags with with gcc and compatible compilers
     77  1.1.1.1.18.3  yamt 
     78  1.1.1.1.18.3  yamt dnl Note: if you change the following variable, the cache is automatically
     79  1.1.1.1.18.3  yamt dnl skipped and all flags rechecked.  So there's no need to do anything
     80  1.1.1.1.18.3  yamt dnl else.  If for any reason you need to force a recheck, just change
     81  1.1.1.1.18.3  yamt dnl MAYBE_WARN in an ignorable way (like adding whitespace)
     82  1.1.1.1.18.3  yamt 
     83  1.1.1.1.18.3  yamt MAYBE_WARN="-Wall -Wextra \
     84  1.1.1.1.18.3  yamt -Wsign-compare -Werror-implicit-function-declaration \
     85  1.1.1.1.18.3  yamt -Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
     86  1.1.1.1.18.3  yamt -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
     87  1.1.1.1.18.3  yamt -Wpacked -Wswitch-enum -Wmissing-format-attribute \
     88  1.1.1.1.18.3  yamt -Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
     89  1.1.1.1.18.3  yamt -Wdeclaration-after-statement -Wold-style-definition \
     90  1.1.1.1.18.3  yamt -Wno-missing-field-initializers -Wno-unused-parameter \
     91  1.1.1.1.18.3  yamt -Wno-attributes -Wno-long-long -Winline"
     92  1.1.1.1.18.3  yamt 
     93  1.1.1.1.18.3  yamt # invalidate cached value if MAYBE_WARN has changed
     94  1.1.1.1.18.3  yamt if test "x$libdrm_cv_warn_maybe" != "x$MAYBE_WARN"; then
     95  1.1.1.1.18.3  yamt 	unset libdrm_cv_warn_cflags
     96  1.1.1.1.18.3  yamt fi
     97  1.1.1.1.18.3  yamt AC_CACHE_CHECK([for supported warning flags], libdrm_cv_warn_cflags, [
     98  1.1.1.1.18.3  yamt 	echo
     99  1.1.1.1.18.3  yamt 	WARN_CFLAGS=""
    100  1.1.1.1.18.3  yamt 
    101  1.1.1.1.18.3  yamt 	# Some warning options are not supported by all versions of
    102  1.1.1.1.18.3  yamt 	# gcc, so test all desired options against the current
    103  1.1.1.1.18.3  yamt 	# compiler.
    104  1.1.1.1.18.3  yamt 	#
    105  1.1.1.1.18.3  yamt 	# Note that there are some order dependencies
    106  1.1.1.1.18.3  yamt 	# here. Specifically, an option that disables a warning will
    107  1.1.1.1.18.3  yamt 	# have no net effect if a later option then enables that
    108  1.1.1.1.18.3  yamt 	# warnings, (perhaps implicitly). So we put some grouped
    109  1.1.1.1.18.3  yamt 	# options (-Wall and -Wextra) up front and the -Wno options
    110  1.1.1.1.18.3  yamt 	# last.
    111  1.1.1.1.18.3  yamt 
    112  1.1.1.1.18.3  yamt 	for W in $MAYBE_WARN; do
    113  1.1.1.1.18.3  yamt 		LIBDRM_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
    114  1.1.1.1.18.3  yamt 	done
    115  1.1.1.1.18.3  yamt 
    116  1.1.1.1.18.3  yamt 	libdrm_cv_warn_cflags=$WARN_CFLAGS
    117  1.1.1.1.18.3  yamt 	libdrm_cv_warn_maybe=$MAYBE_WARN
    118  1.1.1.1.18.3  yamt 
    119  1.1.1.1.18.3  yamt 	AC_MSG_CHECKING([which warning flags were supported])])
    120  1.1.1.1.18.3  yamt WARN_CFLAGS="$libdrm_cv_warn_cflags"
    121  1.1.1.1.18.3  yamt 
    122  1.1.1.1.18.3  yamt if test "x$UDEV" = xyes; then
    123  1.1.1.1.18.3  yamt 	AC_DEFINE(UDEV, 1, [Have UDEV support])
    124  1.1.1.1.18.3  yamt fi
    125  1.1.1.1.18.3  yamt 
    126  1.1.1.1.18.3  yamt AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
    127  1.1.1.1.18.3  yamt 
    128  1.1.1.1.18.3  yamt PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
    129  1.1.1.1.18.3  yamt if test "x$HAVE_CAIRO" = xyes; then
    130  1.1.1.1.18.3  yamt 	AC_DEFINE(HAVE_CAIRO, 1, [Have cairo support])
    131  1.1.1.1.18.3  yamt fi
    132  1.1.1.1.18.3  yamt AM_CONDITIONAL(HAVE_CAIRO, [test "x$HAVE_CAIRO" = xyes])
    133  1.1.1.1.18.3  yamt 
    134  1.1.1.1.18.3  yamt # For enumerating devices in test case
    135  1.1.1.1.18.3  yamt PKG_CHECK_MODULES(LIBUDEV, libudev, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
    136  1.1.1.1.18.3  yamt if test "x$HAVE_LIBUDEV" = xyes; then
    137  1.1.1.1.18.3  yamt    	AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
    138  1.1.1.1.18.3  yamt fi
    139  1.1.1.1.18.3  yamt AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
    140  1.1.1.1.18.3  yamt 
    141  1.1.1.1.18.2  yamt 
    142  1.1.1.1.18.3  yamt AC_SUBST(WARN_CFLAGS)
    143  1.1.1.1.18.2  yamt AC_OUTPUT([
    144  1.1.1.1.18.2  yamt 	Makefile
    145  1.1.1.1.18.2  yamt 	libdrm/Makefile
    146  1.1.1.1.18.3  yamt 	libdrm/intel/Makefile
    147  1.1.1.1.18.3  yamt 	libdrm/nouveau/Makefile
    148  1.1.1.1.18.3  yamt 	libdrm/nouveau/libdrm_nouveau.pc
    149  1.1.1.1.18.2  yamt 	shared-core/Makefile
    150  1.1.1.1.18.2  yamt 	tests/Makefile
    151  1.1.1.1.18.3  yamt 	tests/modeprint/Makefile
    152  1.1.1.1.18.3  yamt 	tests/modetest/Makefile
    153  1.1.1.1.18.3  yamt 	libdrm.pc
    154  1.1.1.1.18.3  yamt 	libdrm_intel.pc])
    155