# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortGroup xcode_workaround 1.0
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description GNU multiple precision arithmetic library
GNU MP is a library for arbitrary precision arithmetic, operating on\
signed integers, rational numbers, and floating point numbers. It \
has a rich set of functions, and the functions have a regular \
interface. GNU MP is designed to be as fast as possible, both for \
small operands and for huge operands. The speed is achieved by using\
fullwords as the basic arithmetic type, by using fast algorithms, by\
carefully optimized assembly code for the most common inner loops \
for a lots of CPUs, and by a general emphasis on speed (instead of \
homepage https://gmplib.org/
checksums rmd160 03b905b4d7f243705b72b2d7595ce40df716020a \
sha256 5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2 \
#see https://github.com/macports/macports-ports/commit/d55e7627d6f3fe7076881c8d1408fa405c0c54b9
configure.args --enable-cxx
configure.universal_args-delete --disable-dependency-tracking
# Clear all options that affect CFLAGS and CXXFLAGS, since the configure
# script tries to build the fastest library for the build machine if
# CFLAGS and CXXFLAGS are undefined.
# On PowerPC machines, CFLAGS must be empty to get -force_cpusubtype_ALL.
# Append all extra flags to compiler name, which is a far from ideal solution.
# the following code must run BEFORE configure.cc is modified
set configure_cc_save ${configure.cc}
# Clearing configure.cxx_stdlib will change the dynamic value of
# configure.compiler, rendering configure_cc_save incorrect. So
# collapse the waveform here.
configure.compiler ${configure.compiler}
# do not let configure set CC in gmp-h.in because we modify CC later and
# we do not want these modifications to end up in the installed header file
# ugly workaround for #49801
# for upstream discussion, see https://gmplib.org/list-archives/gmp-discuss/2015-November/thread.html#5910
reinplace "s|\"@CC@\"|\"${configure_cc_save}\"|g" ${worksrcpath}/gmp-h.in
# Append the -stdlib flags to CXX, since we still want to select the C++ STL.
if {[string match *clang* ${configure.cxx}]} {
configure.cxx-append -stdlib=${configure.cxx_stdlib}
if {${configure.sdkroot} ne ""} {
configure.cc-append -isysroot${configure.sdkroot}
configure.cxx-append -isysroot${configure.sdkroot}