# HG changeset patch # User John Tsiombikas # Date 1443318930 -10800 # Node ID 2a0ef5efb8e2ad66263a91920fd590e1fb26c436 # Parent 64e15874f3bd4bf8381da507d9c2682a6e0c0caf fixed macosx build diff -r 64e15874f3bd -r 2a0ef5efb8e2 .hgignore --- a/.hgignore Sat Sep 26 02:56:07 2015 +0300 +++ b/.hgignore Sun Sep 27 04:55:30 2015 +0300 @@ -9,3 +9,4 @@ \.png$ ^data/ \.DS_Store +^test$ diff -r 64e15874f3bd -r 2a0ef5efb8e2 Makefile --- a/Makefile Sat Sep 26 02:56:07 2015 +0300 +++ b/Makefile Sun Sep 27 04:55:30 2015 +0300 @@ -10,10 +10,17 @@ CFLAGS = -pedantic -Wall -g $(def) $(incdir) CXXFLAGS = $(CFLAGS) -LDFLAGS = -lGL -lGLU -lglut -lGLEW -lm -ldl +LDFLAGS = $(libgl) -lm -ldl include libs/Makefile +sys := $(shell uname -s) +ifeq ($(sys), Darwin) + libgl = -framework OpenGL -framework GLUT -lGLEW +else + libgl = -lGL -lGLU -lglut -lGLEW +endif + $(bin): $(obj) $(CXX) -o $@ $(obj) $(LDFLAGS) diff -r 64e15874f3bd -r 2a0ef5efb8e2 src/config.h --- a/src/config.h Sat Sep 26 02:56:07 2015 +0300 +++ b/src/config.h Sun Sep 27 04:55:30 2015 +0300 @@ -4,7 +4,7 @@ #ifdef __APPLE__ #include -#if defined(TARGET_IPHONE_SIMULATOR) || defined(TARGET_OS_IPHONE) +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #define IPHONE #define TARGET_IPHONE #endif diff -r 64e15874f3bd -r 2a0ef5efb8e2 src/glut/main.c --- a/src/glut/main.c Sat Sep 26 02:56:07 2015 +0300 +++ b/src/glut/main.c Sun Sep 27 04:55:30 2015 +0300 @@ -20,7 +20,13 @@ #include #include #include + +#ifdef __APPLE__ +#include +#else #include +#endif + #include "sanegl.h" #include "istereo.h" #include "sdr.h" @@ -33,7 +39,7 @@ int main(int argc, char **argv) { glutInit(&argc, argv); - glutInitWindowSize(640, 920); + glutInitWindowSize(920, 640); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow("test"); diff -r 64e15874f3bd -r 2a0ef5efb8e2 src/uitheme.cc --- a/src/uitheme.cc Sat Sep 26 02:56:07 2015 +0300 +++ b/src/uitheme.cc Sun Sep 27 04:55:30 2015 +0300 @@ -28,7 +28,7 @@ static std::map funcmap; -extern "C"// __attribute__ ((used)) +extern "C" __attribute__ ((used)) WidgetDrawFunc get_widget_func(const char *name) { static bool initialized;