rdate port fails to build, PSB: $ uname -aK FreeBSD KPECT 11.1-STABLE FreeBSD 11.1-STABLE #0: Sat Apr 21 18:26:49 MSK 2018 root@KPECT amd64 1101515 $ cd /usr/ports/sysutils/rdate/ total 14 -rw-r--r-- 1 root wheel 134 4 мая 2015 distinfo drwxr-xr-x 2 root wheel 3 27 янв. 00:53 files -rw-r--r-- 1 root wheel 1024 27 янв. 00:53 Makefile -rw-r--r-- 1 root wheel 295 1 июня 2014 pkg-descr $ doas make ===> rdate-20150501 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by rdate-20150501 for building ===> Extracting for rdate-20150501 => SHA256 Checksum OK for rdate-20150501.tar.gz. ===> Patching for rdate-20150501 /usr/bin/sed -i.bak -e 's,/right,,' /usr/obj/usr/ports/sysutils/rdate/work/rdate/rdate.8 ===> Configuring for rdate-20150501 ===> Building for rdate-20150501 --- objwarn --- --- .depend --- echo rdate: /usr/lib/libc.a /usr/lib/libutil.a >> .depend --- objwarn --- Warning: Object directory not changed from original /usr/obj/usr/ports/sysutils/rdate/work/rdate --- rdate.o --- --- rfc868time.o --- --- ntp.o --- --- ntpleaps.o --- --- rdate.o --- cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge -MD -MF.depend.rdate.o -MTrdate.o -std=gnu99 -fstack-protector-strong -Qunused-arguments -c rdate.c -o rdate.o --- rfc868time.o --- cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge -MD -MF.depend.rfc868time.o -MTrfc868time.o -std=gnu99 -fstack-protector-strong -Qunused-arguments -c rfc868time.c -o rfc868time.o --- ntp.o --- cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge -MD -MF.depend.ntp.o -MTntp.o -std=gnu99 -fstack-protector-strong -Qunused-arguments -c ntp.c -o ntp.o --- ntpleaps.o --- cc -Os -pipe -fno-strict-aliasing -fomit-frame-pointer -funroll-loops -ffast-math -Wall -march=ivybridge -MD -MF.depend.ntpleaps.o -MTntpleaps.o -std=gnu99 -fstack-protector-strong -Qunused-arguments -c ntpleaps.c -o ntpleaps.o --- rdate.o --- rdate.c:54:10: fatal error: 'util.h' file not found #include <util.h> ^~~~~~~~ 1 error generated. *** [rdate.o] Error code 1 make[1]: stopped in /usr/obj/usr/ports/sysutils/rdate/work/rdate --- ntp.o --- ntp.c:188:24: warning: implicit declaration of function 'SA_LEN' is invalid in C99 [-Wimplicit-function-declaration] if (connect(fd, peer, SA_LEN(peer)) < 0) { ^ 1 warning generated. 1 error make[1]: stopped in /usr/obj/usr/ports/sysutils/rdate/work/rdate ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make: stopped in /usr/ports/sysutils/rdate $
With which compiler you work? It seems it does not find the compiler. Or it is a error with ccache (or something in /etc/make.conf) compare with my code: --- rdate.o --- /usr/local/libexec/ccache/world/clang60 -O2 -pipe -DNO_UTIL -D__dead= -D'SA_LEN(x)= ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (x)->sa_len' -fstack-protector -fno-strict-aliasing -Wno-invalid-source-encoding -Wall -std=gnu99 ^^^^^ -Qunused-arguments -fstack-protector -c rdate.c -o rdate.o It complete ignores the CFLAGS. The -D... are in the port Makefile, -Wall comes from the source Makefile.
It seems it does not find the compiler was wrong.
Try it with CONFIGURE_ENV+="CFLAGS+=-DNO_UTIL -D__dead= -D'SA_LEN(x)=(x)->sa_len' -Wall" and MAKE_ENV+="CFLAGS+=-DNO_UTIL -D__dead= -D'SA_LEN(x)=(x)->sa_len' -Wall"
with those CFLAGS everything builds fine, thanx! # cc -v FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0) Target: x86_64-unknown-freebsd11.2 Thread model: posix InstalledDir: /usr/bin