Skip to content

Commit

Permalink
python portgroup: add -stdlib to CXXFLAGS
Browse files Browse the repository at this point in the history
New option python.set_cxx_stdlib can be set to no to disable this.

Fixes: https://trac.macports.org/ticket/56567
  • Loading branch information
jmroot committed Jun 1, 2018
1 parent db8e24a commit 42374e3
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions _resources/port1.0/group/python-1.0.tcl
Expand Up @@ -119,22 +119,29 @@ proc python_set_versions {option action args} {
}
if {[info exists addcode] && ![info exists python._addedcode]} {
pre-build {
set pycxxflags ""
if {${python.add_archflags}} {
if {[variant_exists universal] && [variant_isset universal]} {
build.env-append CFLAGS="${configure.universal_cflags}" \
OBJCFLAGS="${configure.universal_cflags}" \
CXXFLAGS="${configure.universal_cxxflags}" \
LDFLAGS="${configure.universal_ldflags}"
set pycxxflags ${configure.universal_cxxflags}
} else {
build.env-append CFLAGS="${configure.cc_archflags}" \
OBJCFLAGS="${configure.objc_archflags}" \
CXXFLAGS="${configure.cxx_archflags}" \
FFLAGS="${configure.f77_archflags}" \
F90FLAGS="${configure.f90_archflags}" \
FCFLAGS="${configure.fc_archflags}" \
LDFLAGS="${configure.ld_archflags}"
set pycxxflags ${configure.cxx_archflags}
}
}
if {${python.set_cxx_stdlib}} {
set pycxxflags [portconfigure::construct_cxxflags $pycxxflags]
}
if {$pycxxflags ne ""} {
build.env-append CXXFLAGS="$pycxxflags"
}
if {${python.set_compiler}} {
foreach var {cc objc cxx fc f77 f90} {
if {[set configure.${var}] ne ""} {
Expand All @@ -144,22 +151,29 @@ proc python_set_versions {option action args} {
}
}
pre-destroot {
set pycxxflags ""
if {${python.add_archflags} && ${python.consistent_destroot}} {
if {[variant_exists universal] && [variant_isset universal]} {
destroot.env-append CFLAGS="${configure.universal_cflags}" \
OBJCFLAGS="${configure.universal_cflags}" \
CXXFLAGS="${configure.universal_cxxflags}" \
LDFLAGS="${configure.universal_ldflags}"
set pycxxflags ${configure.universal_cxxflags}
} else {
destroot.env-append CFLAGS="${configure.cc_archflags}" \
OBJCFLAGS="${configure.objc_archflags}" \
CXXFLAGS="${configure.cxx_archflags}" \
FFLAGS="${configure.f77_archflags}" \
F90FLAGS="${configure.f90_archflags}" \
FCFLAGS="${configure.fc_archflags}" \
LDFLAGS="${configure.ld_archflags}"
set pycxxflags ${configure.cxx_archflags}
}
}
if {${python.set_cxx_stdlib}} {
set pycxxflags [portconfigure::construct_cxxflags $pycxxflags]
}
if {$pycxxflags ne ""} {
destroot.env-append CXXFLAGS="$pycxxflags"
}
if {${python.set_compiler} && ${python.consistent_destroot}} {
foreach var {cc objc cxx fc f77 f90} {
if {[set configure.${var}] ne ""} {
Expand Down Expand Up @@ -313,15 +327,16 @@ proc python_get_defaults {var} {
}
}

options python.add_archflags
options python.add_archflags python.set_compiler python.set_cxx_stdlib \
python.link_binaries python.link_binaries_suffix \
python.move_binaries python.move_binaries_suffix

default python.add_archflags yes
options python.set_compiler
default python.set_compiler yes
default python.set_cxx_stdlib yes

options python.link_binaries python.link_binaries_suffix
default python.link_binaries {[python_get_defaults link_binaries]}
default python.link_binaries_suffix {[python_get_defaults binary_suffix]}

options python.move_binaries python.move_binaries_suffix
default python.move_binaries {[python_get_defaults move_binaries]}
default python.move_binaries_suffix {[python_get_defaults binary_suffix]}

0 comments on commit 42374e3

Please sign in to comment.