changeset 6685:143f906c9a6a

Fix use of unistd.h in getopt through a new unistd module.
author Simon Josefsson <simon@josefsson.org>
date Tue, 07 Mar 2006 13:30:51 +0000
parents 668b3d8c9981
children f6342bb3069d
files ChangeLog lib/ChangeLog lib/unistd_.h m4/ChangeLog modules/getopt modules/unistd
diffstat 6 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+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.
new file mode 100644
--- /dev/null
+++ b/lib/unistd_.h
@@ -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. */
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+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
--- a/modules/getopt
+++ b/modules/getopt
@@ -10,6 +10,7 @@
 
 Depends-on:
 gettext-h
+unistd
 
 configure.ac:
 gl_GETOPT
new file mode 100644
--- /dev/null
+++ b/modules/unistd
@@ -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