Hi, I’m getting errors when running make on the 2022f release, on my macOS Monterrey (12.6.1) machine.

There are two separate errors. When I run `make` with no arguments, I get the following:

cc -DTZDIR='"/usr/share/zoneinfo"'    -c -o zic.o zic.c
zic.c:1194:11: error: implicit declaration of function 'getrandom' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      s = getrandom(entropy_buffer, sizeof entropy_buffer, 0);
          ^
1 error generated.


After some digging, I tried running `make CFLAGS="-DHAVE_GETRANDOM=0”`, which then presents a different error:

cc -DTZDIR='"/usr/share/zoneinfo"' -o zic -DHAVE_GETRANDOM=0  zic.o
Undefined symbols for architecture x86_64:
  "_libintl_gettext", referenced from:
      _main in zic.o
      _close_file in zic.o
      _usage in zic.o
      _warning in zic.o
      _infile in zic.o
      _adjleap in zic.o
      _associate in zic.o
      ...
  "_libintl_setlocale", referenced from:
      _main in zic.o
  "_libintl_textdomain", referenced from:
      _main in zic.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


I’m not a C programmer so I’m out of my depth with trying to diagnose workarounds. Possibly there’s just another CFLAGS argument I need to provide, or I’ve got something else weird in my environment?

Some extra bits of context:


Also, the Makefile comment for the HAVE_GETRANDOM flag says "-DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)*” — is “getgrandom” a typo?

Cheers,
Gil