Solved Problem with building port x11/x3270

Something in my configs affects port builds and I can't find what is it.
Building x11/x3270
fails on my 13.2-STABLE, 13.2-RELEASE and 12.4-RELEASE.

Build works on freshly installed 13.2-RELEASE with no configs at all, and after first login to OS, only commands issued are:
pkg install git
git clone /usr/ports
cd /usr/ports/x11/x3270 ; make stage

and build is done without errors.

On every other of my systems build fails with:

../../../Common/pr3287/pr3287.c:1167:59: error: use of undeclared identifier 'PX_SUCCESS'; did you mean 'SI_SUCCESS'?

PX_SUCCESS is declared, and build works if (after error) I do:
cd work/suite3270-4.2
CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure
cd ../../ ; make stage

Build also works with USE_GCC=yes added to Makefile, without need to manually reconfigure.

My /etc/make.conf
CFLAGS= -O2 -pipe -fno-strict-aliasing 
COPTFLAGS= -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing

Build fails even with everything in the make.conf commented out.

Where should I look, which configs affect port builds?
It failed with everything in the make.con commented out, I just deleted those lines and it fails the same.

IMO it's not a make.conf problem because it works with manual:
work/suite3270-4.2/ > CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure
or with
USE_GCC=yes added to Makefile


Staff member
Can't find any build issues on so we can assume it builds fine on the build clusters. You could verify this on but I currently don't have IPv6 so I can't access the actual build logs. It's always good to verify the status on the build clusters. If it builds fine there it's safe to assume it's something on your local system that's causing it to fail. If the build servers have the same (or similar) build issues you can assume it's an issue with the port itself.
It builds fine on freshly installed 13.2-RELEASE, as I mentioned in the top post.
That's why I'm asking where to look in my working systems for misconfiguration.


Staff member
Build clusters build packages in a 'clean room' environment. It's possible there's something installed on your system that's causing those build issues, some dependency that's 'automagically' detected and used.
SirDice you are right, definitely some of installed packages are causing this strange error.

How I know?

I made a list of all installed packages on freshly installed OS (pkg info -aqo > pkg-list-fresh.txt); all pkgs there (except git and pkg) are installed by 'make stage' in x11/x3270.

Then I made a list of all installed packages on older 13.2-RELEASE (~1480 of them) and deleted all packages with pkg del -af; then I went to /usr/local/ and rm -rf *; then I scp pkg-list-fresh.txt to older RELEASE, cat pkg-list-fresh.txt | xargs pkg ins -y and installed only those packages which make x3270 pulled - and voilà - build works.

Then I reinstalled all packages which were there previously and there is the same error again.

So, good thing is that none of my custom configs caused this.

Bad thing is that now I have to figure out which one of almost 1500 packages are making this trouble, but I can't have my beloved FreeBSD not building something that by default builds okay, can I?

Thanks for pointing me in the right direction.
Thanks Charlie_ , you are a star!

libproxy is the problem here, but removing libproxy is not an option because it is needed by 50+ of my installed packages.

Instead, I came up with this change in the x11/x3270/Makefie

--- /usr/ports/x11/x3270/Makefile.orig  2023-06-09 12:16:41.979645000 +0200
+++ /usr/ports/x11/x3270/Makefile       2023-06-09 12:17:33.345056000 +0200
@@ -62,6 +62,9 @@
 PLIST_SUB+=    DBCS="@comment "
+       @${REINPLACE_CMD} -e 's|"proxy.h"|"${WRKSRC}/include/proxy.h"|' ${WRKSRC}/Common/pr3287/pr3287.c
 .for m in b3270 c3270 pr3287 s3270 tcl3270
        @(cd ${WRKSRC} ; ${INSTALL_MAN} ${m}/${m}.man ${STAGEDIR}${MAN1PREFIX}/man/man1/${m}.1)

Is it there a simpler solution?


Staff member
Problem is probably caused by ./configure finding the wrong files. You often have this problem when disabling features too. GNU configure would still detect it is installed and silently enable the feature. The port however doesn't register it as a dependency so you end up with a broken package.

Is it there a simpler solution?
Don't build ports on existing systems. Issues like this are the reason why poudriere and Synth build packages in a 'clean' environment.
SirDice you are absolutely right about building ports in the clean environments.

I'm using packages almost exclusively since FreeBSD 10; but what bothers me is that someone else might stumble into same problem and I don't know should I inform x3270 maintainer about this or not?


Staff member
I don't think the maintainer is able to do anything about GNU configure misbehaving. Similar issues crop up in a lot of other ports too.