Skip to content

Commit 288d1da

Browse files
authored
remove support for BSD/OS (closes bpo-31624) (python#3812)
1 parent a106aec commit 288d1da

File tree

10 files changed

+11
-69
lines changed

10 files changed

+11
-69
lines changed

Include/pyport.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,6 @@ extern char * _getpty(int *, int, mode_t, int);
556556
#include <sys/termio.h>
557557
#endif
558558

559-
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY)
560-
#if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H)
561-
/* BSDI does not supply a prototype for the 'openpty' and 'forkpty'
562-
functions, even though they are included in libutil. */
563-
#include <termios.h>
564-
extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
565-
extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
566-
#endif /* !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) */
567-
#endif /* defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) */
568-
569559

570560
/* On 4.4BSD-descendants, ctype functions serves the whole range of
571561
* wchar_t character set rather than single byte code points only.

Include/unicodeobject.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */;
104104
#endif
105105

106106
#ifdef HAVE_WCHAR_H
107-
/* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */
108-
# ifdef _HAVE_BSDI
109-
# include <time.h>
110-
# endif
111107
# include <wchar.h>
112108
#endif
113109

Lib/distutils/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def get_platform ():
5353

5454
(osname, host, release, version, machine) = os.uname()
5555

56-
# Convert the OS name to lowercase, remove '/' characters
57-
# (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
56+
# Convert the OS name to lowercase, remove '/' characters, and translate
57+
# spaces (for "Power Macintosh")
5858
osname = osname.lower().replace('/', '')
5959
machine = machine.replace(' ', '_')
6060
machine = machine.replace('/', '-')

Lib/sysconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ def get_platform():
632632
# Try to distinguish various flavours of Unix
633633
osname, host, release, version, machine = os.uname()
634634

635-
# Convert the OS name to lowercase, remove '/' characters
636-
# (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
635+
# Convert the OS name to lowercase, remove '/' characters, and translate
636+
# spaces (for "Power Macintosh")
637637
osname = osname.lower().replace('/', '')
638638
machine = machine.replace(' ', '_')
639639
machine = machine.replace('/', '-')

Lib/test/test_fcntl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_lockdata():
2222
else:
2323
start_len = "qq"
2424

25-
if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd', 'bsdos'))
25+
if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd'))
2626
or sys.platform == 'darwin'):
2727
if struct.calcsize('l') == 8:
2828
off_t = 'l'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove support for BSD/OS.

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3967,7 +3967,7 @@ os_nice_impl(PyObject *module, int increment)
39673967

39683968
/* There are two flavours of 'nice': one that returns the new
39693969
priority (as required by almost all standards out there) and the
3970-
Linux/FreeBSD/BSDI one, which returns '0' on success and advices
3970+
Linux/FreeBSD one, which returns '0' on success and advices
39713971
the use of getpriority() to get the new priority.
39723972
39733973
If we are of the nice family that returns the new priority, we

Python/thread_pthread.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,6 @@ typedef struct {
149149
/*
150150
* Initialization.
151151
*/
152-
153-
#if defined(_HAVE_BSDI)
154-
static
155-
void _noop(void)
156-
{
157-
}
158-
159-
static void
160-
PyThread__init_thread(void)
161-
{
162-
/* DO AN INIT BY STARTING THE THREAD */
163-
static int dummy = 0;
164-
pthread_t thread1;
165-
pthread_create(&thread1, NULL, (void *) _noop, &dummy);
166-
pthread_join(thread1, NULL);
167-
}
168-
169-
#else /* !_HAVE_BSDI */
170-
171152
static void
172153
PyThread__init_thread(void)
173154
{
@@ -177,8 +158,6 @@ PyThread__init_thread(void)
177158
#endif
178159
}
179160

180-
#endif /* !_HAVE_BSDI */
181-
182161
/*
183162
* Thread support.
184163
*/

