Hello there,
I posted something like these patches already, but this is an slightly
modified version of the patches.
It allows to configure which framebuffer surfaces are compiled. At least
for MiNT this is usefull, because compiling x frontend gives compilation
errors... (and I expect there are other people who don't want to have X
development files around just because they wan't to use an SDL version of
the framebuffer lib)
This patch allows others to fine-tune the compilation process and makes
compilation for MiNT possible without patches.
Please have a look and tell me how to improve this, maybe it's even OK and
can be added to the trunk? :)
Greets,
Ole
--- Makefile.orig Thu Jul 1 18:08:36 2010
+++ Makefile Thu Jul 1 19:18:08 2010
@@ -3,6 +3,7 @@
COMPONENT_VERSION := 0.0.1
# Default to a static library
COMPONENT_TYPE ?= lib-static
+HOST := $(shell uname -s)
# Setup the tooling
include build/makefiles/Makefile.tools
@@ -11,15 +12,28 @@
TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
# Toolchain flags
-WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
- -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
- -Wmissing-declarations -Wnested-externs -Werror -pedantic \
- -Wno-overlength-strings # For nsglobe.c
+ifeq ($(HOST),FreeMiNT)
+ WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -pedantic \
+ -Wno-overlength-strings # For nsglobe.c
+else
+ WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -Werror -pedantic \
+ -Wno-overlength-strings # For nsglobe.c
+endif
+
CFLAGS := -g -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \
-I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
# TODO: probably want to retrieve SDL from pkg-config
-TESTLDFLAGS = -Wl,--whole-archive -l$(COMPONENT) -Wl,--no-whole-archive -lSDL
-lxcb-icccm -lxcb -lxcb-image
+ifeq ($(HOST),FreeMiNT)
+ DISABLED_SURFACES = x able linux vnc
+ TESTLDFLAGS = -Wl,--whole-archive -l$(COMPONENT) -Wl,--no-whole-archive
-lSDL -lgem -lm
+else
+ TESTLDFLAGS = -Wl,--whole-archive -l$(COMPONENT) -Wl,--no-whole-archive
-lSDL -lxcb-icccm -lxcb -lxcb-image
+endif
include build/makefiles/Makefile.top
--- Makefile.orig Thu Jul 1 18:09:52 2010
+++ Makefile Thu Jul 1 19:13:02 2010
@@ -1,4 +1,23 @@
# Sources
-DIR_SOURCES := surface.c sdl.c vnc.c able.c ram.c linux.c x.c
+DIR_SOURCES := surface.c
+
+ifneq ($(findstring sdl, $(DISABLED_SURFACES)),sdl)
+ DIR_SOURCES += sdl.c
+endif
+ifneq ($(findstring vnc, $(DISABLED_SURFACES)),vnc)
+ DIR_SOURCES += vnc.c
+endif
+ifneq ($(findstring able, $(DISABLED_SURFACES)),able)
+ DIR_SOURCES += able.c
+endif
+ifneq ($(findstring ram, $(DISABLED_SURFACES)),ram)
+ DIR_SOURCES += ram.c
+endif
+ifneq ($(findstring linux, $(DISABLED_SURFACES)),linux)
+ DIR_SOURCES += linux.c
+endif
+ifneq ($(findstring x, $(DISABLED_SURFACES)),x)
+ DIR_SOURCES += x.c
+endif
include build/makefiles/Makefile.subdir