bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving getloadavg and fnmatch from Autoconf to Gnulib (1/2)


From: Paul Eggert
Subject: Re: moving getloadavg and fnmatch from Autoconf to Gnulib (1/2)
Date: Fri, 01 Sep 2006 12:56:22 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Sounds a bit like you'd like to break things at a later point again...
> ;-)

Yes, most likely.  But fixing it "right" would take quite some time....

> AN_FUNCTION isn't public interface of Autoconf.

Right; removed.

> This `gl_GETLOADAVG' will appear in the output, and will upset the
> m4_pattern_forbid that gnulib-tool adds (untested).

OK, I changed that.

> FWIW, no need for the semi-colons before the newlines in the script
> (but IIRC they shouldn't hurt either).

OK, removed.

I noticed also that it used m4_define where it should probably use
AC_DEFUN.  I installed this:

2006-09-01  Paul Eggert  <address@hidden>

        * lib/getloadavg.c: Use CONFIGURING_GETLOADAVG, not gl_GETLOADAVG.
        Problem reported by Ralf Wildenhues in
        <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
        * m4/getloadavg.m4 (gl_GETLOADAVG): Use CONFIGURING_GETLOADAVG,
        not gl_GETLOADAVG.  Omit unneeded semicolons.
        Problems reported by Ralf Wildenhues in
        <http://lists.gnu.org/archive/html/bug-gnulib/2006-09/msg00000.html>.
        (gl_PREREQ_GETLOADAVG): Use AC_DEFUN, not m4_define.  Put
        at the end, which is the usual gnulib style.

Index: lib/getloadavg.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getloadavg.c,v
retrieving revision 1.32
diff -p -u -r1.32 getloadavg.c
--- lib/getloadavg.c    31 Aug 2006 22:29:00 -0000      1.32
+++ lib/getloadavg.c    1 Sep 2006 19:51:01 -0000
@@ -81,16 +81,16 @@
    We also #define LDAV_PRIVILEGED if a program will require
    special installation to be able to call getloadavg.  */
 
-/* "configure" defines gl_GETLOADAVG to sidestep problems with
-   partially-configured source directories.  */
+/* "configure" defines CONFIGURING_GETLOADAVG to sidestep problems
+   with partially-configured source directories.  */
 
 #ifdef HAVE_CONFIG_H
-# ifndef gl_GETLOADAVG
+# ifndef CONFIGURING_GETLOADAVG
 #  include <config.h>
 # endif
 #endif
 
-#ifndef gl_GETLOADAVG
+#ifndef CONFIGURING_GETLOADAVG
 # include <stdbool.h>
 #endif
 
Index: m4/getloadavg.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/getloadavg.m4,v
retrieving revision 1.16
diff -p -u -r1.16 getloadavg.m4
--- m4/getloadavg.m4    31 Aug 2006 22:29:01 -0000      1.16
+++ m4/getloadavg.m4    1 Sep 2006 19:51:01 -0000
@@ -10,59 +10,8 @@
 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
 # New applications should use gl_GETLOADAVG instead.
 
-# gl_PREREQ_GETLOADAVG
-# --------------------
-# Set up the AC_LIBOBJ replacement of `getloadavg'.
-m4_define([gl_PREREQ_GETLOADAVG],
-[AC_LIBOBJ(getloadavg)
-AC_DEFINE(C_GETLOADAVG, 1, [Define to 1 if using `getloadavg.c'.])
-# Figure out what our getloadavg.c needs.
-gl_have_func=no
-AC_CHECK_HEADER(sys/dg_sys_info.h,
-[gl_have_func=yes
- AC_DEFINE(DGUX, 1, [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
- AC_CHECK_LIB(dgc, dg_sys_info)])
-
-# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
-# uses stabs), but it is still SVR4.  We cannot check for <elf.h> because
-# Irix 4.0.5F has the header but not the library.
-if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
-  gl_have_func=yes
-  AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.])
-fi
-
-if test $gl_have_func = no; then
-  AC_CHECK_HEADER(inq_stats/cpustats.h,
-  [gl_have_func=yes
-   AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.])
-   AC_DEFINE(UMAX4_3, 1,
-            [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
-             instead of <sys/cpustats.h>.])])
-fi
-
-if test $gl_have_func = no; then
-  AC_CHECK_HEADER(sys/cpustats.h,
-  [gl_have_func=yes; AC_DEFINE(UMAX)])
-fi
-
-if test $gl_have_func = no; then
-  AC_CHECK_HEADERS(mach/mach.h)
-fi
-
-AC_CHECK_HEADERS(nlist.h,
-[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
-                 [AC_DEFINE(NLIST_NAME_UNION, 1,
-                            [Define to 1 if your `struct nlist' has an
-                             `n_un' member.  Obsolete, depend on
-                             `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
-                 address@hidden:@include <nlist.h>])
-])dnl
-])# gl_PREREQ_GETLOADAVG
-
-
 # gl_GETLOADAVG
 # -------------
-AN_FUNCTION([getloadavg], [gl_GETLOADAVG])
 AC_DEFUN([gl_GETLOADAVG],
 [gl_have_func=no # yes means we've found a way to get the load average.
 
@@ -114,7 +63,7 @@ AC_CHECK_FUNCS(getloadavg, [],
 AC_CACHE_CHECK(whether getloadavg requires setgid,
               gl_cv_func_getloadavg_setgid,
 [AC_EGREP_CPP([Yowza Am I SETGID yet],
-[#define gl_GETLOADAVG
+[#define CONFIGURING_GETLOADAVG
 #include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
 #ifdef LDAV_PRIVILEGED
 Yowza Am I SETGID yet
@@ -139,9 +88,9 @@ if test $gl_cv_func_getloadavg_setgid = 
   # If we got an error (system does not support symlinks), try without -L.
   test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
   gl_cv_group_kmem=`echo $ac_ls_output \
-    | sed -ne ['s/[     ][      ]*/ /g;
-              s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/;
-              / /s/.* //;p;']`
+    | sed -ne ['s/[     ][      ]*/ /g
+              s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/
+              / /s/.* //;p']`
 ])
   AC_SUBST(KMEM_GROUP, $gl_cv_group_kmem)dnl
 fi
@@ -154,3 +103,53 @@ LIBS=$gl_save_LIBS
 
 AC_SUBST(GETLOADAVG_LIBS)dnl
 ])# gl_GETLOADAVG
+
+
+# gl_PREREQ_GETLOADAVG
+# --------------------
+# Set up the AC_LIBOBJ replacement of `getloadavg'.
+AC_DEFUN([gl_PREREQ_GETLOADAVG],
+[AC_LIBOBJ(getloadavg)
+AC_DEFINE(C_GETLOADAVG, 1, [Define to 1 if using `getloadavg.c'.])
+# Figure out what our getloadavg.c needs.
+gl_have_func=no
+AC_CHECK_HEADER(sys/dg_sys_info.h,
+[gl_have_func=yes
+ AC_DEFINE(DGUX, 1, [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
+ AC_CHECK_LIB(dgc, dg_sys_info)])
+
+# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
+# uses stabs), but it is still SVR4.  We cannot check for <elf.h> because
+# Irix 4.0.5F has the header but not the library.
+if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
+  gl_have_func=yes
+  AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.])
+fi
+
+if test $gl_have_func = no; then
+  AC_CHECK_HEADER(inq_stats/cpustats.h,
+  [gl_have_func=yes
+   AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.])
+   AC_DEFINE(UMAX4_3, 1,
+            [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+             instead of <sys/cpustats.h>.])])
+fi
+
+if test $gl_have_func = no; then
+  AC_CHECK_HEADER(sys/cpustats.h,
+  [gl_have_func=yes; AC_DEFINE(UMAX)])
+fi
+
+if test $gl_have_func = no; then
+  AC_CHECK_HEADERS(mach/mach.h)
+fi
+
+AC_CHECK_HEADERS(nlist.h,
+[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
+                 [AC_DEFINE(NLIST_NAME_UNION, 1,
+                            [Define to 1 if your `struct nlist' has an
+                             `n_un' member.  Obsolete, depend on
+                             `HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
+                 address@hidden:@include <nlist.h>])
+])dnl
+])# gl_PREREQ_GETLOADAVG




reply via email to

[Prev in Thread] Current Thread [Next in Thread]