Mercurial > hg > octave-shane > gnulib-hg
annotate m4/minmax.m4 @ 17252:7a29ec33d6c5
missing @item
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Tue, 01 Jan 2013 09:17:08 -0800 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
13577
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
1 # minmax.m4 serial 4 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc. |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
13577
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
7 AC_PREREQ([2.53]) |
6122
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
8 |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 AC_DEFUN([gl_MINMAX], |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 [ |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 AC_REQUIRE([gl_PREREQ_MINMAX]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 ]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 # Prerequisites of lib/minmax.h. |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 AC_DEFUN([gl_PREREQ_MINMAX], |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 [ |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 gl_MINMAX_IN_HEADER([limits.h]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 gl_MINMAX_IN_HEADER([sys/param.h]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 ]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 dnl gl_MINMAX_IN_HEADER(HEADER) |
6120 | 22 dnl The parameter has to be a literal header name; it cannot be macro, |
6122
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
23 dnl nor a shell variable. (Because autoheader collects only AC_DEFINE |
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
24 dnl invocations with a literal macro name.) |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 AC_DEFUN([gl_MINMAX_IN_HEADER], |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 [ |
6122
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
27 m4_pushdef([header], AS_TR_SH([$1])) |
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
28 m4_pushdef([HEADER], AS_TR_CPP([$1])) |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 AC_CACHE_CHECK([whether <$1> defines MIN and MAX], |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 [gl_cv_minmax_in_]header, |
13577
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
31 [AC_COMPILE_IFELSE( |
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
32 [AC_LANG_PROGRAM( |
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
33 [[#include <$1> |
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
34 int x = MIN (42, 17);]], |
d53740f6f336
Modernize AC_TRY_COMPILE invocations.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
35 [[]])], |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 [gl_cv_minmax_in_]header[=yes], |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 [gl_cv_minmax_in_]header[=no])]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 if test $gl_cv_minmax_in_[]header = yes; then |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 [Define to 1 if <$1> defines the MIN and MAX macros.]) |
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 fi |
6122
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
42 m4_popdef([HEADER]) |
eb03242e56c7
Use m4_pushdef/m4_popdef and AS_TR_SH, AS_TR_CPP.
Bruno Haible <bruno@clisp.org>
parents:
6120
diff
changeset
|
43 m4_popdef([header]) |
5881
e7da59a08057
autoconf tests for the 'minmax' module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 ]) |