461
465
# Define the identity of the package.
462
466
dnl Distinguish between old-style and new-style calls.
464
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
468
[AC_DIAGNOSE([obsolete],
469
[$0: two- and three-arguments forms are deprecated.])
470
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465
471
AC_SUBST([PACKAGE], [$1])dnl
466
472
AC_SUBST([VERSION], [$2])],
467
473
[_AM_SET_OPTIONS([$1])dnl
468
474
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
476
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
470
478
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471
479
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472
480
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
474
482
_AM_IF_OPTION([no-define],,
475
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
483
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
484
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
478
486
# Some tools Automake needs.
479
487
AC_REQUIRE([AM_SANITY_CHECK])dnl
480
488
AC_REQUIRE([AC_ARG_PROGRAM])dnl
481
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482
AM_MISSING_PROG(AUTOCONF, autoconf)
483
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484
AM_MISSING_PROG(AUTOHEADER, autoheader)
485
AM_MISSING_PROG(MAKEINFO, makeinfo)
489
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
490
AM_MISSING_PROG([AUTOCONF], [autoconf])
491
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
492
AM_MISSING_PROG([AUTOHEADER], [autoheader])
493
AM_MISSING_PROG([MAKEINFO], [makeinfo])
486
494
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487
495
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
496
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
497
# For better backward compatibility. To be removed once Automake 1.9.x
498
# dies out for good. For more background, see:
499
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
500
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
501
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
489
502
# We need awk for the "check" target. The system "awk" is bad on
490
503
# some platforms.
491
504
AC_REQUIRE([AC_PROG_AWK])dnl
496
509
[_AM_PROG_TAR([v7])])])
497
510
_AM_IF_OPTION([no-dependencies],,
498
511
[AC_PROVIDE_IFELSE([AC_PROG_CC],
499
[_AM_DEPENDENCIES(CC)],
500
[define([AC_PROG_CC],
501
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
512
[_AM_DEPENDENCIES([CC])],
513
[m4_define([AC_PROG_CC],
514
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
502
515
AC_PROVIDE_IFELSE([AC_PROG_CXX],
503
[_AM_DEPENDENCIES(CXX)],
504
[define([AC_PROG_CXX],
505
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
516
[_AM_DEPENDENCIES([CXX])],
517
[m4_define([AC_PROG_CXX],
518
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
506
519
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
507
[_AM_DEPENDENCIES(OBJC)],
508
[define([AC_PROG_OBJC],
509
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
520
[_AM_DEPENDENCIES([OBJC])],
521
[m4_define([AC_PROG_OBJC],
522
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
523
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
524
[_AM_DEPENDENCIES([OBJCXX])],
525
[m4_define([AC_PROG_OBJCXX],
526
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
511
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
514
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
528
AC_REQUIRE([AM_SILENT_RULES])dnl
529
dnl The testsuite driver may need to know about EXEEXT, so add the
530
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
531
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
515
532
AC_CONFIG_COMMANDS_PRE(dnl
516
533
[m4_provide_if([_AM_COMPILER_EXEEXT],
517
534
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
520
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
536
# POSIX will say in a future version that running "rm -f" with no argument
537
# is OK; and we want to be able to make that assumption in our Makefile
538
# recipes. So use an aggressive probe to check that the usage we want is
539
# actually supported "in the wild" to an acceptable degree.
540
# See automake bug#10828.
541
# To make any issue more visible, cause the running configure to be aborted
542
# by default if the 'rm' program in use doesn't match our expectations; the
543
# user can still override this though.
544
if rm -f && rm -fr && rm -rf; then : OK; else
548
Your 'rm' program seems unable to run without file operands specified
549
on the command line, even when the '-f' option is present. This is contrary
550
to the behaviour of most rm programs out there, and not conforming with
551
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
553
Please tell bug-automake@gnu.org about your system, including the value
554
of your $PATH and any error possibly output before this message. This
555
can help us improve future automake versions.
558
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
559
echo 'Configuration will proceed anyway, since you have set the' >&2
560
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
564
Aborting the configuration process, to ensure you take notice of the issue.
566
You can download and install GNU coreutils to get an 'rm' implementation
567
that behaves properly: <http://www.gnu.org/software/coreutils/>.
569
If you want to complete the configuration process using your problematic
570
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
571
to "yes", and re-run configure.
574
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
578
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
521
579
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522
580
dnl mangled by Autoconf and run in a shell conditional statement.
523
581
m4_define([_AC_COMPILER_EXEEXT],
524
582
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
527
584
# When config.status generates a header, we must update the stamp-h file.
528
585
# This file resides in the same directory as the config header
529
586
# that is generated. The stamp files are numbered to have different names.
716
761
# Use eval to expand $SHELL
717
if eval "$MISSING --run true"; then
718
am_missing_run="$MISSING --run "
762
if eval "$MISSING --is-lightweight"; then
763
am_missing_run="$MISSING "
721
AC_MSG_WARN([`missing' script is too old or missing])
766
AC_MSG_WARN(['missing' script is too old or missing])
725
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
727
# This file is free software; the Free Software Foundation
728
# gives unlimited permission to copy and/or distribute it,
729
# with or without modifications, as long as this notice is preserved.
733
# Check for `mkdir -p'.
734
AC_DEFUN([AM_PROG_MKDIR_P],
735
[AC_PREREQ([2.60])dnl
736
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
737
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
738
dnl while keeping a definition of mkdir_p for backward compatibility.
739
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741
dnl Makefile.ins that do not define MKDIR_P, so we do our own
742
dnl adjustment using top_builddir (which is defined more often than
744
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
746
[[\\/$]]* | ?:[[\\/]]*) ;;
747
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
751
770
# Helper functions for option handling. -*- Autoconf -*-
753
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
772
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
755
774
# This file is free software; the Free Software Foundation
756
775
# gives unlimited permission to copy and/or distribute it,
757
776
# with or without modifications, as long as this notice is preserved.
761
778
# _AM_MANGLE_OPTION(NAME)
762
779
# -----------------------
763
780
AC_DEFUN([_AM_MANGLE_OPTION],
764
781
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
766
783
# _AM_SET_OPTION(NAME)
767
# ------------------------------
784
# --------------------
768
785
# Set option NAME. Presently that only means defining a flag for this option.
769
786
AC_DEFUN([_AM_SET_OPTION],
770
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
787
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
772
789
# _AM_SET_OPTIONS(OPTIONS)
773
# ----------------------------------
790
# ------------------------
774
791
# OPTIONS is a space-separated list of Automake options.
775
792
AC_DEFUN([_AM_SET_OPTIONS],
776
793
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
781
798
AC_DEFUN([_AM_IF_OPTION],
782
799
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
801
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
803
# This file is free software; the Free Software Foundation
804
# gives unlimited permission to copy and/or distribute it,
805
# with or without modifications, as long as this notice is preserved.
809
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
810
# to automatically call this.
811
AC_DEFUN([_AM_PROG_CC_C_O],
812
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
813
AC_REQUIRE_AUX_FILE([compile])dnl
816
[whether $CC understands -c and -o together],
818
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
819
# Make sure it works both with $CC and with simple cc.
820
# Following AC_PROG_CC_C_O, we do the test twice because some
821
# compilers refuse to overwrite an existing .o file with -o,
822
# though they will create one.
823
am_cv_prog_cc_c_o=yes
825
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
826
&& test -f conftest2.$ac_objext; then
835
if test "$am_cv_prog_cc_c_o" != yes; then
836
# Losing compiler, so override with the script.
837
# FIXME: It is wrong to rewrite CC.
838
# But if we don't then we get into trouble of one sort or another.
839
# A longer-term fix would be to have automake use am__CC in this case,
840
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
841
CC="$am_aux_dir/compile $CC"
845
# For backward compatibility.
846
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
848
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
850
# This file is free software; the Free Software Foundation
851
# gives unlimited permission to copy and/or distribute it,
852
# with or without modifications, as long as this notice is preserved.
854
# AM_RUN_LOG(COMMAND)
855
# -------------------
856
# Run COMMAND, save the exit status in ac_status, and log it.
857
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
858
AC_DEFUN([AM_RUN_LOG],
859
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
860
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
862
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
863
(exit $ac_status); }])
784
865
# Check to make sure that the build environment is sane. -*- Autoconf -*-
786
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787
# Free Software Foundation, Inc.
867
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
789
869
# This file is free software; the Free Software Foundation
790
870
# gives unlimited permission to copy and/or distribute it,
791
871
# with or without modifications, as long as this notice is preserved.
795
873
# AM_SANITY_CHECK
796
874
# ---------------
797
875
AC_DEFUN([AM_SANITY_CHECK],
798
876
[AC_MSG_CHECKING([whether build environment is sane])
801
echo timestamp > conftest.file
802
877
# Reject unsafe characters in $srcdir or the absolute working directory
803
878
# name. Accept space and tab only in the latter.
844
927
AC_MSG_ERROR([newly created file is older than distributed files!
845
928
Check your system clock])
931
# If we didn't sleep, we still need to ensure time stamps of config.status and
932
# generated files are strictly newer.
934
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
938
AC_CONFIG_COMMANDS_PRE(
939
[AC_MSG_CHECKING([that generated files are newer than configure])
940
if test -n "$am_sleep_pid"; then
941
# Hide warnings about reused PIDs.
942
wait $am_sleep_pid 2>/dev/null
944
AC_MSG_RESULT([done])])
849
# Copyright (C) 2009 Free Software Foundation, Inc.
948
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
851
950
# This file is free software; the Free Software Foundation
852
951
# gives unlimited permission to copy and/or distribute it,
853
952
# with or without modifications, as long as this notice is preserved.
857
954
# AM_SILENT_RULES([DEFAULT])
858
955
# --------------------------
859
956
# Enable less verbose build rules; with the default set to DEFAULT
860
# (`yes' being less verbose, `no' or empty being verbose).
957
# ("yes" being less verbose, "no" or empty being verbose).
861
958
AC_DEFUN([AM_SILENT_RULES],
862
[AC_ARG_ENABLE([silent-rules],
863
[ --enable-silent-rules less verbose build output (undo: `make V=1')
864
--disable-silent-rules verbose build output (undo: `make V=0')])
865
case $enable_silent_rules in
866
yes) AM_DEFAULT_VERBOSITY=0;;
867
no) AM_DEFAULT_VERBOSITY=1;;
868
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
959
[AC_ARG_ENABLE([silent-rules], [dnl
961
[--enable-silent-rules],
962
[less verbose build output (undo: "make V=1")])
964
[--disable-silent-rules],
965
[verbose build output (undo: "make V=0")])dnl
967
case $enable_silent_rules in @%:@ (((
968
yes) AM_DEFAULT_VERBOSITY=0;;
969
no) AM_DEFAULT_VERBOSITY=1;;
970
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
973
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
974
dnl do not support nested variable expansions.
975
dnl See automake bug#9928 and bug#10237.
977
AC_CACHE_CHECK([whether $am_make supports nested variables],
978
[am_cv_make_support_nested_variables],
979
[if AS_ECHO([['TRUE=$(BAR$(V))
985
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
986
am_cv_make_support_nested_variables=yes
988
am_cv_make_support_nested_variables=no
990
if test $am_cv_make_support_nested_variables = yes; then
991
dnl Using '$V' instead of '$(V)' breaks IRIX make.
993
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
995
AM_V=$AM_DEFAULT_VERBOSITY
996
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
999
AM_SUBST_NOTMAKE([AM_V])dnl
1000
AC_SUBST([AM_DEFAULT_V])dnl
1001
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
870
1002
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871
1003
AM_BACKSLASH='\'
872
1004
AC_SUBST([AM_BACKSLASH])dnl
873
1005
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
876
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1008
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
878
1010
# This file is free software; the Free Software Foundation
879
1011
# gives unlimited permission to copy and/or distribute it,
943
1071
# Substitute a variable $(am__untar) that extract such
944
1072
# a tarball read from stdin.
945
1073
# $(am__untar) < result.tar
946
1075
AC_DEFUN([_AM_PROG_TAR],
947
[# Always define AMTAR for backward compatibility.
948
AM_MISSING_PROG([AMTAR], [tar])
1076
[# Always define AMTAR for backward compatibility. Yes, it's still used
1077
# in the wild :-( We should find a proper way to deprecate it ...
1078
AC_SUBST([AMTAR], ['$${TAR-tar}'])
1080
# We'll loop over all known methods to create a tar archive until one works.
1081
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
949
1083
m4_if([$1], [v7],
950
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951
[m4_case([$1], [ustar],, [pax],,
952
[m4_fatal([Unknown tar format])])
953
AC_MSG_CHECKING([how to create a $1 tar archive])
954
# Loop over all known methods to create a tar archive until one works.
955
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957
# Do not fold the above two line into one, because Tru64 sh and
958
# Solaris sh will not grok spaces in the rhs of `-'.
959
for _am_tool in $_am_tools
963
for _am_tar in tar gnutar gtar;
965
AM_RUN_LOG([$_am_tar --version]) && break
967
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969
am__untar="$_am_tar -xf -"
972
# Must skip GNU tar: if it does not support --format= it doesn't create
973
# ustar tarball either.
974
(tar --version) >/dev/null 2>&1 && continue
975
am__tar='tar chf - "$$tardir"'
976
am__tar_='tar chf - "$tardir"'
980
am__tar='pax -L -x $1 -w "$$tardir"'
981
am__tar_='pax -L -x $1 -w "$tardir"'
985
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987
am__untar='cpio -i -H $1 -d'
996
# If the value was cached, stop now. We just wanted to have am__tar
998
test -n "${am_cv_prog_tar_$1}" && break
1000
# tar/untar a dummy directory, and stop if the command works
1003
echo GrepMe > conftest.dir/file
1004
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1006
if test -s conftest.tar; then
1007
AM_RUN_LOG([$am__untar <conftest.tar])
1008
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1013
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1084
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1088
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1089
# There is notably a 21 bits limit for the UID and the GID. In fact,
1090
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1092
am_max_uid=2097151 # 2^21 - 1
1093
am_max_gid=$am_max_uid
1094
# The $UID and $GID variables are not portable, so we need to resort
1095
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
1096
# below are definitely unexpected, so allow the users to see them
1097
# (that is, avoid stderr redirection).
1098
am_uid=`id -u || echo unknown`
1099
am_gid=`id -g || echo unknown`
1100
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1101
if test $am_uid -le $am_max_uid; then
1102
AC_MSG_RESULT([yes])
1107
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1108
if test $am_gid -le $am_max_gid; then
1109
AC_MSG_RESULT([yes])
1118
[m4_fatal([Unknown tar format])])
1120
AC_MSG_CHECKING([how to create a $1 tar archive])
1122
# Go ahead even if we have the value already cached. We do so because we
1123
# need to set the values for the 'am__tar' and 'am__untar' variables.
1124
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1126
for _am_tool in $_am_tools; do
1129
for _am_tar in tar gnutar gtar; do
1130
AM_RUN_LOG([$_am_tar --version]) && break
1132
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1133
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1134
am__untar="$_am_tar -xf -"
1137
# Must skip GNU tar: if it does not support --format= it doesn't create
1138
# ustar tarball either.
1139
(tar --version) >/dev/null 2>&1 && continue
1140
am__tar='tar chf - "$$tardir"'
1141
am__tar_='tar chf - "$tardir"'
1142
am__untar='tar xf -'
1145
am__tar='pax -L -x $1 -w "$$tardir"'
1146
am__tar_='pax -L -x $1 -w "$tardir"'
1150
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1151
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1152
am__untar='cpio -i -H $1 -d'
1161
# If the value was cached, stop now. We just wanted to have am__tar
1162
# and am__untar set.
1163
test -n "${am_cv_prog_tar_$1}" && break
1165
# tar/untar a dummy directory, and stop if the command works.
1168
echo GrepMe > conftest.dir/file
1169
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1171
if test -s conftest.tar; then
1172
AM_RUN_LOG([$am__untar <conftest.tar])
1173
AM_RUN_LOG([cat conftest.dir/file])
1174
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1179
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1180
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015
1182
AC_SUBST([am__tar])
1016
1183
AC_SUBST([am__untar])
1017
1184
]) # _AM_PROG_TAR
1186
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1188
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1190
# This program is free software; you can redistribute it and/or modify
1191
# it under the terms of the GNU General Public License as published by
1192
# the Free Software Foundation; either version 2 of the License, or
1193
# (at your option) any later version.
1195
# This program is distributed in the hope that it will be useful, but
1196
# WITHOUT ANY WARRANTY; without even the implied warranty of
1197
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1198
# General Public License for more details.
1200
# You should have received a copy of the GNU General Public License
1201
# along with this program; if not, write to the Free Software
1202
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1204
# As a special exception to the GNU General Public License, if you
1205
# distribute this file as part of a program that contains a
1206
# configuration script generated by Autoconf, you may include it under
1207
# the same distribution terms that you use for the rest of that program.
1209
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1210
# ----------------------------------
1211
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1212
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1213
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1214
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1215
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1216
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1218
if test -n "$PKG_CONFIG"; then
1219
_pkg_min_version=m4_default([$1], [0.9.0])
1220
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1221
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1222
AC_MSG_RESULT([yes])
1229
])# PKG_PROG_PKG_CONFIG
1231
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1233
# Check to see whether a particular set of modules exists. Similar
1234
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1237
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1238
# this or PKG_CHECK_MODULES is called, or make sure to call
1239
# PKG_CHECK_EXISTS manually
1240
# --------------------------------------------------------------
1241
AC_DEFUN([PKG_CHECK_EXISTS],
1242
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1243
if test -n "$PKG_CONFIG" && \
1244
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1245
m4_ifval([$2], [$2], [:])
1246
m4_ifvaln([$3], [else
1251
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1252
# ---------------------------------------------
1253
m4_define([_PKG_CONFIG],
1254
[if test -n "$$1"; then
1256
elif test -n "$PKG_CONFIG"; then
1257
PKG_CHECK_EXISTS([$3],
1258
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1265
# _PKG_SHORT_ERRORS_SUPPORTED
1266
# -----------------------------
1267
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1268
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1269
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1270
_pkg_short_errors_supported=yes
1272
_pkg_short_errors_supported=no
1274
])# _PKG_SHORT_ERRORS_SUPPORTED
1277
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1278
# [ACTION-IF-NOT-FOUND])
1281
# Note that if there is a possibility the first call to
1282
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1283
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1286
# --------------------------------------------------------------
1287
AC_DEFUN([PKG_CHECK_MODULES],
1288
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1289
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1290
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1293
AC_MSG_CHECKING([for $1])
1295
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1296
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1298
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1299
and $1[]_LIBS to avoid the need to call pkg-config.
1300
See the pkg-config man page for more details.])
1302
if test $pkg_failed = yes; then
1303
_PKG_SHORT_ERRORS_SUPPORTED
1304
if test $_pkg_short_errors_supported = yes; then
1305
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1307
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1309
# Put the nasty error message in config.log where it belongs
1310
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1312
ifelse([$4], , [AC_MSG_ERROR(dnl
1313
[Package requirements ($2) were not met:
1317
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1318
installed software in a non-standard prefix.
1322
[AC_MSG_RESULT([no])
1324
elif test $pkg_failed = untried; then
1325
ifelse([$4], , [AC_MSG_FAILURE(dnl
1326
[The pkg-config script could not be found or is too old. Make sure it
1327
is in your PATH or set the PKG_CONFIG environment variable to the full
1332
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1335
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1336
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1337
AC_MSG_RESULT([yes])
1338
ifelse([$3], , :, [$3])
1340
])# PKG_CHECK_MODULES
1019
1342
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1021
1344
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
2386
2803
# Checks for various brands of compilers and sets flags as appropriate:
2387
2804
# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2805
# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2388
2806
# clang compiler - sets CLANGCC to "yes"
2389
2807
# Intel compiler - sets INTELCC to "yes"
2390
2808
# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2392
2810
AC_DEFUN([XORG_COMPILER_BRAND], [
2393
AC_REQUIRE([AC_PROG_CC_C99])
2813
AC_REQUIRE([AC_PROG_CC_C99])
2816
AC_REQUIRE([AC_PROG_CXX])
2394
2819
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2395
2820
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2396
2821
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2397
2822
]) # XORG_COMPILER_BRAND
2824
# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2826
# Minimum version: 1.16.0
2828
# Test if the compiler works when passed the given flag as a command line argument.
2829
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
2830
# next flag in the list until there are no more options.
2832
# Note that this does not guarantee that the compiler supports the flag as some
2833
# compilers will simply ignore arguments that they do not understand, but we do
2834
# attempt to weed out false positives by using -Werror=unknown-warning-option and
2835
# -Werror=unused-command-line-argument
2837
AC_DEFUN([XORG_TESTSET_CFLAG], [
2838
m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2839
m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2841
AC_LANG_COMPILER_REQUIRE
2845
AC_REQUIRE([AC_PROG_CC_C99])
2846
define([PREFIX], [C])
2847
define([CACHE_PREFIX], [cc])
2848
define([COMPILER], [$CC])
2851
define([PREFIX], [CXX])
2852
define([CACHE_PREFIX], [cxx])
2853
define([COMPILER], [$CXX])
2857
[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
2859
if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
2860
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2861
AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
2862
[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
2863
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2864
[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
2865
[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
2866
[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
2867
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2870
if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
2871
if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
2872
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2874
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2875
AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
2876
[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
2877
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2878
[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
2879
[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
2880
[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
2881
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2885
m4_foreach([flag], m4_cdr($@), [
2886
if test $found = "no" ; then
2887
if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
2888
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2891
if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
2892
PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2895
PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
2897
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
2898
AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
2899
cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
2900
AC_CACHE_VAL($cacheid,
2901
[AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
2902
[eval $cacheid=yes],
2903
[eval $cacheid=no])])
2905
PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2907
eval supported=\$$cacheid
2908
AC_MSG_RESULT([$supported])
2909
if test "$supported" = "yes" ; then
2915
]) # XORG_TESTSET_CFLAG
2917
# XORG_COMPILER_FLAGS
2919
# Minimum version: 1.16.0
2921
# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2922
# arguments supported by the selected compiler which do NOT alter the generated
2923
# code. These arguments will cause the compiler to print various warnings
2924
# during compilation AND turn a conservative set of warnings into errors.
2926
# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2927
# future versions of util-macros as options are added to new compilers.
2929
AC_DEFUN([XORG_COMPILER_FLAGS], [
2930
AC_REQUIRE([XORG_COMPILER_BRAND])
2932
AC_ARG_ENABLE(selective-werror,
2933
AS_HELP_STRING([--disable-selective-werror],
2934
[Turn off selective compiler errors. (default: enabled)]),
2935
[SELECTIVE_WERROR=$enableval],
2936
[SELECTIVE_WERROR=yes])
2940
define([PREFIX], [C])
2943
define([PREFIX], [CXX])
2946
# -v is too short to test reliably with XORG_TESTSET_CFLAG
2947
if test "x$SUNCC" = "xyes"; then
2948
[BASE_]PREFIX[FLAGS]="-v"
2950
[BASE_]PREFIX[FLAGS]=""
2953
# This chunk of warnings were those that existed in the legacy CWARNFLAGS
2954
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2955
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2956
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2957
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2961
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2962
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2963
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2964
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2965
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
2966
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
2970
# This chunk adds additional warnings that could catch undesired effects.
2971
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2972
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2973
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2974
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2975
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2976
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2977
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2979
# These are currently disabled because they are noisy. They will be enabled
2980
# in the future once the codebase is sufficiently modernized to silence
2981
# them. For now, I don't want them to drown out the other warnings.
2982
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2983
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2984
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2986
# Turn some warnings into errors, so we don't accidently get successful builds
2987
# when there are problems that should be fixed.
2989
if test "x$SELECTIVE_WERROR" = "xyes" ; then
2990
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2991
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2992
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2993
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2994
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2995
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2996
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2997
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2998
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2999
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3000
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3001
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3002
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3004
AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
3005
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3006
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3007
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3008
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3009
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3010
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3011
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3012
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3013
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3014
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3015
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3016
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3017
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
3020
AC_SUBST([BASE_]PREFIX[FLAGS])
3021
]) # XORG_COMPILER_FLAGS
2399
3023
# XORG_CWARNFLAGS
2400
3024
# ---------------
2401
3025
# Minimum version: 1.2.0
3026
# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2403
3028
# Defines CWARNFLAGS to enable C compiler warnings.
3030
# This function is deprecated because it defines -fno-strict-aliasing
3031
# which alters the code generated by the compiler. If -fno-strict-aliasing
3032
# is needed, then it should be added explicitly in the module when
3033
# it is updated to use BASE_CFLAGS.
2405
3035
AC_DEFUN([XORG_CWARNFLAGS], [
2406
AC_REQUIRE([AC_PROG_CC_C99])
3036
AC_REQUIRE([XORG_COMPILER_FLAGS])
2407
3037
AC_REQUIRE([XORG_COMPILER_BRAND])
2408
if test "x$GCC" = xyes ; then
2409
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2410
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2411
-Wbad-function-cast -Wformat=2"
2412
case `$CC -dumpversion` in
2414
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2418
if test "x$SUNCC" = "xyes"; then
2422
AC_SUBST(CWARNFLAGS)
3040
CWARNFLAGS="$BASE_CFLAGS"
3041
if test "x$GCC" = xyes ; then
3042
CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3044
AC_SUBST(CWARNFLAGS)
2423
3047
]) # XORG_CWARNFLAGS
2425
3049
# XORG_STRICT_OPTION
2429
3053
# Add configure option to enable strict compilation flags, such as treating
2430
3054
# warnings as fatal errors.
2431
3055
# If --enable-strict-compilation is passed to configure, adds strict flags to
3056
# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2434
3058
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2435
3059
# when strict compilation is unconditionally desired.
2436
3060
AC_DEFUN([XORG_STRICT_OPTION], [
2437
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2438
AC_REQUIRE([AC_PROG_CC_C99])
2439
AC_REQUIRE([XORG_COMPILER_BRAND])
2440
3061
AC_REQUIRE([XORG_CWARNFLAGS])
3062
AC_REQUIRE([XORG_COMPILER_FLAGS])
2442
3064
AC_ARG_ENABLE(strict-compilation,
2443
3065
AS_HELP_STRING([--enable-strict-compilation],
2444
3066
[Enable all warnings from compiler and make them errors (default: disabled)]),
2445
3067
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2446
if test "x$GCC" = xyes ; then
2447
STRICT_CFLAGS="-pedantic -Werror"
2448
# Add -Werror=attributes if supported (gcc 4.2 & later)
2449
AC_MSG_CHECKING([if $CC supports -Werror=attributes])
2450
save_CFLAGS="$CFLAGS"
2451
CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
2452
AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
2453
[STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
2454
AC_MSG_RESULT([yes])],
2455
[AC_MSG_RESULT([no])])
2456
CFLAGS="$save_CFLAGS"
2457
elif test "x$SUNCC" = "xyes"; then
2458
STRICT_CFLAGS="-errwarn"
2459
elif test "x$INTELCC" = "xyes"; then
2460
STRICT_CFLAGS="-Werror"
3071
define([PREFIX], [C])
3074
define([PREFIX], [CXX])
3078
[STRICT_]PREFIX[FLAGS]=""
3079
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3080
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3082
# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3083
# activate it with -Werror, so we add it here explicitly.
3084
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2462
3086
if test "x$STRICT_COMPILE" = "xyes"; then
2463
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
3087
[BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3088
AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2465
AC_SUBST([STRICT_CFLAGS])
2466
AC_SUBST([CWARNFLAGS])
3090
AC_SUBST([STRICT_]PREFIX[FLAGS])
3091
AC_SUBST([BASE_]PREFIX[FLAGS])
3092
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2467
3093
]) # XORG_STRICT_OPTION
2469
3095
# XORG_DEFAULT_OPTIONS
2565
3192
AC_SUBST([CHANGELOG_CMD])
2566
3193
]) # XORG_CHANGELOG
2568
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
2570
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2572
# This program is free software; you can redistribute it and/or modify
2573
# it under the terms of the GNU General Public License as published by
2574
# the Free Software Foundation; either version 2 of the License, or
2575
# (at your option) any later version.
2577
# This program is distributed in the hope that it will be useful, but
2578
# WITHOUT ANY WARRANTY; without even the implied warranty of
2579
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2580
# General Public License for more details.
2582
# You should have received a copy of the GNU General Public License
2583
# along with this program; if not, write to the Free Software
2584
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2586
# As a special exception to the GNU General Public License, if you
2587
# distribute this file as part of a program that contains a
2588
# configuration script generated by Autoconf, you may include it under
2589
# the same distribution terms that you use for the rest of that program.
2591
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2592
# ----------------------------------
2593
AC_DEFUN([PKG_PROG_PKG_CONFIG],
2594
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2595
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2596
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2597
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2598
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2600
if test -n "$PKG_CONFIG"; then
2601
_pkg_min_version=m4_default([$1], [0.9.0])
2602
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2603
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2604
AC_MSG_RESULT([yes])
2611
])# PKG_PROG_PKG_CONFIG
2613
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2615
# Check to see whether a particular set of modules exists. Similar
2616
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2619
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2620
# this or PKG_CHECK_MODULES is called, or make sure to call
2621
# PKG_CHECK_EXISTS manually
2622
# --------------------------------------------------------------
2623
AC_DEFUN([PKG_CHECK_EXISTS],
2624
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2625
if test -n "$PKG_CONFIG" && \
2626
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2627
m4_ifval([$2], [$2], [:])
2628
m4_ifvaln([$3], [else
2633
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2634
# ---------------------------------------------
2635
m4_define([_PKG_CONFIG],
2636
[if test -n "$$1"; then
2638
elif test -n "$PKG_CONFIG"; then
2639
PKG_CHECK_EXISTS([$3],
2640
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2647
# _PKG_SHORT_ERRORS_SUPPORTED
2648
# -----------------------------
2649
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2650
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2651
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2652
_pkg_short_errors_supported=yes
2654
_pkg_short_errors_supported=no
2656
])# _PKG_SHORT_ERRORS_SUPPORTED
2659
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2660
# [ACTION-IF-NOT-FOUND])
2663
# Note that if there is a possibility the first call to
2664
# PKG_CHECK_MODULES might not happen, you should be sure to include an
2665
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2668
# --------------------------------------------------------------
2669
AC_DEFUN([PKG_CHECK_MODULES],
2670
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2671
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2672
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2675
AC_MSG_CHECKING([for $1])
2677
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2678
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2680
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2681
and $1[]_LIBS to avoid the need to call pkg-config.
2682
See the pkg-config man page for more details.])
2684
if test $pkg_failed = yes; then
2685
_PKG_SHORT_ERRORS_SUPPORTED
2686
if test $_pkg_short_errors_supported = yes; then
2687
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2689
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2691
# Put the nasty error message in config.log where it belongs
2692
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2694
ifelse([$4], , [AC_MSG_ERROR(dnl
2695
[Package requirements ($2) were not met:
2699
Consider adjusting the PKG_CONFIG_PATH environment variable if you
2700
installed software in a non-standard prefix.
2704
[AC_MSG_RESULT([no])
2706
elif test $pkg_failed = untried; then
2707
ifelse([$4], , [AC_MSG_FAILURE(dnl
2708
[The pkg-config script could not be found or is too old. Make sure it
2709
is in your PATH or set the PKG_CONFIG environment variable to the full
2714
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2717
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2718
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2719
AC_MSG_RESULT([yes])
2720
ifelse([$3], , :, [$3])
2722
])# PKG_CHECK_MODULES