Tizen 2.0 Release
[external/tizen-coreutils.git] / m4 / posixver.m4
1 # posixver.m4 serial 9
2 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_POSIXVER],
8 [
9   AC_LIBOBJ([posixver])
10
11   AC_REQUIRE([gl_DEFAULT_POSIX2_VERSION])
12 ])
13
14 # Set the default level of POSIX conformance at configure-time.
15 # Build with `./configure DEFAULT_POSIX2_VERSION=199209 ...' to
16 # support the older version, thus preserving portability with
17 # scripts that use sort +1, tail +32, etc.
18 # Note however, that this breaks tools that might run commands
19 # like `sort +some-file' that conform with the newer standard.
20 AC_DEFUN([gl_DEFAULT_POSIX2_VERSION],
21 [
22   AC_MSG_CHECKING([for desired default level of POSIX conformance])
23   gl_default_posix2_version=none-specified
24   if test -n "$ac_cv_env_DEFAULT_POSIX2_VERSION_set"; then
25     gl_default_posix2_version=$ac_cv_env_DEFAULT_POSIX2_VERSION_value
26     AC_DEFINE_UNQUOTED(DEFAULT_POSIX2_VERSION,
27       $gl_default_posix2_version,
28       [Define the default level of POSIX conformance. The value is of
29        the form YYYYMM, specifying the year and month the standard was
30        adopted. If not defined here, it defaults to the value of
31        _POSIX2_VERSION in <unistd.h>. Define to 199209 to default to
32        POSIX 1003.2-1992, which makes standard programs like `head',
33        `tail', and `sort' accept obsolete options like `+10' and
34        `-10'. Define to 200112 to default to POSIX 1003.1-2001, which
35        makes these standard programs treat leading-`+' operands as
36        file names and require modern usages like `-n 10' instead of
37        `-10'. Whether defined here or not, the default can be
38        overridden at run time via the _POSIX2_VERSION environment
39        variable.])
40   fi
41   AC_MSG_RESULT($gl_default_posix2_version)
42   AC_ARG_VAR(
43     [DEFAULT_POSIX2_VERSION],
44     [POSIX version to default to; see 'config.hin'.])
45 ])