b6fc94
project: custom config: support --with[out]-pycompile, --with[out]-pydebug.
@@ -310,7 +310,6 @@
|
|
310
310
|
|
311
311
|
|
312
312
|
|
313
|
-
|
314
313
|
|
315
314
|
|
316
315
|
|
@@ -3,6 +3,7 @@ PYTHON_VER = @python_ver@
|
|
3
3
|
PYTHON_MAJOR = @python_major@
|
4
4
|
PYTHON_MINOR = @python_minor@
|
5
5
|
PYTHON_MICRO = @python_micro@
|
6
|
-
|
6
|
+
PYTHON_ABIFL = @python_abifl@
|
7
|
+
PYTHON_SOABI = cpython-$(PYTHON_MAJOR)$(PYTHON_MINOR)$(PYTHON_ABIFL)-$(CCHOST)
|
7
8
|
PYTHON_SOEXT = .$(PYTHON_SOABI)$(OS_LIB_SUFFIX)
|
8
9
|
|
@@ -19,8 +19,23 @@
|
|
19
19
|
. "$mb_project_dir/sofort/cfgtest/cfgtest.sh"
|
20
20
|
|
21
21
|
|
22
|
+
pycfg_pydebug=
|
23
|
+
pycfg_pymalloc=
|
24
|
+
|
22
25
|
for arg ; do
|
23
26
|
case "$arg" in
|
27
|
+
--with-pydebug )
|
28
|
+
pycfg_pydebug='d' ;;
|
29
|
+
|
30
|
+
--without-pydebug )
|
31
|
+
pycfg_pydebug= ;;
|
32
|
+
|
33
|
+
--with-pymalloc )
|
34
|
+
pycfg_pymalloc='m' ;;
|
35
|
+
|
36
|
+
--without-pymalloc )
|
37
|
+
pycfg_pymalloc= ;;
|
38
|
+
|
24
39
|
*)
|
25
40
|
error_msg ${arg#}: "unsupported config argument."
|
26
41
|
exit 2
|
@@ -64,6 +79,24 @@ cfgdefs_detect_python_version()
|
|
64
79
|
}
|
65
80
|
|
66
81
|
|
82
|
+
cfgdefs_set_option_variables()
|
83
|
+
{
|
84
|
+
python_abifl=$pycfg_pydebug$pycfg_pymalloc
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
cfgdefs_output_options()
|
89
|
+
{
|
90
|
+
if [ -n "$pycfg_pydebug" ]; then
|
91
|
+
cfgtest_cflags_append '-DPy_DEBUG'
|
92
|
+
fi
|
93
|
+
|
94
|
+
if [ -n "$pycfg_pymalloc" ]; then
|
95
|
+
cfgtest_cflags_append '-DWITH_PYMALLOC'
|
96
|
+
fi
|
97
|
+
}
|
98
|
+
|
99
|
+
|
67
100
|
cfgdefs_output_custom_defs()
|
68
101
|
{
|
69
102
|
sed \
|
@@ -71,6 +104,7 @@ cfgdefs_output_custom_defs()
|
|
71
104
|
-e 's/@python_major@/'"$python_major"'/g' \
|
72
105
|
-e 's/@python_minor@/'"$python_minor"'/g' \
|
73
106
|
-e 's/@python_micro@/'"$python_micro"'/g' \
|
107
|
+
-e 's/@python_abifl@/'"$python_abifl"'/g' \
|
74
108
|
"$mb_project_dir/project/config/cfgdefs.in" \
|
75
109
|
>> "$mb_pwd/cfgdefs.mk"
|
76
110
|
}
|
@@ -377,6 +411,11 @@ cfgdefs_perform_target_tests()
|
|
377
411
|
[ $python_major = '3' ] && \
|
378
412
|
cfgtest_makevar_append '-Wl,--as-needed -llzma -Wl,--no-as-needed'
|
379
413
|
|
414
|
+
# options
|
415
|
+
cfgtest_newline
|
416
|
+
cfgtest_comment 'target options'
|
417
|
+
cfgdefs_output_options
|
418
|
+
|
380
419
|
# pretty cfgdefs.mk
|
381
420
|
cfgtest_newline
|
382
421
|
}
|
@@ -393,6 +432,11 @@ cfgdefs_perform_native_tests()
|
|
393
432
|
# ncurses libs
|
394
433
|
cfgtest_ldflags_append $mb_ncurses_libs
|
395
434
|
|
435
|
+
# options
|
436
|
+
cfgtest_newline
|
437
|
+
cfgtest_comment '(native) pycompile options'
|
438
|
+
cfgdefs_output_options
|
439
|
+
|
396
440
|
# pretty cfgdefs.mk
|
397
441
|
cfgtest_newline
|
398
442
|
}
|
@@ -404,6 +448,9 @@ cfgdefs_set_cfghost_flavors
|
|
404
448
|
# python version info
|
405
449
|
cfgdefs_detect_python_version
|
406
450
|
|
451
|
+
# python-specific configuration
|
452
|
+
cfgdefs_set_option_variables
|
453
|
+
|
407
454
|
# cfgdefs.in --> cfgdefs.mk
|
408
455
|
cfgdefs_output_custom_defs
|
409
456
|
|
@@ -9,7 +9,7 @@ CFLAGS_CONFIG += -DPREFIX=\"$(PREFIX)\"
|
|
9
9
|
CFLAGS_CONFIG += -DEXEC_PREFIX=\"$(EXEC_PREFIX)\"
|
10
10
|
CFLAGS_CONFIG += -DVPATH=\"$(SOURCE_DIR)\"
|
11
11
|
CFLAGS_CONFIG += -DPYTHONPATH=\"$(PYTHON_PATH)\"
|
12
|
-
CFLAGS_CONFIG += -DABIFLAGS
|
12
|
+
CFLAGS_CONFIG += -DABIFLAGS=\"$(PYTHON_ABIFL)\"
|
13
13
|
CFLAGS_CONFIG += -D_PYTHONFRAMEWORK=\"\"
|
14
14
|
|
15
15
|
# python's front-end utility
|
@@ -11,14 +11,14 @@ PYCGEN_IMPDIR = $(PYCOMPILE_DIR)/$(PYDIST_PYCDIR)/./importlib
|
|
11
11
|
PYCGEN_COLDIR = $(PYCOMPILE_DIR)/$(PYDIST_PYCDIR)/./collections
|
12
12
|
PYCGEN_URLDIR = $(PYCOMPILE_DIR)/$(PYDIST_PYCDIR)/./urllib
|
13
13
|
|
14
|
-
PYCGEN_CFGDAT = $(PYCOMPILE_DIR)/$(PYDIST_PYCDIR)/./
|
14
|
+
PYCGEN_CFGDAT = $(PYCOMPILE_DIR)/$(PYDIST_PYCDIR)/./_sysconfigdata_$(PYTHON_ABIFL)_$(NATIVE_OS)_.py
|
15
15
|
PYCGEN_PYSRCS = $(PYDIST_SRCS:$(PYDIST_PYCDIR)/./%.py=$(PYCGEN_PYCDIR)/%.py)
|
16
16
|
PYCGEN_PYENCS = $(PYDIST_ENCODINGS_SRCS:$(PYDIST_ENCDIR)/%.py=$(PYCGEN_ENCDIR)/%.py)
|
17
17
|
PYCGEN_PYIMPS = $(PYDIST_IMPORTLIB_SRCS:$(PYDIST_IMPDIR)/%.py=$(PYCGEN_IMPDIR)/%.py)
|
18
18
|
PYCGEN_PYCOLS = $(PYDIST_COLLECTIONS_SRCS:$(PYDIST_COLDIR)/%.py=$(PYCGEN_COLDIR)/%.py)
|
19
19
|
PYCGEN_PYURLS = $(PYDIST_URLLIB_SRCS:$(PYDIST_URLDIR)/%.py=$(PYCGEN_URLDIR)/%.py)
|
20
20
|
|
21
|
-
$(PYDIST_PYCDIR)/./
|
21
|
+
$(PYDIST_PYCDIR)/./_sysconfigdata_$(PYTHON_ABIFL)_$(PYTHON_PLATFORM)_.py:
|
22
22
|
mkdir -p $(PYDIST_PYCDIR)
|
23
23
|
printf 'build_time_vars = {}\n' > $@
|
24
24
|
|
@@ -24,7 +24,7 @@ PYCOMPILE_CFLAGS += -DPREFIX=\"$(PYCOMPILE_PREFIX)\"
|
|
24
24
|
PYCOMPILE_CFLAGS += -DEXEC_PREFIX=\"$(PYCOMPILE_PREFIX)\"
|
25
25
|
PYCOMPILE_CFLAGS += -DPYTHONPATH=\"$(PYCOMPILE_PATH)\"
|
26
26
|
PYCOMPILE_CFLAGS += -DSOABI=\"$(PYTHON_SOABI)\"
|
27
|
-
PYCOMPILE_CFLAGS += -DABIFLAGS
|
27
|
+
PYCOMPILE_CFLAGS += -DABIFLAGS=\"$(PYTHON_ABIFL)\"
|
28
28
|
PYCOMPILE_CFLAGS += -D_PYTHONFRAMEWORK=\"\"
|
29
29
|
PYCOMPILE_CFLAGS += $(NATIVE_CC_CFLAGS)
|
30
30
|
|
@@ -33,7 +33,7 @@ printf 'PYDIST_LIBDIR = lib\n'
|
|
33
33
|
printf 'PYDIST_PYCDIR = lib/$(NICKNAME)\n\n\n'
|
34
34
|
|
35
35
|
printf 'PYDIST_SYSCFG_SRCS = \\\n'
|
36
|
-
printf '\t$(PYDIST_PYCDIR)/./
|
36
|
+
printf '\t$(PYDIST_PYCDIR)/./_sysconfigdata_$(PYTHON_ABIFL)_$(PYTHON_PLATFORM)_.py\n\n'
|
37
37
|
|
38
38
|
cpvar=$(printf '\tcp -p $(%s)' 'PYDIST_SYSCFG_SRCS')
|
39
39
|
printf '%-80s$(DESTDIR)/$(LIBDIR)/$(PACKAGE)\n' "$cpvar" >> $pysrcs
|
@@ -8,7 +8,7 @@ PYDIST_PYCDIR = lib/$(NICKNAME)
|
|
8
8
|
|
9
9
|
|
10
10
|
PYDIST_SYSCFG_SRCS = \
|
11
|
-
$(PYDIST_PYCDIR)/./
|
11
|
+
$(PYDIST_PYCDIR)/./_sysconfigdata_$(PYTHON_ABIFL)_$(PYTHON_PLATFORM)_.py
|
12
12
|
|
13
13
|
PYDIST_SRCS = \
|
14
14
|
$(PYDIST_PYCDIR)/./__future__.py \
|
@@ -8,7 +8,7 @@ PYDIST_PYCDIR = lib/$(NICKNAME)
|
|
8
8
|
|
9
9
|
|
10
10
|
PYDIST_SYSCFG_SRCS = \
|
11
|
-
$(PYDIST_PYCDIR)/./
|
11
|
+
$(PYDIST_PYCDIR)/./_sysconfigdata_$(PYTHON_ABIFL)_$(PYTHON_PLATFORM)_.py
|
12
12
|
|
13
13
|
PYDIST_SRCS = \
|
14
14
|
$(PYDIST_PYCDIR)/./__future__.py \
|