Skip to content

Commit be450c3

Browse files
committed
Add --with-properly-linked-python2-python3
It enables `python` and `python3` commands at the same time. You will get `deadly signal SEGV` if you don't have properly linked Python 2 and Python 3.
1 parent f595588 commit be450c3

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/auto/configure

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ enable_pythoninterp
803803
with_python_config_dir
804804
enable_python3interp
805805
with_python3_config_dir
806+
with_properly_linked_python2_python3
806807
enable_tclinterp
807808
with_tclsh
808809
enable_rubyinterp
@@ -1515,6 +1516,7 @@ Optional Packages:
15151516
--with-plthome=PLTHOME Use PLTHOME.
15161517
--with-python-config-dir=PATH Python's config directory
15171518
--with-python3-config-dir=PATH Python's config directory
1519+
--with-properly-linked-python2-python3 Link with properly linked Python 2 and Python 3.
15181520
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
15191521
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
15201522
--with-x use the X Window System
@@ -6443,6 +6445,15 @@ fi
64436445

64446446

64456447

6448+
6449+
# Check whether --with-properly-linked-python2-python3 was given.
6450+
if test "${with_properly_linked_python2_python3+set}" = set; then :
6451+
withval=$with_properly_linked_python2_python3; vi_cv_with_properly_linked_python2_python3="yes"
6452+
else
6453+
vi_cv_with_properly_linked_python2_python3="no"
6454+
fi
6455+
6456+
64466457
if test "$python_ok" = yes && test "$python3_ok" = yes; then
64476458
$as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h
64486459

@@ -6454,7 +6465,7 @@ $as_echo_n "checking whether we can do without RTLD_GLOBAL for Python... " >&6;
64546465
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
64556466
libs_save=$LIBS
64566467
LIBS="-ldl $LIBS"
6457-
if test "x$MACOSX" != "xyes"; then
6468+
if test "x$MACOSX" != "xyes" || test "$vi_cv_with_properly_linked_python2_python3" = "yes"; then
64586469
if test "$cross_compiling" = yes; then :
64596470
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
64606471
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}

src/configure.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,11 @@ AC_SUBST(PYTHON3_CFLAGS)
15101510
AC_SUBST(PYTHON3_SRC)
15111511
AC_SUBST(PYTHON3_OBJ)
15121512

1513+
AC_ARG_WITH(properly-linked-python2-python3,
1514+
[ --with-properly-linked-python2-python3 Link with properly linked Python 2 and Python 3.],
1515+
[vi_cv_with_properly_linked_python2_python3="yes"],
1516+
[vi_cv_with_properly_linked_python2_python3="no"])
1517+
15131518
dnl if python2.x and python3.x are enabled one can only link in code
15141519
dnl with dlopen(), dlsym(), dlclose()
15151520
if test "$python_ok" = yes && test "$python3_ok" = yes; then
@@ -1521,7 +1526,7 @@ if test "$python_ok" = yes && test "$python3_ok" = yes; then
15211526
libs_save=$LIBS
15221527
dnl -ldl must go first to make this work on Archlinux (Roland Puntaier)
15231528
LIBS="-ldl $LIBS"
1524-
if test "x$MACOSX" != "xyes"; then
1529+
if test "x$MACOSX" != "xyes" || test "$vi_cv_with_properly_linked_python2_python3" = "yes"; then
15251530
AC_RUN_IFELSE([AC_LANG_SOURCE([
15261531
#include <dlfcn.h>
15271532
/* If this program fails, then RTLD_GLOBAL is needed.

0 commit comments

Comments
 (0)