1
gnu.patch by Aurelien Jarno <aurel32@debian.org> and
2
Sergei Golovan <sgolovan@debian.org>
1
Author: Aurelien Jarno <aurel32@debian.org>
2
Author: Sergei Golovan <sgolovan@debian.org>
3
Author: Pino Toscano <pino@debian.org>
4
5
(1) Defines GNU macros not only for Linux but also for any system
5
6
with 'gnu' substring in OS name. Fixes FTBFS on GNU/kFreeBSD and GNU/Hurd.
7
8
(2) Undefines BSD4_4 for os_mon application for GNU/Hurd;
9
--- erlang-14.b.1-dfsg.orig/erts/configure.in
10
+++ erlang-14.b.1-dfsg/erts/configure.in
10
(3) Undefines AF_LINK for GNU/Hurd;
12
(4) Switch some PATH_MAX occurrences to MAXPATHLEN;
14
--- erlang-15.b-dfsg.orig/erts/configure.in
15
+++ erlang-15.b-dfsg/erts/configure.in
13
18
dnl NOTE: CPPFLAGS will be included in CFLAGS at the end
26
31
AC_MSG_CHECKING([whether dlopen() needs to be called before first call to dlerror()])
27
32
if test "x$ETHR_THR_LIB_BASE_TYPE" != "xposix_nptl"; then
28
33
AC_DEFINE(ERTS_NEED_DLOPEN_BEFORE_DLERROR,[1],
29
--- erlang-14.b.1-dfsg.orig/lib/os_mon/c_src/memsup.c
30
+++ erlang-14.b.1-dfsg/lib/os_mon/c_src/memsup.c
34
--- erlang-15.b-dfsg.orig/lib/os_mon/c_src/memsup.c
35
+++ erlang-15.b-dfsg/lib/os_mon/c_src/memsup.c
31
36
@@ -110,6 +110,11 @@
32
37
#include <memLib.h>
41
46
#include <sys/types.h>
42
47
#include <sys/sysctl.h>
48
--- erlang-15.b-dfsg.orig/erts/emulator/drivers/common/inet_drv.c
49
+++ erlang-15.b-dfsg/erts/emulator/drivers/common/inet_drv.c
51
inet_driver_select((d)->port, (ErlDrvEvent)(long)(d)->event, (flags), (onoff)); \
55
+#warning "Undefined AF_LINK for GNU/Hurd"
60
#endif /* __WIN32__ */
62
--- erlang-15.b-dfsg.orig/erts/etc/common/erlexec.c
63
+++ erlang-15.b-dfsg/erts/etc/common/erlexec.c
66
/* Determine bindir from absolute path to executable */
68
- char buffer[PATH_MAX];
69
+ char buffer[MAXPATHLEN];
70
strncpy(buffer, argv[0], sizeof(buffer));
71
buffer[sizeof(buffer)-1] = '\0';
75
/* Determine rootdir from absolute path to bindir */
77
- char buffer[PATH_MAX];
78
+ char buffer[MAXPATHLEN];
79
strncpy(buffer, bindir, sizeof(buffer));
80
buffer[sizeof(buffer)-1] = '\0';
82
--- erlang-15.b-dfsg.orig/erts/etc/common/escript.c
83
+++ erlang-15.b-dfsg/erts/etc/common/escript.c
85
# define IS_DIRSEP(c) ((c) == '/')
86
# define DIRSEPSTR "/"
87
# define PATHSEPSTR ":"
88
-# define PMAX PATH_MAX
89
+# define PMAX MAXPATHLEN
90
# define ERL_NAME "erl"
93
--- erlang-15.b-dfsg.orig/erts/etc/unix/dyn_erl.c
94
+++ erlang-15.b-dfsg/erts/etc/unix/dyn_erl.c
97
find_prog(char *origpath)
99
- char relpath[PATH_MAX];
100
- char abspath[PATH_MAX];
101
+ char relpath[MAXPATHLEN];
102
+ char abspath[MAXPATHLEN];
104
strcpy(relpath, origpath);
107
envpath = get_env("PATH");
109
/* Try to find the executable in the path */
110
- char dir[PATH_MAX];
111
+ char dir[MAXPATHLEN];
116
/* List install dir and look for latest erts-vsn */
117
DIR *dp; /* Pointer to directory structure. */
118
struct dirent* dirp; /* Pointer to directory entry. */
119
- char latest_vsn[PATH_MAX]; /* Latest erts-vsn directory name. */
120
+ char latest_vsn[MAXPATHLEN];/* Latest erts-vsn directory name. */
122
dp = opendir(erl_top);
128
- char buffer[PATH_MAX];
129
+ char buffer[MAXPATHLEN];
131
strcpy(buffer, erlpath);
136
char *bindir; /* Location of executables. */
137
- char rootdir[PATH_MAX]; /* Root location of Erlang installation. */
138
- char progname[PATH_MAX]; /* Name of this program. */
139
- char erlexec[PATH_MAX]; /* Path to erlexec */
140
+ char rootdir[MAXPATHLEN];/* Root location of Erlang installation. */
141
+ char progname[MAXPATHLEN];/* Name of this program. */
142
+ char erlexec[MAXPATHLEN];/* Path to erlexec */
144
/* Determine progname */
145
abspath = find_prog(argv[0]);