environment settings

Ryan Schmidt ryandesign at macports.org
Sun Nov 25 15:35:48 UTC 2018



On Nov 25, 2018, at 09:13, Mark Brethen wrote:

> (resent with correction)
> 
> I’m using the compilers group with
> 
> compilers.choose    cc f77
> compilers.setup     require_fortran
> 
> below is the env settings:
> 
> :debug:configure Environment: 
> :debug:configure CC='/usr/bin/clang'
> :debug:configure CC_PRINT_OPTIONS='YES'
> :debug:configure CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_marbre_ports_math_taucs/taucs/work/.CC_PRINT_OPTIONS'
> :debug:configure CFLAGS='-pipe -Os -arch x86_64'
> :debug:configure CPATH='/opt/local/include'
> :debug:configure CPPFLAGS='-I/opt/local/include'
> :debug:configure CXX='/usr/bin/clang++'
> :debug:configure CXXFLAGS='-pipe -Os -stdlib=libc++ -arch x86_64'
> :debug:configure F77='/opt/local/bin/gfortran-mp-8'
> :debug:configure F77FLAGS='-m64'
> :debug:configure F90FLAGS='-pipe -Os -m64'
> :debug:configure FCFLAGS='-pipe -Os -m64'
> :debug:configure FFLAGS='-pipe -Os'
> :debug:configure INSTALL='/usr/bin/install -c'
> :debug:configure LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64'
> :debug:configure LIBRARY_PATH='/opt/local/lib'
> :debug:configure MACOSX_DEPLOYMENT_TARGET='10.12'
> :debug:configure OBJC='/usr/bin/clang'
> :debug:configure OBJCFLAGS='-pipe -Os -arch x86_64'
> :debug:configure OBJCXX='/usr/bin/clang++'
> :debug:configure OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -arch x86_64'
> 
> for this particular port, I need to override the build and pass F77 as the linker. I tried
> 
> build.args-append   CC=${configure.cc} \
>                   F77=${configure.f77}
> 
> build.target        lib/${os.platform}${os.major}/libtaucs.a
> 
> build {
>   ui_info "Building libtaucs archives:"
>   system -W ${worksrcpath} "${build.cmd} ${build.args} ${build.target}"
> }
> 
> with 'LD = $(F77)’ in the Makefile, but that didn’t work. How should I pass this during build?

I suppose that ought to work, except that perhaps the problem you're running into is that ${build.args} is a list of values. If you want to concatenate all those list items with spaces and include that expanded value in a string, as you're doing here, you'll need to use the expand operator ({*}). Technically, build.cmd and build.target (and all other MacPorts options) are lists too, though they might only contain one item at the moment. To properly expand all those lists into strings, you'd use: "{*}${build.cmd} {*}${build.args} {*}${build.target}".

However, you probably should not override the build phase with this custom code block, because then you don't get a lot of conveniences that MacPorts provides. The custom build block you showed above doesn't look like it's trying to do anything different from the standard build phase, so I would just remove it. If you let MacPorts do the build phase the default way, you wouldn't run into that problem. Though I'm not 100% certain that was the problem, since you didn't show the way in which it didn't work.




More information about the macports-dev mailing list