gnu.patch by Aurelien Jarno <aurel32@debian.org> and
Sergei Golovan <sgolovan@debian.org>
(1) Defines GNU macros not only for Linux but also for any system
with 'gnu' substring in OS name. Fixes FTBFS on GNU/kFreeBSD and GNU/Hurd.
(2) Undefines BSD4_4 for os_mon application for GNU/Hurd;
(2) Skips building SSL certificate examples for GNU/Hurd (Debian GNU/Hurd has
no a random translator yet).
--- erlang-14.a-dfsg.orig/erts/configure.in
+++ erlang-14.a-dfsg/erts/configure.in
@@ -385,7 +385,7 @@
dnl NOTE: CPPFLAGS will be included in CFLAGS at the end
case $host_os in
- linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE";;
+ linux*|*gnu*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE";;
win32)
# The ethread library requires _WIN32_WINNT of at least 0x0403.
# -D_WIN32_WINNT=* from CPPFLAGS is saved in ETHR_DEFS.
@@ -1148,7 +1148,7 @@
solaris*)
enable_child_waiter_thread=yes
;;
- linux*)
+ linux*|*gnu*)
AC_DEFINE(USE_RECURSIVE_MALLOC_MUTEX,[1],
[Define if malloc should use a recursive mutex])
AC_MSG_CHECKING([whether dlopen() needs to be called before first call to dlerror()])
--- erlang-14.a-dfsg.orig/lib/os_mon/c_src/memsup.c
+++ erlang-14.a-dfsg/lib/os_mon/c_src/memsup.c
@@ -110,6 +110,11 @@
#include <memLib.h>
#endif
+#ifdef __GNU__
+#warning "Undefined BSD4_4 for GNU/Hurd"
+#undef BSD4_4
+#endif
+
#ifdef BSD4_4
#include <sys/types.h>
#include <sys/sysctl.h>
--- erlang-14.a-dfsg.orig/lib/ssl/Makefile
+++ erlang-14.a-dfsg/lib/ssl/Makefile
@@ -32,8 +32,15 @@
SKIP_BUILDING_BINARIES := true
endif
else
+ifeq ($(HOST_OS),)
+HOST_OS := $(shell $(ERL_TOP)/erts/autoconf/config.guess)
+endif
+ifeq ($(findstring gnu0.3,$(HOST_OS)),gnu0.3)
+SKIP_BUILDING_BINARIES := true
+else
SKIP_BUILDING_BINARIES := false
endif
+endif
ifeq ($(SKIP_BUILDING_BINARIES), true)
SUB_DIRECTORIES = src c_src doc/src