summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-04-13 21:36:26 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-06-10 06:25:29 (GMT)
commit6fed24e8948c1acaaeae002b9ee7ee44a7e2e0a5 (patch)
tree313901d40813d40f94fc5898f782ff55c82df26d
parent6fd280bb5b27842a0ef2977798566c37bd4e1d0e (diff)
downloadnetsurf-6fed24e8948c1acaaeae002b9ee7ee44a7e2e0a5.tar.gz
netsurf-6fed24e8948c1acaaeae002b9ee7ee44a7e2e0a5.tar.bz2
Step 2 : Abuse _TARGET_IS_KOLIBRIOS and build with make TARGET=kolibrios
-rw-r--r--Makefile90
-rw-r--r--content/fetch.c4
-rw-r--r--content/fetchers/file.c6
-rw-r--r--desktop/save_complete.c18
-rw-r--r--frontends/framebuffer/font.h4
-rw-r--r--frontends/kolibrios/Makefile101
-rw-r--r--frontends/kolibrios/Makefile.defaults9
-rw-r--r--frontends/kolibrios/fb/font.h1
-rw-r--r--frontends/kolibrios/fb/gui.c61
-rw-r--r--frontends/kolibrios/fb/schedule.c7
-rw-r--r--utils/config.h19
-rw-r--r--utils/inet.h14
-rw-r--r--utils/nsoption.h11
-rw-r--r--utils/utils.c14
14 files changed, 221 insertions, 138 deletions
diff --git a/Makefile b/Makefile
index 0c2933b..21edda4 100644
--- a/Makefile
+++ b/Makefile
@@ -109,7 +109,7 @@ ifeq ($(TARGET),)
endif
# valid values for the TARGET
-VLDTARGET := riscos gtk gtk3 beos amiga amigaos3 framebuffer windows atari monkey
+VLDTARGET := riscos gtk gtk3 beos amiga amigaos3 framebuffer windows atari monkey kolibrios
# Check for valid TARGET
ifeq ($(filter $(VLDTARGET),$(TARGET)),)
@@ -287,7 +287,12 @@ else
CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
CXX := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
endif
-
+ else
+ ifeq ($(TARGET),kolibrios)
+ CC := kos32-gcc
+ LD := kos32-ld
+ PKG_CONFIG := pkg-config
+ PREFIX := /opt/netsurf
else
# All native targets
@@ -312,6 +317,7 @@ else
endif
endif
endif
+ endif
endif
endif
endif
@@ -509,19 +515,34 @@ CWARNFLAGS := -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
include Makefile.defaults
# libraries enabled by feature switch without pkgconfig file
-$(eval $(call feature_switch,JPEG,JPEG (libjpeg),-DWITH_JPEG,-ljpeg,-UWITH_JPEG,))
-$(eval $(call feature_switch,HARU_PDF,PDF export (haru),-DWITH_PDF_EXPORT,-lhpdf -lpng,-UWITH_PDF_EXPORT,))
-$(eval $(call feature_switch,LIBICONV_PLUG,glibc internal iconv,-DLIBICONV_PLUG,,-ULIBICONV_PLUG,-liconv))
-$(eval $(call feature_switch,DUKTAPE,Javascript (Duktape),,,,,))
# Common libraries with pkgconfig
-$(eval $(call pkg_config_find_and_add,libcss,CSS))
-$(eval $(call pkg_config_find_and_add,libdom,DOM))
-$(eval $(call pkg_config_find_and_add,libnsutils,nsutils))
-$(eval $(call pkg_config_find_and_add,libutf8proc,utf8proc))
+ifneq ($(TARGET),kolibrios)
+ $(eval $(call feature_switch,JPEG,JPEG (libjpeg),-DWITH_JPEG,-ljpeg,-UWITH_JPEG,))
+ $(eval $(call feature_switch,HARU_PDF,PDF export (haru),-DWITH_PDF_EXPORT,-lhpdf -lpng,-UWITH_PDF_EXPORT,))
+ $(eval $(call feature_switch,LIBICONV_PLUG,glibc internal iconv,-DLIBICONV_PLUG,,-ULIBICONV_PLUG,-liconv))
+ $(eval $(call feature_switch,DUKTAPE,Javascript (Duktape),,,,,))
+ $(eval $(call pkg_config_find_and_add,libcss,CSS))
+ $(eval $(call pkg_config_find_and_add,libdom,DOM))
+ $(eval $(call pkg_config_find_and_add,libnsutils,nsutils))
+ $(eval $(call pkg_config_find_and_add,libutf8proc,utf8proc))
+else
+ KOL_LIBC := $(HOME)/kolibrios/contrib/sdk/sources/newlib/libc/include/
+ KOL_LIB_DIR := $(HOME)/kolibrios/contrib/sdk/lib
+ LIB_LDFLAGS := -L$(KOL_LIB_DIR) -lfreetype
+ OS_LDFLAGS := -static -Tapp-static.lds
+
+ NS_INCLUDE := $(PREFIX)/include
+ NS_LIB_LDFLAGS := -L$(PREFIX)/lib/ -lnsbmp -lnsutils -lwapcaplet -lsvgtiny -lnsgif -lutf8proc -lcss -lnsfb -lparserutils -ldom -lhubbub -lz
+
+ CFLAGS += -c -fno-ident -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U__BSD_VISIBLE -I$(KOL_LIBC) -I$(NS_INCLUDE)
+ LDFLAGS += $(OS_LDFLAGS) $(NS_LIB_LDFLAGS) $(LIB_LDFLAGS) -lc -lgcc -lc.dll
+endif
# Common libraries without pkg-config support
-LDFLAGS += -lz
+ifneq ($(TARGET),kolibrios)
+ LDFLAGS += -lz
+endif
# Optional libraries with pkgconfig
@@ -540,20 +561,22 @@ NETSURF_FEATURE_NSPSL_CFLAGS := -DWITH_NSPSL
# resolved by the subsequent openssl
# freemint does not support pkg-config for libcurl
-ifeq ($(HOST),mint)
- CFLAGS += $(shell curl-config --cflags)
- LDFLAGS += $(shell curl-config --libs)
-else
- $(eval $(call pkg_config_find_and_add_enabled,CURL,libcurl,Curl))
+ifneq ($(TARGET),kolibrios)
+ ifeq ($(HOST),mint)
+ CFLAGS += $(shell curl-config --cflags)
+ LDFLAGS += $(shell curl-config --libs)
+ else
+ $(eval $(call pkg_config_find_and_add_enabled,CURL,libcurl,Curl))
+ endif
+ $(eval $(call pkg_config_find_and_add_enabled,OPENSSL,openssl,OpenSSL))
+
+ $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
+ $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
+ $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
+ $(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
+ $(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
+ $(eval $(call pkg_config_find_and_add_enabled,NSPSL,libnspsl,PSL))
endif
-$(eval $(call pkg_config_find_and_add_enabled,OPENSSL,openssl,OpenSSL))
-
-$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG))
-$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
-$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
-$(eval $(call pkg_config_find_and_add_enabled,NSSVG,libsvgtiny,SVG))
-$(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
-$(eval $(call pkg_config_find_and_add_enabled,NSPSL,libnspsl,PSL))
# List of directories in which headers are searched for
INCLUDE_DIRS :=. include $(OBJROOT)
@@ -581,7 +604,7 @@ $(DEPROOT)/created: $(OBJROOT)/created
$(Q)$(TOUCH) $(DEPROOT)/created
$(TOOLROOT)/created: $(OBJROOT)/created
- $(VQ)echo " MKDIR: $(TOOLROOT)"
+ $(VQ)echo "MKDIR: $(TOOLROOT)"
$(Q)$(MKDIR) -p $(TOOLROOT)
$(Q)$(TOUCH) $(TOOLROOT)/created
@@ -677,9 +700,16 @@ OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.c,%.o,$(patsu
# Include directory flags
IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
+ifeq ($(TARGET),kolibrios)
+ KOLOBJECTS = $(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o $(HOME)/kolibrios/programs/fs/unzip60/kolibri/dirent.o
+endif
+
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
$(VQ)echo " LINK: $(EXETARGET)"
-ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
+ifeq ($(TARGET),kolibrios)
+ $(warning $(LD) -o $(EXETARGET) $(OBJECTS) $(KOLOBJECTS) $(LDFLAGS))
+ $(Q)$(LD) -o $(EXETARGET) $(OBJECTS) $(KOLOBJECTS) $(LDFLAGS)
+else ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
@@ -772,6 +802,9 @@ $$(DEPROOT)/$(3) $$(OBJROOT)/$(2): $$(OBJROOT)/created
$$(VQ)echo " COMPILE: $(1)"
$$(Q)$$(RM) $$(DEPROOT)/$(3)
$$(Q)$$(RM) $$(OBJROOT)/$(2)
+# $$(VQ)echo "$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(IFLAGS) $$(CFLAGS) $(CFLAGS_ENV) \
+ -MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
+ -MF $$(DEPROOT)/$(3) -o $$(OBJROOT)/$(2) -c $(1)"
$$(Q)$$(CC) $$(COMMON_WARNFLAGS) $$(CWARNFLAGS) $$(IFLAGS) $$(CFLAGS) $(CFLAGS_ENV) \
-MMD -MT '$$(DEPROOT)/$(3) $$(OBJROOT)/$(2)' \
-MF $$(DEPROOT)/$(3) -o $$(OBJROOT)/$(2) -c $(1)
@@ -843,8 +876,9 @@ $(eval $(foreach SOURCE,$(filter %.s,$(SOURCES)), \
# Test setup
# ----------------------------------------------------------------------------
-include test/Makefile
-
+ifneq ($(TARGET),kolibrios)
+ include test/Makefile
+endif
# ----------------------------------------------------------------------------
# Clean setup
diff --git a/content/fetch.c b/content/fetch.c
index a69d3e4..bfc84ea 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -54,7 +54,11 @@
#include "content/fetchers.h"
#include "content/fetchers/resource.h"
#include "content/fetchers/about.h"
+#if defined(_TARGET_IS_KOLIBRIOS)
+#include "content/fetchers/http_kolibri.h"
+#else
#include "content/fetchers/curl.h"
+#endif
#include "content/fetchers/data.h"
#include "content/fetchers/file.h"
#include "javascript/fetcher.h"
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index 4fa1a21..067d9be 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -656,7 +656,13 @@ static void fetch_file_process_dir(struct fetch_file_context *ctx,
int i; /* directory entry index */
int n; /* number of directory entries */
+#ifndef _TARGET_IS_KOLIBRIOS
n = scandir(ctx->path, &listing, 0, dir_sort_alpha);
+#else
+ /* Don't have scandir yet */
+ n = 1;
+#endif
+
if (n < 0) {
fetch_file_process_error(ctx,
fetch_file_errno_to_http_code(errno));
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index d6fb2fe..859576f 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -51,6 +51,24 @@
#include "desktop/save_complete.h"
regex_t save_complete_import_re;
+#ifdef _TARGET_IS_KOLIBRIOS
+int
+regcomp (regex_t *preg, const char *pattern, int cflags)
+{
+}
+
+int
+regexec (const regex_t *preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags)
+{
+}
+
+size_t
+regerror (int errcode, const regex_t *preg,
+ char *errbuf, size_t errbuf_size)
+{
+}
+#endif
/** An entry in save_complete_list. */
typedef struct save_complete_entry {
diff --git a/frontends/framebuffer/font.h b/frontends/framebuffer/font.h
index 722a604..dfac436 100644
--- a/frontends/framebuffer/font.h
+++ b/frontends/framebuffer/font.h
@@ -58,11 +58,7 @@ nserror fb_font_position(const struct plot_font_style *fstyle, const char *strin
nserror fb_font_width(const struct plot_font_style *fstyle, const char *string, size_t length, int *width);
-#ifdef FB_USE_FREETYPE
-#include "framebuffer/font_freetype.h"
-#else
#include "framebuffer/font_internal.h"
-#endif
#endif /* NETSURF_FB_FONT_H */
diff --git a/frontends/kolibrios/Makefile b/frontends/kolibrios/Makefile
index ad86c43..bed51a7 100644
--- a/frontends/kolibrios/Makefile
+++ b/frontends/kolibrios/Makefile
@@ -1,9 +1,9 @@
-CWARNFLAGS += -Wno-error -Wno-redundant-decls -Wno-char-subscripts -Wno-undef
-CDMACROS := -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -D_NETBSD_SOURCE
-KOL_LIBC_INCLUDES := -I$(HOME)/kolibrios/contrib/sdk/sources/newlib/libc/include/
-KOL_OTHER_INCLUDES := -I$(HOME)/kolibrios/contrib/sdk/sources/libpng/ -I$(HOME)/kolibrios/contrib/sdk/sources/zlib -I$(HOME)/kolibrios/contrib/sdk/sources/freetype/include -I$(HOME)/kolibrios/contrib/sdk/sources/freetype/include -I$(HOME)/dev-netsurf/workspace/netsurf/libiconv/libiconv-1.14 -I$(HOME)/dev-netsurf/workspace/netsurf/libjpeg
+CWARNFLAGS += -Wno-error -Wno-redundant-decls -Wno-char-subscripts -Wno-undef -Wno-implicit-function-declaration -Wno-int-conversion -Wno-nested-externs -Wno-format-extra-args -Wno-format
+DMACROS := -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -D_NETBSD_SOURCE -D_TARGET_IS_KOLIBRIOS
-CFLAGS += -fno-ident -fomit-frame-pointer $(KOL_LIBC_INCLUDES) $(KOL_OTHER_INCLUDES) -std=c99 -g
+KOL_OTHER_INCLUDES := -I$(HOME)/kolibrios/contrib/sdk/sources/libpng/ -I$(HOME)/kolibrios/contrib/sdk/sources/zlib -I$(HOME)/kolibrios/contrib/sdk/sources/freetype/include -I$(HOME)/kolibrios/contrib/sdk/sources/freetype/include -I$(HOME)/dev-netsurf/workspace/netsurf/libjpeg
+
+CFLAGS += $(KOL_OTHER_INCLUDES) $(DMACROS) -std=c99 -g
CFLAGS += '-DNETSURF_KOLIBRI_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"'
CFLAGS += '-DNETSURF_KOLIBRI_FONT_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
@@ -12,9 +12,11 @@ CFLAGS += '-DKOLIBRI_USE_FREETYPE'
##########################################################################
# Only for FB compat with kolibri. Get rid soon.
-CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH)"'
+CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_KOLIBRI_RESPATH)"'
+
# compile time font locations
-CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_FB_FONTPATH)"'
+CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"'
+CFLAGS += '-DKOLIBRI_FONT_FREETYPE_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
@@ -29,41 +31,36 @@ CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
#########################################################################
-KOLIBRI_IMAGE_left_arrow := icons/back.png
-KOLIBRI_IMAGE_right_arrow := icons/forward.png
-KOLIBRI_IMAGE_reload := icons/reload.png
-KOLIBRI_IMAGE_stop_image := icons/stop.png
-KOLIBRI_IMAGE_history_image := icons/history.png
-
-KOLIBRI_IMAGE_left_arrow_g := icons/back_g.png
-KOLIBRI_IMAGE_right_arrow_g := icons/forward_g.png
-KOLIBRI_IMAGE_reload_g := icons/reload_g.png
-KOLIBRI_IMAGE_stop_image_g := icons/stop_g.png
-KOLIBRI_IMAGE_history_image_g := icons/history_g.png
-
-KOLIBRI_IMAGE_scrolll := icons/scrolll.png
-KOLIBRI_IMAGE_scrollr := icons/scrollr.png
-KOLIBRI_IMAGE_scrollu := icons/scrollu.png
-KOLIBRI_IMAGE_scrolld := icons/scrolld.png
-
-KOLIBRI_IMAGE_osk_image := icons/osk.png
-
-KOLIBRI_IMAGE_pointer_image := pointers/default.png
-KOLIBRI_IMAGE_hand_image := pointers/point.png
-KOLIBRI_IMAGE_caret_image := pointers/caret.png
-KOLIBRI_IMAGE_menu_image := pointers/menu.png
-KOLIBRI_IMAGE_progress_image := pointers/progress.png
-KOLIBRI_IMAGE_move_image := pointers/move.png
-
-KOLIBRI_IMAGE_throbber0 := throbber/throbber0.png
-KOLIBRI_IMAGE_throbber1 := throbber/throbber1.png
-KOLIBRI_IMAGE_throbber2 := throbber/throbber2.png
-KOLIBRI_IMAGE_throbber3 := throbber/throbber3.png
-KOLIBRI_IMAGE_throbber4 := throbber/throbber4.png
-KOLIBRI_IMAGE_throbber5 := throbber/throbber5.png
-KOLIBRI_IMAGE_throbber6 := throbber/throbber6.png
-KOLIBRI_IMAGE_throbber7 := throbber/throbber7.png
-KOLIBRI_IMAGE_throbber8 := throbber/throbber8.png
+KOLIBRI_IMAGE_left_arrow := $(FRONTEND_SOURCE_DIR)/res/icons/back.png
+KOLIBRI_IMAGE_right_arrow := $(FRONTEND_SOURCE_DIR)/res/icons/forward.png
+KOLIBRI_IMAGE_reload := $(FRONTEND_SOURCE_DIR)/res/icons/reload.png
+KOLIBRI_IMAGE_stop_image := $(FRONTEND_SOURCE_DIR)/res/icons/stop.png
+KOLIBRI_IMAGE_history_image := $(FRONTEND_SOURCE_DIR)/res/icons/history.png
+KOLIBRI_IMAGE_left_arrow_g := $(FRONTEND_SOURCE_DIR)/res/icons/back_g.png
+KOLIBRI_IMAGE_right_arrow_g := $(FRONTEND_SOURCE_DIR)/res/icons/forward_g.png
+KOLIBRI_IMAGE_reload_g := $(FRONTEND_SOURCE_DIR)/res/icons/reload_g.png
+KOLIBRI_IMAGE_stop_image_g := $(FRONTEND_SOURCE_DIR)/res/icons/stop_g.png
+KOLIBRI_IMAGE_history_image_g := $(FRONTEND_SOURCE_DIR)/res/icons/history_g.png
+KOLIBRI_IMAGE_scrolll := $(FRONTEND_SOURCE_DIR)/res/icons/scrolll.png
+KOLIBRI_IMAGE_scrollr := $(FRONTEND_SOURCE_DIR)/res/icons/scrollr.png
+KOLIBRI_IMAGE_scrollu := $(FRONTEND_SOURCE_DIR)/res/icons/scrollu.png
+KOLIBRI_IMAGE_scrolld := $(FRONTEND_SOURCE_DIR)/res/icons/scrolld.png
+KOLIBRI_IMAGE_osk_image := $(FRONTEND_SOURCE_DIR)/res/icons/osk.png
+KOLIBRI_IMAGE_pointer_image := $(FRONTEND_SOURCE_DIR)/res/pointers/default.png
+KOLIBRI_IMAGE_hand_image := $(FRONTEND_SOURCE_DIR)/res/pointers/point.png
+KOLIBRI_IMAGE_caret_image := $(FRONTEND_SOURCE_DIR)/res/pointers/caret.png
+KOLIBRI_IMAGE_menu_image := $(FRONTEND_SOURCE_DIR)/res/pointers/menu.png
+KOLIBRI_IMAGE_progress_image := $(FRONTEND_SOURCE_DIR)/res/pointers/progress.png
+KOLIBRI_IMAGE_move_image := $(FRONTEND_SOURCE_DIR)/res/pointers/move.png
+KOLIBRI_IMAGE_throbber0 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber0.png
+KOLIBRI_IMAGE_throbber1 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber1.png
+KOLIBRI_IMAGE_throbber2 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber2.png
+KOLIBRI_IMAGE_throbber3 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber3.png
+KOLIBRI_IMAGE_throbber4 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber4.png
+KOLIBRI_IMAGE_throbber5 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber5.png
+KOLIBRI_IMAGE_throbber6 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber6.png
+KOLIBRI_IMAGE_throbber7 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber7.png
+KOLIBRI_IMAGE_throbber8 := $(FRONTEND_SOURCE_DIR)/res/throbber/throbber8.png
# Host tool to convert image bitmaps to source code.
#
@@ -71,10 +68,11 @@ KOLIBRI_IMAGE_throbber8 := throbber/throbber8.png
# header, we get new images built.
HOST_LDFLAGS += -lpng
+
$(TOOLROOT)/convert_image: $(TOOLROOT)/created $(FRONTEND_SOURCE_DIR)/fb/convert_image.c
$(VQ)echo " HOST CC: $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) -o $@ $(FRONTEND_SOURCE_DIR)/fb/convert_image.c $(HOST_LDFLAGS)
-
+
# 1: input file
# 2: output file
# 3: bitmap name
@@ -88,18 +86,15 @@ $(2): $(1) $(TOOLROOT)/convert_image
endef
S_IMAGES :=
-
$(eval $(foreach V,$(filter KOLIBRI_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/image-$(patsubst KOLIBRI_IMAGE_%,%,$(V)).c,$(patsubst KOLIBRI_IMAGE_%,%,$(V)))))
-$(warning eval $(foreach V,$(filter KOLIBRI_IMAGE_%,$(.VARIABLES)),$(call convert_image,$($(V)),$(OBJROOT)/image-$(patsubst KOLIBRI_IMAGE_%,%,$(V)).c,$(patsubst KOLIBRI_IMAGE_%,%,$(V)))))
-$(error fuck this)
# Internal fonts to generate
-KOLIBRI_FONT_internal_ns-sans := framebuffer/res/fonts/glyph_data
+KOLIBRI_FONT_internal_ns-sans := $(FRONTEND_SOURCE_DIR)/res/fonts/glyph_data
# Internal font conversion
-$(TOOLROOT)/convert_font: $(TOOLROOT)/created framebuffer/convert_font.c
+$(TOOLROOT)/convert_font: $(TOOLROOT)/created $(FRONTEND_SOURCE_DIR)/fb/convert_font.c
$(VQ)echo " HOST CC: $@"
- $(Q)$(HOST_CC) -o $@ framebuffer/convert_font.c
+ $(Q)$(HOST_CC) -o $@ $(FRONTEND_SOURCE_DIR)/fb/convert_font.c
# 1: input file
# 2: output source code file
@@ -116,12 +111,8 @@ $(2): $(1) $(TOOLROOT)/convert_font
endef
S_FONTS :=
-
$(eval $(foreach V,$(filter KOLIBRI_FONT_$(NETSURF_KOLIBRI_FONTLIB)_%,$(.VARIABLES)),$(call convert_font,$($(V)),$(OBJROOT)/font-$(patsubst KOLIBRI_FONT_$(NETSURF_KOLIBRI_FONTLIB)_%,%,$(V)).c,$(OBJROOT)/font-$(patsubst KOLIBRI_FONT_$(NETSURF_KOLIBRI_FONTLIB)_%,%,$(V)).h,$(patsubst KOLIBRI_FONT_$(NETSURF_KOLIBRI_FONTLIB)_%,%,$(V)))))
-
-LDFLAGS := -static -Tapp-static.lds -L /home/bob/kolibrios/contrib/sdk/lib/ -lfreetype -lz /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libcss.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libdom.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libhubbub.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libnsbmp.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libnsfb.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libnsgif.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libnsutils.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libparserutils.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libutf8proc.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libwapcaplet.a /home/bob/dev-netsurf/workspace/netsurf/inst/lib/libnsgif.a /home/autobuild/tools/win32/lib/libiconv.a -ldll -lc -lgcc -lc -ldll
-
# non optional pkg-configed libs
#$(eval $(call pkg_config_find_and_add,libcurl,Curl ))
#$(eval $(call pkg_config_find_and_add,openssl,OpenSSL))
@@ -138,8 +129,8 @@ LDFLAGS := -static -Tapp-static.lds -L /home/bob/kolibrios/contrib/sdk/lib/ -lfr
# $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
#S_KOLIBRIOS := main.c kolibri_misc.c kolibri_debug.c kolibri_filesystem.c kolibri_regex.c kolibri_http.c
-S_KOLIBRIOS :=
-S_FRAMEBUFFER := gui.c framebuffer.c schedule.c bitmap.c fetch.c findfile.c localhistory.c clipboard.c
+S_KOLIBRIOS :=
+S_FRAMEBUFFER := gui.c framebuffer.c schedule.c bitmap.c fetch.c findfile.c localhistory.c clipboard.c
S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c text.c scroll.c osk.c
S_FRAMEBUFFER += font_$(NETSURF_KOLIBRI_FONTLIB).c
diff --git a/frontends/kolibrios/Makefile.defaults b/frontends/kolibrios/Makefile.defaults
index e5e5111..bada4565 100644
--- a/frontends/kolibrios/Makefile.defaults
+++ b/frontends/kolibrios/Makefile.defaults
@@ -23,10 +23,11 @@ NETSURF_USE_ROSPRITE := NO
# Library to use for font plotting
# Valid options: internal, freetype
-NETSURF_KOLIBRI_FONTLIB := freetype
+NETSURF_KOLIBRI_FONTLIB := internal
# Default freetype font files
-NETSURF_KOLIBRI_FONT_SANS_SERIF := sans.ttf
+NETSURF_KOLIBRI_FONT_SANS_SERIF := frontends/kolibrios/res/sans.ttf
+KOLIBRI_FONT_freetype_sans_serif := frontends/kolibrios/res/sans.ttf
# Default binary install path
NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
@@ -35,7 +36,7 @@ NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
# Res path when running on KolibriOS
-NETSURF_KOLIBRI_RESPATH := /usbhd0/1/framebuffer/res/
+NETSURF_KOLIBRI_RESPATH := /usbhd0/1/res
#Where are the fonts in Kolibri?
-#NETSURF_KOLIBRI_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
+NETSURF_KOLIBRI_FONTPATH := $(FRONTEND_SOURCE_DIR)/res/
diff --git a/frontends/kolibrios/fb/font.h b/frontends/kolibrios/fb/font.h
index 8513c93..f150e44 100644
--- a/frontends/kolibrios/fb/font.h
+++ b/frontends/kolibrios/fb/font.h
@@ -57,7 +57,6 @@ nserror fb_font_position(const struct plot_font_style *fstyle, const char *strin
*/
nserror fb_font_width(const struct plot_font_style *fstyle, const char *string, size_t length, int *width);
-
#ifdef KOLIBRI_USE_FREETYPE
#include "kolibrios/fb/font_freetype.h"
#else
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index 4d4c733..dd5ef71 100644
--- a/frontends/kolibrios/fb/gui.c
+++ b/frontends/kolibrios/fb/gui.c
@@ -55,7 +55,6 @@
#include "framebuffer/fetch.h"
#include "framebuffer/bitmap.h"
-
#define NSFB_TOOLBAR_DEFAULT_LAYOUT "blfsrutc"
fbtk_widget_t *fbtk;
@@ -485,36 +484,36 @@ process_cmdline(int argc, char** argv)
feurl = NETSURF_HOMEPAGE;
}
- while((opt = getopt_long(argc, argv, "f:b:w:h:",
- long_options, &option_index)) != -1) {
- switch (opt) {
- case 'f':
- fename = optarg;
- break;
-
- case 'b':
- febpp = atoi(optarg);
- break;
-
- case 'w':
- fewidth = atoi(optarg);
- break;
-
- case 'h':
- feheight = atoi(optarg);
- break;
-
- default:
- fprintf(stderr,
- "Usage: %s [-f frontend] [-b bpp] url\n",
- argv[0]);
- return false;
- }
- }
-
- if (optind < argc) {
- feurl = argv[optind];
- }
+ /* while((opt = getopt_long(argc, argv, "f:b:w:h:", */
+ /* long_options, &option_index)) != -1) { */
+ /* switch (opt) { */
+ /* case 'f': */
+ /* fename = optarg; */
+ /* break; */
+
+ /* case 'b': */
+ /* febpp = atoi(optarg); */
+ /* break; */
+
+ /* case 'w': */
+ /* fewidth = atoi(optarg); */
+ /* break; */
+
+ /* case 'h': */
+ /* feheight = atoi(optarg); */
+ /* break; */
+
+ /* default: */
+ /* fprintf(stderr, */
+ /* "Usage: %s [-f frontend] [-b bpp] url\n", */
+ /* argv[0]); */
+ /* return false; */
+ /* } */
+ /* } */
+
+ /* if (optind < argc) { */
+ /* feurl = argv[optind]; */
+ /* } */
return true;
}
diff --git a/frontends/kolibrios/fb/schedule.c b/frontends/kolibrios/fb/schedule.c
index 3a3bda6..72baa98 100644
--- a/frontends/kolibrios/fb/schedule.c
+++ b/frontends/kolibrios/fb/schedule.c
@@ -15,12 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _TARGET_IS_KOLIBRIOS
-#define _TARGET_IS_KOLIBRIOS
-#endif
-
-#ifdef _TARGET_IS_KOLIBRIOS
-
+#if defined(_TARGET_IS_KOLIBRIOS)
#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
diff --git a/utils/config.h b/utils/config.h
index ddd1c6e..0752876 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -66,19 +66,23 @@ char *strchrnul(const char *s, int c);
#undef HAVE_SYS_SELECT
#undef HAVE_POSIX_INET_HEADERS
#endif
-
+#if (defined(_TARGET_IS_KOLIBRIOS))
+#undef HAVE_INETATON
+#undef HAVE_POSIX_INET_HEADERS
+#endif
+
#define HAVE_INETPTON
-#if (defined(_WIN32))
+#if (defined(_WIN32)) || (defined(_TARGET_IS_KOLIBRIOS))
#undef HAVE_INETPTON
#endif
#define HAVE_UTSNAME
-#if (defined(_WIN32))
+#if (defined(_WIN32)) || (defined(_TARGET_IS_KOLIBRIOS))
#undef HAVE_UTSNAME
#endif
#define HAVE_REALPATH
-#if (defined(_WIN32))
+#if (defined(_WIN32)) || (defined(_TARGET_IS_KOLIBRIOS))
#undef HAVE_REALPATH
char *realpath(const char *path, char *resolved_path);
#endif
@@ -99,7 +103,7 @@ char *realpath(const char *path, char *resolved_path);
#endif
#define HAVE_MMAP
-#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
+#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__)) || defined(_TARGET_IS_KOLIBRIOS)
#undef HAVE_MMAP
#endif
@@ -139,4 +143,9 @@ char *realpath(const char *path, char *resolved_path);
#define NO_IPV6
#endif
+/* kolibriOS */
+#if defined(_TARGET_IS_KOLIBRIOS)
+#define NO_IPV6
+#endif
+
#endif
diff --git a/utils/inet.h b/utils/inet.h
index da17984..1d2263f 100644
--- a/utils/inet.h
+++ b/utils/inet.h
@@ -33,6 +33,18 @@
#include "utils/config.h"
+#ifdef _TARGET_IS_KOLIBRIOS
+
+#include <sys/select.h>
+
+/* Internet address. */
+struct in_addr {
+ uint32_t s_addr; /* address in network byte order */
+};
+
+extern int AF_INET;
+
+#else
#ifdef HAVE_POSIX_INET_HEADERS
#include <sys/socket.h>
@@ -52,6 +64,8 @@
#endif
+#endif
+
#ifndef HAVE_INETATON
int inet_aton(const char *cp, struct in_addr *inp);
#endif
diff --git a/utils/nsoption.h b/utils/nsoption.h
index e60ebd1..dc23a70 100644
--- a/utils/nsoption.h
+++ b/utils/nsoption.h
@@ -56,6 +56,13 @@
#define NSOPTION_UINT(NAME, DEFAULT)
#define NSOPTION_COLOUR(NAME, DEFAULT)
+#ifndef _TARGET_IS_KOLIBRIOS
+#define _TARGET_IS_KOLIBRIOS
+#endif
+#ifdef _TARGET_IS_KOLIBRIOS
+#define nskolibrios
+#endif
+
#include "desktop/options.h"
#if defined(riscos)
#include "riscos/options.h"
@@ -73,6 +80,8 @@
#include "monkey/options.h"
#elif defined(nswin32)
#include "windows/options.h"
+#elif defined(nskolibrios)
+#include "kolibrios/fb/options.h"
#endif
#undef NSOPTION_BOOL
@@ -146,6 +155,8 @@ enum nsoption_e {
#include "monkey/options.h"
#elif defined(nswin32)
#include "windows/options.h"
+#elif defined(nskolibrios)
+#include "kolibrios/fb/options.h"
#endif
NSOPTION_LISTEND /* end of list */
};
diff --git a/utils/utils.c b/utils/utils.c
index 15c91c6..e464a43 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -25,6 +25,9 @@
#include <string.h>
#include <strings.h>
#include <sys/stat.h>
+#ifdef _TARGET_IS_KOLIBRIOS
+#include <errno.h>
+#endif
#include "utils/messages.h"
#include "utils/dirent.h"
@@ -418,6 +421,7 @@ char *realpath(const char *path, char *resolved_path)
}
return ret;
}
+#endif
#ifndef HAVE_INETATON
@@ -448,10 +452,15 @@ int inet_aton(const char *cp, struct in_addr *inp)
int inet_pton(int af, const char *src, void *dst)
{
int ret;
-
+#ifndef _TARGET_IS_KOLIBRIOS
if (af == AF_INET) {
ret = inet_aton(src, dst);
}
+#else
+ if (1) {
+ ret = inet_aton(src, dst);
+ }
+#endif
#if !defined(NO_IPV6)
else if (af == AF_INET6) {
/* TODO: implement v6 address support */
@@ -468,6 +477,3 @@ int inet_pton(int af, const char *src, void *dst)
}
#endif
-
-
-#endif