configure

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5703,13 +5703,6 @@ $as_echo "no" >&6; }
57035703
fi
57045704
rmdir CaseSensitiveTestDir
57055705

5706-
case $MACHDEP in
5707-
bsdos*)
5708-
case $CC in
5709-
gcc) CC="$CC -D_HAVE_BSDI";;
5710-
esac;;
5711-
esac
5712-
57135706
case $ac_sys_system in
57145707
hp*|HP*)
57155708
case $CC in
@@ -6263,8 +6256,8 @@ fi
62636256

62646257

62656258
case $MACHDEP in
6266-
bsdos*|hp*|HP*)
6267-
# install -d does not work on BSDI or HP-UX
6259+
hp*|HP*)
6260+
# install -d does not work on HP-UX
62686261
if test -z "$INSTALL"
62696262
then
62706263
INSTALL="${srcdir}/install-sh -c"
@@ -9228,9 +9221,6 @@ then
92289221
Linux*|GNU*|QNX*)
92299222
LDSHARED='$(CC) -shared'
92309223
LDCXXSHARED='$(CXX) -shared';;
9231-
BSD/OS*/4*)
9232-
LDSHARED="gcc -shared"
9233-
LDCXXSHARED="g++ -shared";;
92349224
FreeBSD*)
92359225
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
92369226
then
@@ -9298,7 +9288,6 @@ then
92989288
fi;;
92999289
Linux-android*) ;;
93009290
Linux*|GNU*) CCSHARED="-fPIC";;
9301-
BSD/OS*/4*) CCSHARED="-fpic";;
93029291
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
93039292
OpenUNIX*|UnixWare*)
93049293
if test "$GCC" = "yes"
@@ -9325,7 +9314,6 @@ then
93259314
hp*|HP*)
93269315
LINKFORSHARED="-Wl,-E -Wl,+s";;
93279316
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
9328-
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
93299317
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
93309318
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
93319319
# -u libsys_s pulls in all symbols in libsys

configure.ac

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -948,13 +948,6 @@ else
948948
fi
949949
rmdir CaseSensitiveTestDir
950950

951-
case $MACHDEP in
952-
bsdos*)
953-
case $CC in
954-
gcc) CC="$CC -D_HAVE_BSDI";;
955-
esac;;
956-
esac
957-
958951
case $ac_sys_system in
959952
hp*|HP*)
960953
case $CC in
@@ -1191,8 +1184,8 @@ AC_SUBST(READELF)
11911184

11921185

11931186
case $MACHDEP in
1194-
bsdos*|hp*|HP*)
1195-
# install -d does not work on BSDI or HP-UX
1187+
hp*|HP*)
1188+
# install -d does not work on HP-UX
11961189
if test -z "$INSTALL"
11971190
then
11981191
INSTALL="${srcdir}/install-sh -c"
@@ -2492,9 +2485,6 @@ then
24922485
Linux*|GNU*|QNX*)
24932486
LDSHARED='$(CC) -shared'
24942487
LDCXXSHARED='$(CXX) -shared';;
2495-
BSD/OS*/4*)
2496-
LDSHARED="gcc -shared"
2497-
LDCXXSHARED="g++ -shared";;
24982488
FreeBSD*)
24992489
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
25002490
then
@@ -2560,7 +2550,6 @@ then
25602550
fi;;
25612551
Linux-android*) ;;
25622552
Linux*|GNU*) CCSHARED="-fPIC";;
2563-
BSD/OS*/4*) CCSHARED="-fpic";;
25642553
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
25652554
OpenUNIX*|UnixWare*)
25662555
if test "$GCC" = "yes"
@@ -2585,7 +2574,6 @@ then
25852574
hp*|HP*)
25862575
LINKFORSHARED="-Wl,-E -Wl,+s";;
25872576
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
2588-
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
25892577
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
25902578
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
25912579
# -u libsys_s pulls in all symbols in libsys

0 commit comments

Comments
 (0)