summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-01-06 16:32:59 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-01-06 16:32:59 +0000
commitf3a77d3c00c095a53f37aa7efb39d56168799596 (patch)
tree0bd2269afe0edd5018c5d231c95a5011002c83cf
parent628079a91ca6d86a7915906d266e6fe5593bb846 (diff)
downloadlibrufl-f3a77d3c00c095a53f37aa7efb39d56168799596.tar.gz
librufl-f3a77d3c00c095a53f37aa7efb39d56168799596.tar.bz2
Port to core buildsystem.
The python module (and associated make runes) need some love (as does non-GCC building with the core buildsystem in general) svn path=/trunk/rufl/; revision=9792
-rw-r--r--Makefile44
-rwxr-xr-xbuild/tools/makeglyphs (renamed from makeglyphs)0
-rw-r--r--include/rufl.h (renamed from rufl.h)0
-rw-r--r--librufl.pc.in10
-rw-r--r--makefile108
-rw-r--r--python/Mk.old21
-rw-r--r--python/ruflmodule.c (renamed from ruflmodule.c)0
-rw-r--r--src/Glyphs (renamed from Glyphs)0
-rw-r--r--src/Makefile12
-rw-r--r--src/rufl_character_set_test.c (renamed from rufl_character_set_test.c)0
-rw-r--r--src/rufl_decompose.c (renamed from rufl_decompose.c)0
-rw-r--r--src/rufl_dump_state.c (renamed from rufl_dump_state.c)0
-rw-r--r--src/rufl_find.c (renamed from rufl_find.c)0
-rw-r--r--src/rufl_init.c (renamed from rufl_init.c)0
-rw-r--r--src/rufl_internal.h (renamed from rufl_internal.h)0
-rw-r--r--src/rufl_invalidate_cache.c (renamed from rufl_invalidate_cache.c)0
-rw-r--r--src/rufl_metrics.c (renamed from rufl_metrics.c)0
-rw-r--r--src/rufl_paint.c (renamed from rufl_paint.c)2
-rw-r--r--src/rufl_quit.c (renamed from rufl_quit.c)0
-rw-r--r--src/strfuncs.c (renamed from strfuncs.c)2
-rw-r--r--src/strfuncs.h (renamed from strfuncs.h)0
-rw-r--r--test/Makefile4
-rw-r--r--test/rufl_chars.c (renamed from rufl_chars.c)4
-rw-r--r--test/rufl_test.c (renamed from rufl_test.c)8
24 files changed, 104 insertions, 111 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6928eb6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+# Component settings
+COMPONENT := rufl
+COMPONENT_VERSION := 0.0.1
+# Default to a static library
+COMPONENT_TYPE ?= lib-static
+
+# Setup the tooling
+include build/makefiles/Makefile.tools
+
+TESTRUNNER := $(ECHO)
+
+# Toolchain flags
+WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
+ -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wnested-externs -pedantic
+# BeOS/Haiku/AmigaOS4 standard library headers create warnings
+ifneq ($(TARGET),beos)
+ ifneq ($(TARGET),AmigaOS)
+ WARNFLAGS := $(WARNFLAGS) -Werror
+ endif
+endif
+CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+ifneq ($(GCCVER),2)
+ CFLAGS := $(CFLAGS) -std=c99
+else
+ # __inline__ is a GCCism
+ CFLAGS := $(CFLAGS) -Dinline="__inline__"
+endif
+
+# OSLib
+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
+ ifeq ($(TARGET),riscos)
+ CFLAGS := $(CFLAGS) -I$(PREFIX)/include
+ LDFLAGS := $(LDFLAGS) -lOSLib32
+ endif
+endif
+
+include build/makefiles/Makefile.top
+
+# Extra installation rules
+I := /include
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/rufl.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) /lib/pkgconfig:lib$(COMPONENT).pc.in
+INSTALL_ITEMS := $(INSTALL_ITEMS) /lib:$(OUTPUT)
diff --git a/makeglyphs b/build/tools/makeglyphs
index 6acb350..6acb350 100755
--- a/makeglyphs
+++ b/build/tools/makeglyphs
diff --git a/rufl.h b/include/rufl.h
index 767022e..767022e 100644
--- a/rufl.h
+++ b/include/rufl.h
diff --git a/librufl.pc.in b/librufl.pc.in
new file mode 100644
index 0000000..0996103
--- /dev/null
+++ b/librufl.pc.in
@@ -0,0 +1,10 @@
+prefix=PREFIX
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: librufl
+Description: RISC OS Unicode font library
+Version: VERSION
+Libs: -L${libdir} -lrufl
+Cflags: -I${includedir}
diff --git a/makefile b/makefile
deleted file mode 100644
index b5d7d24..0000000
--- a/makefile
+++ /dev/null
@@ -1,108 +0,0 @@
-#
-# This file is part of RUfl
-# Licensed under the MIT License,
-# http://www.opensource.org/licenses/mit-license
-# Copyright 2005 James Bursa <james@semichrome.net>
-#
-
-# choose one of the two below
-COMPILER = gcc
-#COMPILER = norcroft
-
-
-SOURCE = rufl_init.c rufl_quit.c rufl_dump_state.c \
- rufl_character_set_test.c \
- rufl_paint.c rufl_glyph_map.c rufl_invalidate_cache.c \
- rufl_find.c rufl_decompose.c rufl_metrics.c
-HDRS = rufl.h rufl_internal.h
-
-.PHONY: all install clean
-
-ifeq ($(COMPILER), gcc)
-# cross-compiling using GCCSDK or native build with GCC
-
-HOST := $(shell uname -s)
-ifeq ($(HOST),)
- HOST := riscos
- $(warning Build platform determination failed but that's a known problem for RISC OS so we're assuming a native RISC OS build.)
-else
- ifeq ($(HOST),RISC OS)
- # Fixup uname -s returning "RISC OS"
- HOST := riscos
- endif
-endif
-
-ifeq ($(HOST),riscos)
- GCCSDK_INSTALL_ENV ?= <NSLibs$$Dir>
- CC := gcc
- AR := ar
-else
- GCCSDK_INSTALL_CROSSBIN ?= /home/riscos/cross/bin
- GCCSDK_INSTALL_ENV ?= /home/riscos/env
- CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
- AR := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
-endif
-
-CFLAGS = -std=c99 -O3 -W -Wall -Wundef -Wpointer-arith -Wcast-qual \
- -Wcast-align -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wmissing-declarations \
- -Wnested-externs -Winline -Wno-unused-parameter \
- -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
-ARFLAGS = cr
-LIBS = -L$(GCCSDK_INSTALL_ENV)/lib -lOSLib32
-INSTALL = $(GCCSDK_INSTALL_ENV)/ro-install
-OBJS = $(SOURCE:.c=.o)
-ifneq (,$(findstring arm-unknown-riscos-gcc,$(CC)))
- EXEEXT=,e1f
-else
- EXEEXT=,ff8
-endif
-
-all: librufl.a rufl_test$(EXEEXT) rufl_chars$(EXEEXT)
-
-librufl.a: $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
-
-install: librufl.a
- $(INSTALL) librufl.a $(GCCSDK_INSTALL_ENV)/lib/librufl.a
- $(INSTALL) rufl.h $(GCCSDK_INSTALL_ENV)/include/rufl.h
-else
-# compiling on RISC OS using Norcroft
-CC = cc
-CFLAGS = -fn -ecz -wap -IOSLib: -DNDEBUG
-LD = link
-LDFLAGS = -aof
-LIBS = OSLib:o.oslib32
-MKDLK = makedlk
-SOURCE += strfuncs.c
-OBJS = $(SOURCE:.c=.o)
-EXEEXT =
-
-all: librufl.a rufl/pyd rufl_test rufl_chars
-
-librufl.a: $(OBJS)
- $(LD) $(LDFLAGS) -o $@ $(OBJS)
-o.ruflmodule: ruflmodule.o librufl.a
- $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-ruflmodule.o: ruflmodule.c
- $(CC) -fn -wp -IPyInc:Include,PyInc:RISCOS,TCPIPLibs:,OSLib: -c $@ $<
-rufl/pyd: o.ruflmodule
- $(MKDLK) -s <Python$$Dir>.RISCOS.s.linktab -o $< -d $@ -e initrufl
-endif
-
-
-# common rules
-rufl_glyph_map.c: Glyphs makeglyphs
- ./makeglyphs < Glyphs > $@
-
-rufl_test$(EXEEXT): rufl_test.c librufl.a
- $(CC) $(CFLAGS) $(LIBS) -o $@ $^
-
-rufl_chars$(EXEEXT): rufl_chars.c librufl.a
- $(CC) $(CFLAGS) $(LIBS) -o $@ $^
-
-.c.o: $(HDRS)
- $(CC) $(CFLAGS) -c -o $@ $<
-
-clean:
- -rm *.o librufl.a rufl_glyph_map.c rufl_test$(EXEEXT) rufl_chars$(EXEEXT)
diff --git a/python/Mk.old b/python/Mk.old
new file mode 100644
index 0000000..e996722
--- /dev/null
+++ b/python/Mk.old
@@ -0,0 +1,21 @@
+# compiling on RISC OS using Norcroft
+CC = cc
+CFLAGS = -fn -ecz -wap -IOSLib: -DNDEBUG
+LD = link
+LDFLAGS = -aof
+LIBS = OSLib:o.oslib32
+MKDLK = makedlk
+SOURCE += strfuncs.c
+OBJS = $(SOURCE:.c=.o)
+EXEEXT =
+
+all: librufl.a rufl/pyd rufl_test rufl_chars
+
+librufl.a: $(OBJS)
+ $(LD) $(LDFLAGS) -o $@ $(OBJS)
+o.ruflmodule: ruflmodule.o librufl.a
+ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
+ruflmodule.o: ruflmodule.c
+ $(CC) -fn -wp -IPyInc:Include,PyInc:RISCOS,TCPIPLibs:,OSLib: -c $@ $<
+rufl/pyd: o.ruflmodule
+ $(MKDLK) -s <Python$$Dir>.RISCOS.s.linktab -o $< -d $@ -e initrufl
diff --git a/ruflmodule.c b/python/ruflmodule.c
index b62a883..b62a883 100644
--- a/ruflmodule.c
+++ b/python/ruflmodule.c
diff --git a/Glyphs b/src/Glyphs
index d39fa0a..d39fa0a 100644
--- a/Glyphs
+++ b/src/Glyphs
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..e8a7509
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,12 @@
+# Sources
+DIR_SOURCES := rufl_character_set_test.c rufl_decompose.c rufl_dump_state.c \
+ rufl_find.c rufl_init.c rufl_invalidate_cache.c \
+ rufl_metrics.c rufl_paint.c rufl_quit.c strfuncs.c
+
+SOURCES := $(SOURCES) $(BUILDDIR)/rufl_glyph_map.c
+
+$(BUILDDIR)/rufl_glyph_map.c: src/Glyphs
+ $(VQ)$(ECHO) "MKGLYPHS: $<"
+ $(Q)$(PERL) build/tools/makeglyphs < $< > $@
+
+include build/makefiles/Makefile.subdir
diff --git a/rufl_character_set_test.c b/src/rufl_character_set_test.c
index 45fbcaf..45fbcaf 100644
--- a/rufl_character_set_test.c
+++ b/src/rufl_character_set_test.c
diff --git a/rufl_decompose.c b/src/rufl_decompose.c
index edf9748..edf9748 100644
--- a/rufl_decompose.c
+++ b/src/rufl_decompose.c
diff --git a/rufl_dump_state.c b/src/rufl_dump_state.c
index 06a1f22..06a1f22 100644
--- a/rufl_dump_state.c
+++ b/src/rufl_dump_state.c
diff --git a/rufl_find.c b/src/rufl_find.c
index a1c2785..a1c2785 100644
--- a/rufl_find.c
+++ b/src/rufl_find.c
diff --git a/rufl_init.c b/src/rufl_init.c
index 533955a..533955a 100644
--- a/rufl_init.c
+++ b/src/rufl_init.c
diff --git a/rufl_internal.h b/src/rufl_internal.h
index 1c01e36..1c01e36 100644
--- a/rufl_internal.h
+++ b/src/rufl_internal.h
diff --git a/rufl_invalidate_cache.c b/src/rufl_invalidate_cache.c
index 65a3897..65a3897 100644
--- a/rufl_invalidate_cache.c
+++ b/src/rufl_invalidate_cache.c
diff --git a/rufl_metrics.c b/src/rufl_metrics.c
index af4727f..af4727f 100644
--- a/rufl_metrics.c
+++ b/src/rufl_metrics.c
diff --git a/rufl_paint.c b/src/rufl_paint.c
index 084fea5..8b9edf1 100644
--- a/rufl_paint.c
+++ b/src/rufl_paint.c
@@ -418,7 +418,7 @@ rufl_code rufl_process_span_old(rufl_action action,
/* Process the span in map-coherent chunks */
do {
- struct rufl_unicode_map *map;
+ struct rufl_unicode_map *map = NULL;
struct rufl_unicode_map_entry *entry = NULL;
unsigned int j;
diff --git a/rufl_quit.c b/src/rufl_quit.c
index fc429c0..fc429c0 100644
--- a/rufl_quit.c
+++ b/src/rufl_quit.c
diff --git a/strfuncs.c b/src/strfuncs.c
index e6c6347..08b43b2 100644
--- a/strfuncs.c
+++ b/src/strfuncs.c
@@ -2,6 +2,8 @@
#include <stdlib.h>
#include <string.h>
+#include "strfuncs.h"
+
char *strdup(const char *s)
{
size_t len = strlen(s);
diff --git a/strfuncs.h b/src/strfuncs.h
index 495ea98..495ea98 100644
--- a/strfuncs.h
+++ b/src/strfuncs.h
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..30e1600
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,4 @@
+# Tests
+DIR_TEST_ITEMS := rufl_test:rufl_test.c rufl_chars:rufl_chars.c
+
+include build/makefiles/Makefile.subdir
diff --git a/rufl_chars.c b/test/rufl_chars.c
index 440a1d0..14a0fb6 100644
--- a/rufl_chars.c
+++ b/test/rufl_chars.c
@@ -33,7 +33,7 @@ int main(void)
message_QUIT } };
wimp_t task;
wimp_menu *menu;
- wimp_WINDOW(0) window = {
+ struct wimp_window_base window = {
{ 400, 400, 1700, 1200 },
0, 0,
wimp_TOP,
@@ -107,7 +107,7 @@ int main(void)
(wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT) |
(wimp_COLOUR_WHITE << wimp_ICON_BG_COLOUR_SHIFT);
menu->entries[10 + i].data.indirected_text.text =
- rufl_family_list[i];
+ (char *) rufl_family_list[i];
menu->entries[10 + i].data.indirected_text.validation =
(char *) -1;
menu->entries[10 + i].data.indirected_text.size =
diff --git a/rufl_test.c b/test/rufl_test.c
index f07a9b7..51a29d6 100644
--- a/rufl_test.c
+++ b/test/rufl_test.c
@@ -97,6 +97,8 @@ void try(rufl_code code, const char *context)
int move_to(os_coord *to, void *user)
{
+ (void) user;
+
printf("Move to (%d,%d)\n", to->x, to->y);
return 0;
@@ -105,6 +107,8 @@ int move_to(os_coord *to, void *user)
int line_to(os_coord *to, void *user)
{
+ (void) user;
+
printf("Line to (%d,%d)\n", to->x, to->y);
return 0;
@@ -114,6 +118,8 @@ int line_to(os_coord *to, void *user)
int cubic_to(os_coord *control1, os_coord *control2, os_coord *to,
void *user)
{
+ (void) user;
+
printf("Bezier to (%d,%d),(%d,%d),(%d,%d)\n",
control1->x, control1->y,
control2->x, control2->y,
@@ -128,6 +134,8 @@ void callback(void *context,
const char *s8, unsigned short *s16, unsigned int n,
int x, int y)
{
+ (void) context;
+
printf("callback: \"%s\", %u, ", font_name, font_size);
if (s8)
printf("s8 \"%.*s\" ", n, s8);