OpenGL libraries
Ryan Schmidt
ryandesign at macports.org
Thu Nov 15 02:08:53 UTC 2018
On Nov 12, 2018, at 13:17, Mark Brethen wrote:
> Per the attached Calculix-cgx Makefile, I needed to modify it to indicate the OpenGL framework. I tried this:
>
> CFLAGS = -O2 -Wall -Wno-narrowing \
> -I./ \
> -I/usr/include \
> -I../../libSNL/src \
> -I../../glut-3.5/src \
> -I/usr/X11/include
>
> LFLAGS = \
> -framework OpenGL -lGL -lGLU \
> -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
> -lm -lpthread
>
> .
> .
> .
>
> cgx: $(OLIB) $(OUTIL) $(OULIB)
> g++ $(OULIB) $(OLIB) $(OUTIL) $(CFLAGS) $(LFLAGS) -o $@
>
> This didn’t work. Is LDFlags appropriate here? There isn’t a config file so in the portfile I pass the following @ pre-build:
>
> pre-build {
> build.args CC=${configure.cc} \
> CXX=${configure.cxx}
> }
In what way didn't it work? Did you get an error? What error?
Certainly "-I/usr/include" in the CFLAGS is unnecessary because the compiler will look there automatically, and "-I/usr/X11/include" is inappropriate because we don't want to find anything there (we want to find X11 stuff in the MacPorts prefix).
That hardcoded "g++" in the Makefile will need to be replaced with "$(CXX)" in order for your build.args to work for that.
More information about the macports-dev
mailing list