From 58a7ead41d056909784bfab9323c5f44f577d3d0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 1 Sep 2007 09:54:45 +0200 Subject: [PATCH] Convert coreutils' rand*.{c,h,m4} into modules. First step: move these files to gl/lib: * lib/rand-isaac.c, lib/rand-isaac.h * lib/randint.c, lib/randint.h * lib/randperm.c, lib/randperm.h * lib/randread.c, lib/randread.h Step 2: add modules/rand* and remove now-unneeded .m4 files. * gl/modules/randint: New file. * gl/modules/randperm: New file. * gl/modules/randread: New file. * m4/randint.m4: Remove file. * m4/randperm.m4: Remove file. * m4/randread.m4: Remove file. Step 3: use the new modules * bootstrap.conf (gnulib_modules): Add randint and randperm. * m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require; These have been removed. (gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf. --- ChangeLog | 19 +++++++++++++++++++ bootstrap.conf | 5 ++++- {lib => gl/lib}/rand-isaac.c | 0 {lib => gl/lib}/rand-isaac.h | 0 {lib => gl/lib}/randint.c | 0 {lib => gl/lib}/randint.h | 0 {lib => gl/lib}/randperm.c | 0 {lib => gl/lib}/randperm.h | 0 {lib => gl/lib}/randread.c | 0 {lib => gl/lib}/randread.h | 0 gl/modules/randint | 24 ++++++++++++++++++++++++ gl/modules/randperm | 24 ++++++++++++++++++++++++ gl/modules/randread | 34 ++++++++++++++++++++++++++++++++++ m4/prereq.m4 | 9 ++------- m4/randint.m4 | 12 ------------ m4/randperm.m4 | 10 ---------- m4/randread.m4 | 11 ----------- 17 files changed, 107 insertions(+), 41 deletions(-) rename {lib => gl/lib}/rand-isaac.c (100%) rename {lib => gl/lib}/rand-isaac.h (100%) rename {lib => gl/lib}/randint.c (100%) rename {lib => gl/lib}/randint.h (100%) rename {lib => gl/lib}/randperm.c (100%) rename {lib => gl/lib}/randperm.h (100%) rename {lib => gl/lib}/randread.c (100%) rename {lib => gl/lib}/randread.h (100%) create mode 100644 gl/modules/randint create mode 100644 gl/modules/randperm create mode 100644 gl/modules/randread delete mode 100644 m4/randint.m4 delete mode 100644 m4/randperm.m4 delete mode 100644 m4/randread.m4 diff --git a/ChangeLog b/ChangeLog index fb2ce1695f..cb2e78095c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,24 @@ 2007-10-07 Jim Meyering + Convert coreutils' rand*.{c,h,m4} into modules. + First step: move these files to gl/lib: + * lib/rand-isaac.c, lib/rand-isaac.h + * lib/randint.c, lib/randint.h + * lib/randperm.c, lib/randperm.h + * lib/randread.c, lib/randread.h + Step 2: add modules/rand* and remove now-unneeded .m4 files. + * gl/modules/randint: New file. + * gl/modules/randperm: New file. + * gl/modules/randread: New file. + * m4/randint.m4: Remove file. + * m4/randperm.m4: Remove file. + * m4/randread.m4: Remove file. + Step 3: use the new modules + * bootstrap.conf (gnulib_modules): Add randint and randperm. + * m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require; + These have been removed. + (gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf. + Copy from gnulib the parts of tempname that we'll modify. * gl/lib/tempname.c: Copy from gnulib. * gl/lib/tempname.h: Likewise. diff --git a/bootstrap.conf b/bootstrap.conf index 2088e50122..9584dc0692 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -61,7 +61,10 @@ gnulib_modules=" memrchr mgetgroups mkancesdirs mkdir mkdir-p mkstemp mktime modechange mountlist mpsort obstack pathmax perl physmem posixtm posixver putenv - quote quotearg raise readlink areadlink-with-size readtokens + quote quotearg raise readlink areadlink-with-size + randint + randperm + readtokens readtokens0 readutmp realloc regex rename-dest-slash rmdir rmdir-errno root-dev-ino diff --git a/lib/rand-isaac.c b/gl/lib/rand-isaac.c similarity index 100% rename from lib/rand-isaac.c rename to gl/lib/rand-isaac.c diff --git a/lib/rand-isaac.h b/gl/lib/rand-isaac.h similarity index 100% rename from lib/rand-isaac.h rename to gl/lib/rand-isaac.h diff --git a/lib/randint.c b/gl/lib/randint.c similarity index 100% rename from lib/randint.c rename to gl/lib/randint.c diff --git a/lib/randint.h b/gl/lib/randint.h similarity index 100% rename from lib/randint.h rename to gl/lib/randint.h diff --git a/lib/randperm.c b/gl/lib/randperm.c similarity index 100% rename from lib/randperm.c rename to gl/lib/randperm.c diff --git a/lib/randperm.h b/gl/lib/randperm.h similarity index 100% rename from lib/randperm.h rename to gl/lib/randperm.h diff --git a/lib/randread.c b/gl/lib/randread.c similarity index 100% rename from lib/randread.c rename to gl/lib/randread.c diff --git a/lib/randread.h b/gl/lib/randread.h similarity index 100% rename from lib/randread.h rename to gl/lib/randread.h diff --git a/gl/modules/randint b/gl/modules/randint new file mode 100644 index 0000000000..4485581ae8 --- /dev/null +++ b/gl/modules/randint @@ -0,0 +1,24 @@ +Description: +Generate random integers. + +Files: +lib/randint.c +lib/randint.h + +Depends-on: +inline +randread + +configure.ac: + +Makefile.am: +lib_SOURCES += randint.c randint.h + +Include: +"randint.h" + +License +GPL + +Maintainer: +Paul Eggert diff --git a/gl/modules/randperm b/gl/modules/randperm new file mode 100644 index 0000000000..9cef782713 --- /dev/null +++ b/gl/modules/randperm @@ -0,0 +1,24 @@ +Description: +Generate random permutations. + +Files: +lib/randperm.c +lib/randperm.h + +Depends-on: +randint +xalloc + +configure.ac: + +Makefile.am: +lib_SOURCES += randperm.c randperm.h + +Include: +"randperm.h" + +License +GPL + +Maintainer: +Paul Eggert diff --git a/gl/modules/randread b/gl/modules/randread new file mode 100644 index 0000000000..fb40007aac --- /dev/null +++ b/gl/modules/randread @@ -0,0 +1,34 @@ +Description: +Generate buffers of random data. + +Files: +lib/rand-isaac.c +lib/rand-isaac.h +lib/randread.c +lib/randread.h + +Depends-on: +error +exitfail +fopen-safer +gethrxtime +quotearg +rand-isaac +stdbool +stdint +unlocked-io +xalloc + +configure.ac: + +Makefile.am: +lib_SOURCES += randread.c randread.h rand-isaac.c rand-isaac.h + +Include: +"randread.h" + +License +GPL + +Maintainer: +Paul Eggert diff --git a/m4/prereq.m4 b/m4/prereq.m4 index c5a2d45cb4..ea9b5bd563 100644 --- a/m4/prereq.m4 +++ b/m4/prereq.m4 @@ -1,4 +1,4 @@ -#serial 73 +#serial 74 dnl We use gl_ for non Autoconf macros. m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl @@ -7,8 +7,7 @@ m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl # directory of the coreutils package. -# Copyright (C) 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,10 +40,6 @@ AC_DEFUN([gl_PREREQ], AC_REQUIRE([gl_FD_REOPEN]) AC_REQUIRE([gl_FUNC_XFTS]) AC_REQUIRE([gl_MEMXFRM]) - AC_REQUIRE([gl_RANDINT]) - AC_REQUIRE([gl_RANDPERM]) - AC_REQUIRE([gl_RANDREAD]) - AC_REQUIRE([gl_ROOT_DEV_INO]) AC_REQUIRE([gl_SHA256]) AC_REQUIRE([gl_SHA512]) AC_REQUIRE([gl_STRINTCMP]) diff --git a/m4/randint.m4 b/m4/randint.m4 deleted file mode 100644 index 50209ed2a1..0000000000 --- a/m4/randint.m4 +++ /dev/null @@ -1,12 +0,0 @@ -dnl Copyright (C) 2006 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. - -AC_DEFUN([gl_RANDINT], -[ - AC_LIBSOURCES([randint.c, randint.h]) - AC_LIBOBJ([randint]) - - AC_REQUIRE([AC_C_INLINE]) -]) diff --git a/m4/randperm.m4 b/m4/randperm.m4 deleted file mode 100644 index de2d691dba..0000000000 --- a/m4/randperm.m4 +++ /dev/null @@ -1,10 +0,0 @@ -dnl Copyright (C) 2006 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. - -AC_DEFUN([gl_RANDPERM], -[ - AC_LIBSOURCES([randperm.c, randperm.h]) - AC_LIBOBJ([randperm]) -]) diff --git a/m4/randread.m4 b/m4/randread.m4 deleted file mode 100644 index c30ddd3f20..0000000000 --- a/m4/randread.m4 +++ /dev/null @@ -1,11 +0,0 @@ -dnl Copyright (C) 2006 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. - -AC_DEFUN([gl_RANDREAD], -[ - AC_LIBSOURCES([randread.c, randread.h, rand-isaac.c, rand-isaac.h]) - AC_LIBOBJ([randread]) - AC_LIBOBJ([rand-isaac]) -]) -- 2.47.2