use_configure yes fails building universal(?)

Mihai Moldovan ionic at macports.org
Mon Mar 30 21:11:40 PDT 2015


Hi,

I've hit a very strange issue/bug in base and need some help with that.

I've been trying to build this Portfile universal:
https://git.ionic.de/macports-overlay.git/blob/02c90350a:/textproc/mandoc/Portfile

This *configures* universal, but doesn't *build* universal, though.
Excerpt from debug log:


--->  Configuring mandoc
[...]
CC='/usr/bin/clang'
CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_macports_textproc_mandoc/mandoc/work/.CC_PRINT_OPTIONS'
CFLAGS='-pipe -Os -arch x86_64 -arch i386'
[...]
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64
-arch i386'
[...]
DEBUG: Assembled command: 'cd
"/opt/local/var/macports/build/_opt_macports_textproc_mandoc/mandoc/work/mdocml-1.13.3"
&& ./configure --prefix=/opt/local --disable-dependency-tracking'


Okay, everything fine here!

But the build phase looks different:


--->  Building mandoc
[...]
CFLAGS='-I/opt/local/include -Os -arch x86_64'
[...]
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64'
[...]
DEBUG: Assembled command: 'cd
"/opt/local/var/macports/build/_opt_macports_textproc_mandoc/mandoc/work/mdocml-1.13.3"
&& /usr/bin/make -w all CC="/usr/bin/clang"'


This is stripping off -arch i386! And does so even though the Portfile
clearly says:

build.env           CFLAGS="${configure.cppflags} ${configure.cflags}
[get_canonical_archflags cc]" \
                    LDFLAGS="${configure.ldflags}
[get_canonical_archflags ld]"


Okay, great.

My rather old port, fatsort, does build universal though -- also
confirmed via looking at its debug output. I'll omit it here, but CFLAGS
and LDFLAGS are set correctly in the build phase.

BUT it also sets use_configure no.

So I've had a hunch and updated the Portfile to this:

https://git.ionic.de/macports-overlay.git/blob/d83da2dc:/textproc/mandoc/Portfile

After adding use_configure no, variant universal {} and configure {
system -W "${worksrcpath}" "./configure" } -- the ONLY changes -- the
port builds correctly!

Debug log excerpt, again:


--->  Configuring mandoc
[...]
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (mandoc)


Note how this time the environment is empty in configure (which makes
sense, given that the environment is only updated in portconfigure.tcl
if use_configure is true.)


--->  Building mandoc
[...]
CFLAGS='-I/opt/local/include -Os -arch x86_64 -arch i386'
CPATH='/opt/local/include'
LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64
-arch i386'
[...]
DEBUG: Executing command line:  cd
"/opt/local/var/macports/build/_opt_macports_textproc_mandoc/mandoc/work/mdocml-1.13.3"
&& /usr/bin/make -w all CC="/usr/bin/clang"


See how CFLAGS, LDFLAGS are correctly set in the environment? Likewise,
also [get_canonical_archflags ld] and [get_canonical_archflags cc]
return the correct values in the build phase.


Why is this happening?

I've been looking through base, but wasn't able to find anything related
to environment, configure or even archflags in portbuild.tcl.



Mihai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20150331/a41b4b48/attachment.sig>


More information about the macports-dev mailing list