caldwell / build-emacs

Build scripts for www.emacsformacosx.com
http://www.emacsformacosx.com/about
GNU General Public License v3.0
368 stars 62 forks source link

Fixing Build on macos Catalina #88

Closed dgreatwood closed 2 years ago

dgreatwood commented 4 years ago

Running build on Catalina, we reach the predicted error:

  CC       xml.o
xml.c:23:10: fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
         ^~~~~~~~~~~~~~~
1 error generated.

However, not sure how to proceed with the fix sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / There is no Packages subfolder in /Library/Developer/CommandLineTools. There is no macOS_SDK_headers* file on the machine. According to various internet posts, Catalina does not include a headers package.

Is there some alternative change that would allow the build to proceed on Catalina?

BTW, the header files do seem to be expanded in the CommandLineTools folder. Both these files exist:

./Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libxml2/libxml/tree.h
./Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2/libxml/tree.h

With thanks!

nloveladyallen commented 4 years ago

This fixed it for me:

brew install libxml2
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
dgreatwood commented 4 years ago

This fixed it for me:

brew install libxml2
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

Confirmed - works for me as well, on Catalina 10.15.2

hatch-carl commented 4 years ago

You only need:

export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"