From 235c280489cea3cc1272f9c9b0f6966791274712 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 6 Jul 2012 23:56:05 +0200 Subject: [PATCH] Use `clock-time' directly from Gnulib, but with a local patch. This is equivalent to the previous situation, but more easily maintainable. * acinclude.m4 (gl_CLOCK_TIME): Remove. * configure.ac: Remove explicit use of `gl_CLOCK_TIME'. * m4/gnulib-cache.m4 (gl_MODULES): Add `clock-time'. * gnulib-local/m4/clock_time.m4.diff: New file. * Makefile.am (EXTRA_DIST): Add it. --- Makefile.am | 3 ++- acinclude.m4 | 39 ------------------------------ configure.ac | 6 ----- gnulib-local/m4/clock_time.m4.diff | 28 +++++++++++++++++++++ lib/Makefile.am | 3 ++- libguile/Makefile.am | 2 +- m4/gnulib-cache.m4 | 3 ++- m4/gnulib-comp.m4 | 3 +++ 8 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 gnulib-local/m4/clock_time.m4.diff diff --git a/Makefile.am b/Makefile.am index 7eecd7344..a8e30c656 100644 --- a/Makefile.am +++ b/Makefile.am @@ -48,7 +48,8 @@ EXTRA_DIST = LICENSE HACKING GUILE-VERSION \ ChangeLog-2008 \ .version \ gnulib-local/lib/localcharset.h.diff \ - gnulib-local/lib/localcharset.c.diff + gnulib-local/lib/localcharset.c.diff \ + gnulib-local/m4/clock_time.m4.diff TESTS = check-guile TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ diff --git a/acinclude.m4 b/acinclude.m4 index 0edd4b8b2..8ef6e99ec 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -583,42 +583,3 @@ AC_DEFUN([GUILE_CHECK_GUILE_FOR_BUILD], [ dnl Declare file $1 to be a script that needs configuring, dnl and arrange to make it executable in the process. AC_DEFUN([GUILE_CONFIG_SCRIPT],[AC_CONFIG_FILES([$1],[chmod +x $1])]) - - -dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. -# For a program named, say foo, you should add a line like the following -# in the corresponding Makefile.am file: -# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) - -AC_DEFUN([gl_CLOCK_TIME], -[ - dnl Persuade glibc and Solaris to declare these functions. - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - - # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. - # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. - - # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* - # programs in the package would end up linked with that potentially-shared - # library, inducing unnecessary run-time overhead. - LIB_CLOCK_GETTIME= - AC_SUBST([LIB_CLOCK_GETTIME]) - gl_saved_libs=$LIBS - AC_SEARCH_LIBS([clock_gettime], [rt posix4], - [if test "$ac_cv_search_clock_gettime" = "none required"; then - AC_SEARCH_LIBS([clock_getcpuclockid], [rt posix4], - [test "$ac_cv_search_clock_getcpuclockid" = "none required" \ - || LIB_CLOCK_GETTIME=$ac_cv_search_clock_getcpuclockid], - [test "$ac_cv_search_clock_gettime" = "none required" \ - || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) - else - LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime - fi]) - AC_CHECK_FUNCS([clock_gettime clock_settime clock_getcpuclockid]) - LIBS=$gl_saved_libs -]) diff --git a/configure.ac b/configure.ac index 0eb937c13..af7c3a8ce 100644 --- a/configure.ac +++ b/configure.ac @@ -67,12 +67,6 @@ AC_PROG_LN_S dnl Gnulib. gl_INIT -dnl FIXME: remove me and the acinclude.m4 code when clock-gettime is -dnl fixed for clock_getcpuclockid and can be imported normally from -dnl gnulib. See -dnl -dnl for details. -gl_CLOCK_TIME AC_PROG_CC_C89 diff --git a/gnulib-local/m4/clock_time.m4.diff b/gnulib-local/m4/clock_time.m4.diff new file mode 100644 index 000000000..57d34e19c --- /dev/null +++ b/gnulib-local/m4/clock_time.m4.diff @@ -0,0 +1,28 @@ +Remove when clock-gettime is fixed for clock_getcpuclockid. + +See +for details. + +diff --git a/m4/clock_time.m4 b/m4/clock_time.m4 +index 0bec0ef..fb3a17a 100644 +--- a/m4/clock_time.m4 ++++ b/m4/clock_time.m4 +@@ -24,8 +24,15 @@ AC_DEFUN([gl_CLOCK_TIME], + AC_SUBST([LIB_CLOCK_GETTIME]) + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt posix4], +- [test "$ac_cv_search_clock_gettime" = "none required" || +- LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) +- AC_CHECK_FUNCS([clock_gettime clock_settime]) ++ [if test "$ac_cv_search_clock_gettime" = "none required"; then ++ AC_SEARCH_LIBS([clock_getcpuclockid], [rt posix4], ++ [test "$ac_cv_search_clock_getcpuclockid" = "none required" \ ++ || LIB_CLOCK_GETTIME=$ac_cv_search_clock_getcpuclockid], ++ [test "$ac_cv_search_clock_gettime" = "none required" \ ++ || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) ++ else ++ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime ++ fi]) ++ AC_CHECK_FUNCS([clock_gettime clock_settime clock_getcpuclockid]) + LIBS=$gl_saved_libs + ]) diff --git a/lib/Makefile.am b/lib/Makefile.am index f6680d680..8602e1340 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect dirfd duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe2 putenv recv recvfrom regex rename send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe2 putenv recv recvfrom regex rename send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -61,6 +61,7 @@ libgnu_la_LDFLAGS += $(ISNANF_LIBM) libgnu_la_LDFLAGS += $(ISNANL_LIBM) libgnu_la_LDFLAGS += $(LDEXP_LIBM) libgnu_la_LDFLAGS += $(LIBSOCKET) +libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME) libgnu_la_LDFLAGS += $(LOG1P_LIBM) libgnu_la_LDFLAGS += $(LOG_LIBM) libgnu_la_LDFLAGS += $(LTLIBICONV) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index a7644d194..e2164354d 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -477,8 +477,8 @@ libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS = \ $(ISNANF_LIBM) \ $(ISNANL_LIBM) \ $(LDEXP_LIBM) \ - $(LIB_CLOCK_GETTIME) \ $(LIBSOCKET) \ + $(LIB_CLOCK_GETTIME) \ $(LOG1P_LIBM) \ $(LOG_LIBM) \ $(LTLIBICONV) \ diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 7b6644a26..654224f5e 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect dirfd duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe2 putenv recv recvfrom regex rename send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar +# gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe2 putenv recv recvfrom regex rename send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gnulib-local]) @@ -41,6 +41,7 @@ gl_MODULES([ byteswap canonicalize-lgpl ceil + clock-time close connect dirfd diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index e59aa51c3..13bf4e8ad 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -56,6 +56,7 @@ AC_DEFUN([gl_EARLY], # Code from module canonicalize-lgpl: # Code from module ceil: # Code from module chdir: + # Code from module clock-time: # Code from module close: # Code from module configmake: # Code from module connect: @@ -265,6 +266,7 @@ if test $REPLACE_CEIL = 1; then fi gl_MATH_MODULE_INDICATOR([ceil]) gl_UNISTD_MODULE_INDICATOR([chdir]) +gl_CLOCK_TIME gl_FUNC_CLOSE if test $REPLACE_CLOSE = 1; then AC_LIBOBJ([close]) @@ -1049,6 +1051,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/canonicalize.m4 m4/ceil.m4 m4/check-math-lib.m4 + m4/clock_time.m4 m4/close.m4 m4/codeset.m4 m4/configmake.m4 -- 2.20.1