Fix use of unistd.h in getopt through a new unistd module.
authorSimon Josefsson <simon@josefsson.org>
Tue, 7 Mar 2006 13:30:51 +0000 (13:30 +0000)
committerSimon Josefsson <simon@josefsson.org>
Tue, 7 Mar 2006 13:30:51 +0000 (13:30 +0000)
ChangeLog
lib/ChangeLog
lib/unistd_.h [new file with mode: 0644]
m4/ChangeLog
modules/getopt
modules/unistd [new file with mode: 0644]

index 7ace051..ecdc214 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-03-07  Simon Josefsson  <jas@extundo.com>
 
+       * modules/getopt (Depends-on): Add unistd.
+
+       * modules/unistd: New file.
+
+2006-03-07  Simon Josefsson  <jas@extundo.com>
+
        * modules/gc-random: New file.
 
 2006-03-03  Simon Josefsson  <jas@extundo.com>
index 8e95655..b5cc5b1 100644 (file)
@@ -1,5 +1,9 @@
 2006-03-07  Simon Josefsson  <jas@extundo.com>
 
+       * unistd_.h: New file.
+
+2006-03-07  Simon Josefsson  <jas@extundo.com>
+
        * gc-libgcrypt.c, gc-gnulib.c: Use GC_USE_RANDOM.
 
 2006-03-01  Simon Josefsson  <jas@extundo.com>
diff --git a/lib/unistd_.h b/lib/unistd_.h
new file mode 100644 (file)
index 0000000..484bd36
--- /dev/null
@@ -0,0 +1,24 @@
+/* A unistd.h replacement for systems lacking it.
+   Copyright (C) 2006 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
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+   USA.  */
+
+/* Put any statements that are necessary to get a working unistd.h in
+   this file. */
+
+/* MS Visual Studio doesn't have unistd.h, but it doesn't seem to need
+   any particular statements in this file.  So this file is here to
+   avoid breaking '#include <unistd.h>' in other files. */
index 739cd0e..7c2365f 100644 (file)
@@ -1,5 +1,9 @@
 2006-03-07  Simon Josefsson  <jas@extundo.com>
 
+       * unistd_h.m4: New file.
+
+2006-03-07  Simon Josefsson  <jas@extundo.com>
+
        * readline.m4 (gl_FUNC_READLINE): Rewrite the cached part of the
        test to be side-effect free by storing the result in the cache
        variable gl_cv_lib_readline, and moving the assignment of
index 420250c..55fc61a 100644 (file)
@@ -10,6 +10,7 @@ m4/getopt.m4
 
 Depends-on:
 gettext-h
+unistd
 
 configure.ac:
 gl_GETOPT
diff --git a/modules/unistd b/modules/unistd
new file mode 100644 (file)
index 0000000..edcae83
--- /dev/null
@@ -0,0 +1,31 @@
+Description:
+A <unistd.h> for systems lacking it.
+
+Files:
+lib/unistd_.h
+m4/unistd_h.m4
+
+Depends-on:
+
+configure.ac:
+gl_HEADER_UNISTD
+
+Makefile.am:
+BUILT_SOURCES += $(UNISTD_H)
+EXTRA_DIST += unistd_.h
+
+# We need the following in order to create <byteswap.h> when the system
+# doesn't have one.
+unistd.h: unistd_.h
+       cp $(srcdir)/unistd_.h $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+Include:
+#include <unistd.h>
+
+License:
+LGPL
+
+Maintainer:
+Simon Josefsson