Skip to content

Commit 4956979

Browse files
author
martin.v.loewis
committed
Issue #4204: Fixed module build errors on FreeBSD 4.
git-svn-id: http://svn.python.org/projects/python/trunk@67098 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 3584fe6 commit 4956979

6 files changed

Lines changed: 38 additions & 26 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Build
6363

6464
- Issue #3758: Add ``patchcheck`` build target to .PHONY.
6565

66+
- Issue #4204: Fixed module build errors on FreeBSD 4.
67+
6668
C-API
6769
-----
6870

Modules/_multiprocessing/multiprocessing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
# define SEM_VALUE_MAX LONG_MAX
2121
#else
2222
# include <fcntl.h> /* O_CREAT and O_EXCL */
23+
# include <netinet/in.h>
2324
# include <sys/socket.h>
25+
# include <sys/uio.h>
2426
# include <arpa/inet.h> /* htonl() and ntohl() */
2527
# if HAVE_SEM_OPEN
2628
# include <semaphore.h>

Modules/readline.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
#define completion_matches(x, y) \
3636
rl_completion_matches((x), ((rl_compentry_func_t *)(y)))
3737
#else
38+
#if defined(_RL_FUNCTION_TYPEDEF)
3839
extern char **completion_matches(char *, rl_compentry_func_t *);
40+
#else
41+
extern char **completion_matches(char *, CPFunction *);
42+
#endif
3943
#endif
4044

4145
static void
@@ -213,7 +217,11 @@ set_completion_display_matches_hook(PyObject *self, PyObject *args)
213217
default completion display. */
214218
rl_completion_display_matches_hook =
215219
completion_display_matches_hook ?
220+
#if defined(_RL_FUNCTION_TYPEDEF)
216221
(rl_compdisp_func_t *)on_completion_display_matches_hook : 0;
222+
#else
223+
(VFunction *)on_completion_display_matches_hook : 0;
224+
#endif
217225
#endif
218226
return result;
219227

configure

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 66295 .
2+
# From configure.in Revision: 66764 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.61 for python 2.7.
55
#
@@ -2105,11 +2105,18 @@ _ACEOF
21052105
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
21062106
SCO_SV/3.2)
21072107
define_xopen_source=no;;
2108-
# On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
2109-
# it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
2110-
# this is fixed in 10.3, which identifies itself as Darwin/7.*
2111-
# This should hopefully be fixed in FreeBSD 4.9
2112-
FreeBSD/4.8* | Darwin/6* )
2108+
# On FreeBSD 4, the math functions C89 does not cover are never defined
2109+
# with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
2110+
FreeBSD/4.*)
2111+
define_xopen_source=no;;
2112+
# On MacOS X 10.2, a bug in ncurses.h means that it craps out if
2113+
# _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
2114+
# identifies itself as Darwin/7.*
2115+
# On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
2116+
# disables platform specific features beyond repair.
2117+
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
2118+
# has no effect, don't bother defining them
2119+
Darwin/[6789].*)
21132120
define_xopen_source=no;;
21142121
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
21152122
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
@@ -2121,13 +2128,6 @@ _ACEOF
21212128
define_xopen_source=no
21222129
fi
21232130
;;
2124-
# On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
2125-
# disables platform specific features beyond repair.
2126-
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
2127-
# has no effect, don't bother defining them
2128-
Darwin/[789].*)
2129-
define_xopen_source=no
2130-
;;
21312131
# On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
21322132
# defining NI_NUMERICHOST.
21332133
QNX/6.3.2)

configure.in

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,18 @@ case $ac_sys_system/$ac_sys_release in
276276
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
277277
SCO_SV/3.2)
278278
define_xopen_source=no;;
279-
# On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that
280-
# it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently,
281-
# this is fixed in 10.3, which identifies itself as Darwin/7.*
282-
# This should hopefully be fixed in FreeBSD 4.9
283-
FreeBSD/4.8* | Darwin/6* )
279+
# On FreeBSD 4, the math functions C89 does not cover are never defined
280+
# with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
281+
FreeBSD/4.*)
282+
define_xopen_source=no;;
283+
# On MacOS X 10.2, a bug in ncurses.h means that it craps out if
284+
# _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
285+
# identifies itself as Darwin/7.*
286+
# On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
287+
# disables platform specific features beyond repair.
288+
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
289+
# has no effect, don't bother defining them
290+
Darwin/@<:@6789@:>@.*)
284291
define_xopen_source=no;;
285292
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
286293
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
@@ -292,13 +299,6 @@ case $ac_sys_system/$ac_sys_release in
292299
define_xopen_source=no
293300
fi
294301
;;
295-
# On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
296-
# disables platform specific features beyond repair.
297-
# On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
298-
# has no effect, don't bother defining them
299-
Darwin/@<:@789@:>@.*)
300-
define_xopen_source=no
301-
;;
302302
# On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
303303
# defining NI_NUMERICHOST.
304304
QNX/6.3.2)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ class db_found(Exception): pass
12611261
)
12621262
libraries = []
12631263

1264-
elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
1264+
elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
12651265
# FreeBSD's P1003.1b semaphore support is very experimental
12661266
# and has many known problems. (as of June 2008)
12671267
macros = dict( # FreeBSD

0 commit comments

Comments
 (0)