This problem does not seem to me to be specific to the libproj4 port, since the libproj4 port does not specify or require a particular compiler; I expect you will encounter similar problems with other ports.
The log says:
:debug:configure Preferred compilers: cc
:debug:configure Using compiler 'System cc'
:info:build /usr/bin/cc -I. -I/opt/local/include -DPROJ_HAVE_GSL=1 -DPROJ_HAVE_THREADS=1 -Os -m64 -c -o proj_aeqd.o proj_aeqd.c
This is surprising. "System cc" is a fallback included in MacPorts primarily for the virtually completely unused use case of MacPorts running on non-macOS systems. When running on macOS systems, MacPorts should be picking a more specific compiler, such as Xcode's clang. You should only see this behavior on macOS if you have installed neither Xcode nor the command line tools. And the log shows that, at least as far as MacPorts knows, that is the case:
:debug:sysinfo Xcode none
I see from the log that you're using macOS Mojave. To use MacPorts on Mojave, we recommend installing Xcode. Make sure you install a version of Xcode compatible with Mojave (Xcode 10 or 11). If you have installed the command line tools, make sure it is a version that matches the version of Xcode you have installed.
The log also shows:
:info:build ar rv libproj4.a proj_aeqd.o
:info:build ar: creating archive libproj4.a
:info:build /opt/local/bin/ranlib: object: libproj4.a(proj_aeqd.o) malformed object (unknown load command 1)
:info:build ar: internal ranlib command failed
ar
and ranlib
are provided by the cctools port. This error message suggests that your cctools is too old to understand the files being produced by whatever compiler is being used. The cctools port currently provides version 921, which matches what Apple shipped in Xcode 10. If you are using the clang compiler from Xcode 11, then you need a newer version of cctools than that. I have requested that the cctools port be updated to an Xcode 11-compatible version, but until that's done, you'll need to reinstall the cctools port with the +xcode variant.