Closed chengkai-jia closed 5 years ago
It looks like apple finally caught up with the world and added CLOCK_REALTIME
.
Try passing CFLAGS="-O2 -fPIC -DHAVE_DECL_CLOCK_REALTIME=1"
to luarocks to override cqueues's feature guessing.
I got this issue when installing kong by homebrew. I‘m not sure how to pass CFLAGS to work around it...
try to execute export CPPFLAGS="-DCLOCK_MONOTONIC -DCLOCK_REALTIME"
first . cqueues's feature guessing is not compatible on mac os
.
The last pair of flags fixed compilation for "me" (NixPkgs, not Homebrew).
I think I understand the source of the issues now. In this commit I applied
-#define HAVE_DECL_CLOCK_REALTIME (defined CLOCK_REALTIME)
+#ifdef CLOCK_REALTIME
+#define HAVE_DECL_CLOCK_REALTIME 1
+#else
+#define HAVE_DECL_CLOCK_REALTIME 0
+#endif
As "expansion-to-defined" is not a well specified C behaviour. However, it used to get expanded in cqueues.c where the relevant header had already been included. vs now it gets expanded earlier.
HOMEBREW_VERSION: 2.1.9 ORIGIN: https://github.com/Homebrew/brew.git HEAD: 3dab11263c7d3ae568bd585932b393ef526fc5b2 Last commit: 4 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: c9f348993918281b1feab396e4652ef36e7952b0 Core tap last commit: 6 hours ago HOMEBREW_PREFIX: /usr/local HOMEBREW_CACHE: /Users/k24k20190715/Library/Caches/Homebrew HOMEBREW_LOGS: /Users/k24k20190715/Library/Logs/Homebrew CPU: octa-core 64-bit kabylake Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby Clang: 10.0 build 1001 Git: 2.22.0 => /usr/local/bin/git Curl: 7.54.0 => /usr/bin/curl Java: 1.8.0_212 macOS: 10.14.6-x86_64 CLT: 10.3.0.0.1.1562985497 Xcode: N/A CLT headers: 10.3.0.0.1.1562985497
HOMEBREW_CC: clang HOMEBREW_CXX: clang++ MAKEFLAGS: -j8 CMAKE_PREFIX_PATH: /usr/local CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libxml2:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries PKG_CONFIG_PATH: /usr/local/opt/libyaml/lib/pkgconfig PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.14 HOMEBREW_GIT: git HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk ACLOCAL_PATH: /usr/local/share/aclocal PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/coreutils/bin:/usr/local/opt/openresty@1.13.6.2/bin:/usr/bin:/bin:/usr/sbin:/sbin