Mercurial > hg > octave-kai > gnulib-hg
annotate m4/clock_time.m4 @ 17476:6057744acd2c default tip master
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 16 Aug 2013 06:32:22 -0700 |
parents | e542fd46ad6f |
children |
rev | line source |
---|---|
12182
8ba00f285749
m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization
Jim Meyering <meyering@redhat.com>
parents:
12169
diff
changeset
|
1 # clock_time.m4 serial 10 |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4994
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4994
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4994
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
7683
40c3e7d43e2d
* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
Jim Meyering <jim@meyering.net>
parents:
6671
diff
changeset
|
7 # Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. |
40c3e7d43e2d
* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
Jim Meyering <jim@meyering.net>
parents:
6671
diff
changeset
|
8 # For a program named, say foo, you should add a line like the following |
40c3e7d43e2d
* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
Jim Meyering <jim@meyering.net>
parents:
6671
diff
changeset
|
9 # in the corresponding Makefile.am file: |
40c3e7d43e2d
* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
Jim Meyering <jim@meyering.net>
parents:
6671
diff
changeset
|
10 # foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) |
40c3e7d43e2d
* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
Jim Meyering <jim@meyering.net>
parents:
6671
diff
changeset
|
11 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 AC_DEFUN([gl_CLOCK_TIME], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 [ |
6671
5a2089992925
* modules/gettime (Depends-on): Add extensions module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5813
diff
changeset
|
14 dnl Persuade glibc and Solaris <time.h> to declare these functions. |
5a2089992925
* modules/gettime (Depends-on): Add extensions module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5813
diff
changeset
|
15 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
4994
6b28439c9a2d
(gl_CLOCK_TIME): Require AC_GNU_SOURCE.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4910
diff
changeset
|
16 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. |
4426 | 19 |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 # programs in the package would end up linked with that potentially-shared |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 # library, inducing unnecessary run-time overhead. |
12169
d9a855dec815
don't let environment settings perturb build
Jim Meyering <meyering@redhat.com>
parents:
11007
diff
changeset
|
23 LIB_CLOCK_GETTIME= |
12182
8ba00f285749
m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization
Jim Meyering <meyering@redhat.com>
parents:
12169
diff
changeset
|
24 AC_SUBST([LIB_CLOCK_GETTIME]) |
5813 | 25 gl_saved_libs=$LIBS |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7683
diff
changeset
|
26 AC_SEARCH_LIBS([clock_gettime], [rt posix4], |
4910 | 27 [test "$ac_cv_search_clock_gettime" = "none required" || |
28 LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) | |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7683
diff
changeset
|
29 AC_CHECK_FUNCS([clock_gettime clock_settime]) |
5813 | 30 LIBS=$gl_saved_libs |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 ]) |