From 90f65fb0a317f6c00b1d239a2208fadc44176f2f Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:18:52 +0000
Subject: define __USE_GNU for wempcpy


diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index 4246d82..1e30fdc 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -21,6 +21,9 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE    1
 #endif
+#ifndef __USE_GNU
+# define __USE_GNU		1
+#endif
 
 #if ! defined __builtin_expect && __GNUC__ < 3
 # define __builtin_expect(expr, expected) (expr)
-- 
1.8.3.4


From 21c5406c9a6b2711e4a8b49c6ace954899a48cc8 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:22:10 +0000
Subject: force declaration of rpl_inet_ntop


diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
index b8c2e18..30c4756 100644
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -72,7 +72,7 @@
 
    For more details, see the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
-# if @REPLACE_INET_NTOP@
+# if 1
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef inet_ntop
 #   define inet_ntop rpl_inet_ntop
-- 
1.8.3.4


From 9f4cb757ba81534fe7822bbc9517001456a85aa9 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:32:36 +0000
Subject: Haiku defines mknod in unistd.h


diff --git a/lib/mknod.c b/lib/mknod.c
index c738e59..4d816fd 100644
--- a/lib/mknod.c
+++ b/lib/mknod.c
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+#include <unistd.h>
 #include <sys/stat.h>
 
 #include <errno.h>
-- 
1.8.3.4


From 20e9b53ba7b53dd6a658a42fa6c1c74c62c08596 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:35:25 +0000
Subject: protect the label, not used on Haiku


diff --git a/lib/mountlist.c b/lib/mountlist.c
index b3be011..8711915 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -954,7 +954,7 @@ read_file_system_list (bool need_fs_type)
   *mtail = NULL;
   return mount_list;
 
-
+#ifndef __HAIKU__
  free_then_fail:
   {
     int saved_errno = errno;
@@ -970,6 +970,7 @@ read_file_system_list (bool need_fs_type)
     errno = saved_errno;
     return NULL;
   }
+#endif
 }
 
 /* Free a mount entry as returned from read_file_system_list ().  */
-- 
1.8.3.4


From d0dfbd6e63a6f45521e29dcbb7fecd7cc6cde8cb Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 15:40:32 +0000
Subject: strchrnul needs __USE_GNU on Haiku


diff --git a/lib/regex.h b/lib/regex.h
index 70f2126..d7fbf88 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -31,8 +31,10 @@ extern "C" {
 /* Define __USE_GNU to declare GNU extensions that violate the
    POSIX name space rules.  */
 #ifdef _GNU_SOURCE
+#ifndef __USE_GNU
 # define __USE_GNU 1
 #endif
+#endif
 
 #ifdef _REGEX_LARGE_OFFSETS
 
diff --git a/lib/string.in.h b/lib/string.in.h
index 9062142..ab445d1 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -23,6 +23,9 @@
 @PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
+#ifndef __USE_GNU
+#define __USE_GNU
+#endif
 #@INCLUDE_NEXT@ @NEXT_STRING_H@
 
 #ifndef _@GUARD_PREFIX@_STRING_H
-- 
1.8.3.4


From 746465bd39c160537daf2bfce500702d53e22675 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 20:13:58 +0000
Subject: don't build hostid, uptime, nice, users, who, dd


diff --git a/Makefile.in b/Makefile.in
index 140a428..f3f5596 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1495,16 +1495,15 @@ nodist_src_libver_a_OBJECTS = src/version.$(OBJEXT)
 src_libver_a_OBJECTS = $(nodist_src_libver_a_OBJECTS)
 am__EXEEXT_1 = src/arch$(EXEEXT) src/coreutils$(EXEEXT) \
 	src/hostname$(EXEEXT)
-am__EXEEXT_2 = src/chroot$(EXEEXT) src/df$(EXEEXT) src/hostid$(EXEEXT) \
-	src/libstdbuf.so$(EXEEXT) src/nice$(EXEEXT) src/pinky$(EXEEXT) \
-	src/stdbuf$(EXEEXT) src/stty$(EXEEXT) src/uptime$(EXEEXT) \
-	src/users$(EXEEXT) src/who$(EXEEXT)
+am__EXEEXT_2 = src/chroot$(EXEEXT) src/df$(EXEEXT) \
+	src/libstdbuf.so$(EXEEXT) \
+	src/stdbuf$(EXEEXT) src/stty$(EXEEXT)
 am__EXEEXT_3 = src/[$(EXEEXT) src/base64$(EXEEXT) \
 	src/basename$(EXEEXT) src/cat$(EXEEXT) src/chcon$(EXEEXT) \
 	src/chgrp$(EXEEXT) src/chmod$(EXEEXT) src/chown$(EXEEXT) \
 	src/cksum$(EXEEXT) src/comm$(EXEEXT) src/cp$(EXEEXT) \
 	src/csplit$(EXEEXT) src/cut$(EXEEXT) src/date$(EXEEXT) \
-	src/dd$(EXEEXT) src/dir$(EXEEXT) src/dircolors$(EXEEXT) \
+	src/dir$(EXEEXT) src/dircolors$(EXEEXT) \
 	src/dirname$(EXEEXT) src/du$(EXEEXT) src/echo$(EXEEXT) \
 	src/env$(EXEEXT) src/expand$(EXEEXT) src/expr$(EXEEXT) \
 	src/factor$(EXEEXT) src/false$(EXEEXT) src/fmt$(EXEEXT) \
@@ -4320,7 +4319,7 @@ WARN_ON_USE_H = lib/warn-on-use.h
 # FIXME: once lib/ and gnulib-tests/ are also converted, hoist to Makefile.am
 AM_CFLAGS = $(WERROR_CFLAGS)
 no_install__progs = src/arch src/coreutils src/hostname
-build_if_possible__progs = src/chroot src/df src/hostid \
+build_if_possible__progs = src/chroot src/df \
 	src/libstdbuf.so src/nice src/pinky src/stdbuf src/stty \
 	src/uptime src/users src/who
 default__progs = src/[ src/base64 src/basename src/cat src/chcon \
-- 
1.8.3.4

