diff -rupN a/Makefile b/Makefile --- a/Makefile 2012-12-10 00:07:30.342990324 -0600 +++ b/Makefile 2012-12-10 01:10:34.375417524 -0600 @@ -39,6 +39,8 @@ SHELL = /bin/sh +PKG_CONFIG ?= pkg-config + # GRAPHICS TESTS: Uncomment the definition of "GRAPHIC_TESTS" to enable # the building of the graphics benchmarks. This will require the # X11 libraries on your system. @@ -47,38 +49,15 @@ SHELL = /bin/sh # GRAPHIC_TESTS = defined # Set "GL_LIBS" to the libraries needed to link a GL program. -GL_LIBS = -lGL -lXext -lX11 - - -# COMPILER CONFIGURATION: Set "CC" to the name of the compiler to use -# to build the binary benchmarks. You should also set "$cCompiler" in the -# Run script to the name of the compiler you want to test. -CC=gcc - -# OPTIMISATION SETTINGS: - -## Very generic -#OPTON = -O - -## For Linux 486/Pentium, GCC 2.7.x and 2.8.x -#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \ -# -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 - -## For Linux, GCC previous to 2.7.0 -#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math -m486 - -#OPTON = -O2 -fomit-frame-pointer -fforce-addr -fforce-mem -ffast-math \ -# -m386 -malign-loops=1 -malign-jumps=1 -malign-functions=1 - -## For Solaris 2, or general-purpose GCC 2.7.x -OPTON = -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall - -## For Digital Unix v4.x, with DEC cc v5.x -#OPTON = -O4 -#CFLAGS = -DTIME -std1 -verbose -w0 +ifdef GRAPHIC_TESTS +GL_CFLAGS = $(shell $(PKG_CONFIG) --cflags gl) +GL_LIBS = $(shell $(PKG_CONFIG) --libs gl) +else +GL_CFLAGS = +GL_LIBS = +endif -## generic gcc CFLAGS. -DTIME must be included. -CFLAGS = -DTIME -Wall -pedantic -ansi +OPTON = -DTIME -Wall -pedantic -ansi ############################################################################## @@ -116,7 +95,8 @@ BINS = $(PROGDIR)/arithoh $(PROGDIR)/reg $(PROGDIR)/hanoi $(PROGDIR)/syscall $(PROGDIR)/context1 \ $(PROGDIR)/pipe $(PROGDIR)/spawn $(PROGDIR)/execl \ $(PROGDIR)/dhry2 $(PROGDIR)/dhry2reg $(PROGDIR)/looper \ - $(PROGDIR)/fstime $(PROGDIR)/whetstone-double $(GRAPHIC_BINS) + $(PROGDIR)/fstime $(PROGDIR)/whetstone-double $(GRAPHIC_BINS) \ + $(PROGDIR)/poll $(PROGDIR)/select ## These compile only on some platforms... # $(PROGDIR)/poll $(PROGDIR)/poll2 $(PROGDIR)/select @@ -238,7 +218,7 @@ $(PROGDIR)/looper: $(SRCDIR)/looper.c $(CC) -o $(PROGDIR)/looper ${CFLAGS} ${OPTON} $(SRCDIR)/looper.c $(PROGDIR)/ubgears: $(SRCDIR)/ubgears.c - $(CC) -o $(PROGDIR)/ubgears ${CFLAGS} ${OPTON} $(SRCDIR)/ubgears.c $(GL_LIBS) + $(CC) -o $(PROGDIR)/ubgears ${CFLAGS} ${GL_CFLAGS} ${OPTON} $(SRCDIR)/ubgears.c $(GL_LIBS) -lm # Run the benchmarks and create the reports run: