Closed sanssecours closed 2 years ago
Looks good, makes sense.
Does this work as expected?
sudo make SYSTEM=darwin-universal install
Does this work as expected?
sudo make SYSTEM=darwin-universal install
The command above fails with a linker error on my machine:
install -d -m 0755 "/usr/local/include/GL"
install -m 0644 include/GL/wglew.h "/usr/local/include/GL/"
install -m 0644 include/GL/glew.h "/usr/local/include/GL/"
install -m 0644 include/GL/glxew.h "/usr/local/include/GL/"
install -m 0644 include/GL/eglew.h "/usr/local/include/GL/"
mkdir lib
cc -DGLEW_NO_GLU -DGLEW_BUILD -Os -Wall -W -Iinclude -dynamic -fno-common -pedantic -fPIC -arch i386 -arch x86_64 -arch arm64 -std=c89 -o tmp/darwin-universal/default/shared/glew.o -c src/glew.c
cc -dynamiclib -install_name /usr/local/lib/libGLEW.2.2.0.dylib -current_version 2.2.0 -compatibility_version 2.2 -o lib/libGLEW.2.2.0.dylib tmp/darwin-universal/default/shared/glew.o -arch i386 -arch x86_64 -arch arm64 -framework OpenGL
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks//OpenGL.framework/OpenGL.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks//OpenGL.framework/OpenGL.tbd (3 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
Undefined symbols for architecture i386:
"___bzero", referenced from:
_glewContextInit in glew.o
"___stack_chk_fail", referenced from:
_glewContextInit in glew.o
"___stack_chk_guard", referenced from:
_glewContextInit in glew.o
"_dlopen", referenced from:
_NSGLGetProcAddress in glew.o
"_dlsym", referenced from:
_NSGLGetProcAddress in glew.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libGLEW.2.2.0.dylib] Error 1
Ah, looks like it's time to retire i386 from the universal build.
Ah, looks like it's time to retire i386 from the universal build.
I removed the flags for the i386
architecture in the latest commit. Installing the library with
sudo make SYSTEM=darwin-universal install
now works on my machine.
š Hi,
this pull request adds Apple Silicon support to the Makefile for universal Mac builds. If I should change anything in the pull request, then please just comment below. Thank you.
BTW: Is there an easy way to only install the static version of the library? I was able to build the static version of GLEW with:
However, installing the library with:
failed with the following error message on my machine:
For now I just used the following commands as workaround: