Trying to build webkit2 with macports, I get

:info:build /usr/bin/cc -c  -I/opt/local/include -fno-common
-DPERL_DARWIN -mmacosx-version-min=10.14 -pipe -Os -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-fno-strict-aliasing -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV -m64 -O3   -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\"  "-I/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE"   SSLeay.c :info:build clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot] :info:build In file included from SSLeay.xs:141:
:info:build /opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE/perl.h:684:10:¡™ fatal error: 'sys/types.h' file not found 
:info:build #include <sys/types.h>
:info:build          ^~~~~~~~~~~~~ 
:info:build 1 error generated. :info:build make: *** [SSLeay.o] Error 1

Is sys/types.h provided by netports, or a third party POSIX-compat package?


Your problem is that you have specified a non-existent sysroot directory.

Currently you have specified the following:


This is usually due to either not having Xcode installed, or having it installed in the wrong version. Even if Xcode runs, it may not be "installed". Check that the App is in /Applications, if not drag it from wherever you extracted the .xip into the Applications directory.

In your case, I would suggest installing Xcode, if it's not already installed, or update it to the latest version to get the 10.14 SDK.

If you're willing to update Xcode for some reason, you can change your sysroot to match the older version of Xcode like this:


This path points to the latest installed SDK versions. Hopefully it will be enough to build webkit2, or you will be forced to update Xcode.

  • This is exactly what was happening. I guess I didn't need the Xcode installed there to get any of this other stuff working .. Xcode was unzipped and I could run it from the home directory but it wasn't "installed" which apparently means dragging a directory of a container into "Applications" – Evan Carroll Mar 25 '19 at 14:01
  • Yes and no. In general a Mac app is self-contained (app = folder presenting as an executable file, with all other code inside) but some packages like Xcode do also install command line functions that are needed for some aspects to operate. You don't need the Xcode GUI for the command line components - you can install those by themselves if you are trying to compile code from command line. If you're developing a macOS app you want Xcode; if simply treating it like GNU Linux you should be ok with the command line tools only. – dr.nixon Mar 25 '19 at 19:05
  • Nice thing about this is that it means MOST macOS apps can be run from anywhere - including removable media - without needing to do any kind of install. The ones that do require installation use a package rather than an app format - apps are drag and drop to install, packages modify more than one target directory, more like a Windows application. – dr.nixon Mar 25 '19 at 19:08
  • after I install xCode do I have to recompile everything with ports against all the newer xCode stuff? – Evan Carroll Mar 25 '19 at 19:29
  • You do not need to "install" Xcode, nor does it absolutely need to be in /Applications. However, if you do not have it in Applications, you would obviously need to change the path in your build script/Makefile to point to the location, where you have mounted Xcode instead. Usually it's easiest to just move it to Applications like everyone else, and be free from having to edit paths. – jksoegaard Mar 25 '19 at 19:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .