summaryrefslogtreecommitdiff
path: root/util-macros/xorg-macros.m4.in
diff options
context:
space:
mode:
Diffstat (limited to 'util-macros/xorg-macros.m4.in')
-rw-r--r--util-macros/xorg-macros.m4.in50
1 files changed, 47 insertions, 3 deletions
diff --git a/util-macros/xorg-macros.m4.in b/util-macros/xorg-macros.m4.in
index bcf8c44..8875193 100644
--- a/util-macros/xorg-macros.m4.in
+++ b/util-macros/xorg-macros.m4.in
@@ -319,7 +319,7 @@ AC_SUBST(MAKE_HTML)
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
AC_ARG_ENABLE(malloc0returnsnull,
- AC_HELP_STRING([--enable-malloc0returnsnull],
+ AS_HELP_STRING([--enable-malloc0returnsnull],
[malloc(0) returns NULL (default: auto)]),
[MALLOC_ZERO_RETURNS_NULL=$enableval],
[MALLOC_ZERO_RETURNS_NULL=auto])
@@ -371,7 +371,7 @@ AC_SUBST([XTMALLOC_ZERO_CFLAGS])
AC_DEFUN([XORG_WITH_LINT],[
# Allow checking code with lint, sparse, etc.
-AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
[Use a lint-style source code checker (default: disabled)])],
[use_lint=$withval], [use_lint=no])
if test "x$use_lint" = "xyes" ; then
@@ -412,7 +412,7 @@ AM_CONDITIONAL(LINT, [test x$LINT != xno])
AC_DEFUN([XORG_LINT_LIBRARY],[
AC_REQUIRE([XORG_WITH_LINT])
# Build lint "library" for more indepth checks of programs calling this library
-AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
[Create lint library (default: disabled)])],
[make_lint_lib=$enableval], [make_lint_lib=no])
if test "x$make_lint_lib" != "xno" ; then
@@ -454,4 +454,48 @@ else
fi
fi
AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+ AS_HELP_STRING([--enable-strict-compilation],
+ [Enable all warnings from compiler and make them errors (default: disabled)]),
+ [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+ if test "x$GCC" = xyes ; then
+ STRICT_CFLAGS="-pedantic -Werror"
+ elif test "x$SUNCC" = "xyes"; then
+ STRICT_CFLAGS="-errwarn"
+ elif test "x$INTELCC" = "xyes"; then
+ STRICT_CFLAGS="-Werror"
+ fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS