summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-05-14 09:41:01 (GMT)
committer Ashish Gupta <ashmew2@gmail.com>2017-09-12 17:59:04 (GMT)
commit6a239fa74e8377df5618d00ba21337ff00a0d25a (patch)
tree64e29651fed3dd498ebed9adb1d7156e3ea2ec24
parent1d0c305b82c6700d50641a9b24cb760abaa9149a (diff)
downloadnetsurf-6a239fa74e8377df5618d00ba21337ff00a0d25a.tar.gz
netsurf-6a239fa74e8377df5618d00ba21337ff00a0d25a.tar.bz2
Towards integration with shared build system
-rw-r--r--Makefile88
-rw-r--r--frontends/kolibrios/Makefile18
-rwxr-xr-xutils/jenkins-build.sh16
3 files changed, 67 insertions, 55 deletions
diff --git a/Makefile b/Makefile
index 35dfb4b..cc0c440 100644
--- a/Makefile
+++ b/Makefile
@@ -289,10 +289,12 @@ else
endif
else
ifeq ($(TARGET),kolibrios)
- CC := kos32-gcc
- LD := kos32-ld
- PKG_CONFIG := pkg-config
- PREFIX := /opt/netsurf
+ CROSSDIR := /opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/bin
+ ENVDIR := /opt/netsurf/kos32-gcc/env/
+ CC := $(CROSSDIR)/kos32-gcc
+ LD := $(CROSSDIR)/kos32-ld
+ PREFIX := /opt/netsurf/kos32-gcc/env
+ PKG_CONFIG := PKG_CONFIG_PATH=$(ENVDIR)/lib/pkgconfig pkg-config
else
# All native targets
@@ -518,32 +520,19 @@ include Makefile.defaults
-include Makefile.config
# 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
-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 -lpng16 -ljpeg
- OS_LDFLAGS := -static -S -Tapp-dynamic.lds --image-base 0 -Map netsurf-kolibrios.map
+$(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))
- 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) -lgcc -lc.dll
-endif
-
-# Common libraries without pkg-config support
ifneq ($(TARGET),kolibrios)
+ # Common libraries without pkg-config support
LDFLAGS += -lz
endif
@@ -565,22 +554,20 @@ NETSURF_FEATURE_NSLOG_CFLAGS := -DWITH_NSLOG
# resolved by the subsequent openssl
# freemint does not support pkg-config for libcurl
-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))
+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))
$(eval $(call pkg_config_find_and_add_enabled,OPENSSL,openssl,OpenSSL))
@@ -629,7 +616,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
@@ -725,18 +712,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/fs/unzip60/kolibri/dirent.o $(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/loadhttp.obj $(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o
-endif
-
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
$(VQ)echo " LINK: $(EXETARGET)"
-ifeq ($(TARGET),kolibrios)
+ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
+ ifeq ($(TARGET),kolibrios)
$(warning $(LD) -o $(EXETARGET) $(OBJECTS) $(KOLOBJECTS) $(LDFLAGS))
$(Q)$(LD) -o $(EXETARGET) $(OBJECTS) $(KOLOBJECTS) $(LDFLAGS)
objcopy -O binary nskolibrios
-else ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
+ else
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
+ endif
else
$(Q)$(CXX) -o $(EXETARGET:,ff8=,e1f) $(OBJECTS) $(LDFLAGS)
$(Q)$(ELF2AIF) $(EXETARGET:,ff8=,e1f) $(EXETARGET)
@@ -828,9 +813,6 @@ $$(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)
@@ -901,11 +883,9 @@ $(eval $(foreach SOURCE,$(filter %.s,$(SOURCES)), \
# ----------------------------------------------------------------------------
# Test setup
# ----------------------------------------------------------------------------
-
ifneq ($(TARGET),kolibrios)
- include test/Makefile
+ include test/Makefile
endif
-
# ----------------------------------------------------------------------------
# Clean setup
# ----------------------------------------------------------------------------
diff --git a/frontends/kolibrios/Makefile b/frontends/kolibrios/Makefile
index 742011b..963b085 100644
--- a/frontends/kolibrios/Makefile
+++ b/frontends/kolibrios/Makefile
@@ -1,7 +1,20 @@
+ENVDIR := $(PREFIX)
+KOLIBRI_SVN_CHECKOUT := $(ENVDIR)/kolibrios
+KOL_OBJ_DIR := $(ENVDIR)/obj
+
+KOL_LIBC := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/newlib/libc/include/
+KOL_LIB_DIR := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/lib
+LIB_LDFLAGS := -L$(KOL_LIB_DIR) -lfreetype -lpng16 -ljpeg
+OS_LDFLAGS := -static -S -Tapp-dynamic.lds --image-base 0 -Map netsurf-kolibrios.map
+NS_INCLUDE := $(PREFIX)/include
+NS_LIB_LDFLAGS := -L$(PREFIX)/lib/ -lnsbmp -lnsutils -lwapcaplet -lsvgtiny -lnsgif -lutf8proc -lcss -lnsfb -lparserutils -ldom -lhubbub
+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) -lz -lgcc -lc.dll
+
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 -DKOLIBRI_USE_FREETYPE -DFB_USE_FREETYPE
-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)/kolibrios/contrib/sdk/sources/libjpeg
+KOL_OTHER_INCLUDES := -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/libpng/ -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/zlib -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/freetype/include -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/freetype/include -I$(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/libjpeg
CFLAGS += $(KOL_OTHER_INCLUDES) $(DMACROS) -std=c99 -g
CFLAGS += '-DNETSURF_USE_KOLIBRI_HTTPLIB'
@@ -117,6 +130,9 @@ SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRONTEND) $(S_IMAGES)
EXETARGET := nskolibrios
+KOLOBJECTS = $(KOL_OBJ_DIR)/dirent.o $(KOL_OBJ_DIR)/iconv.o $(KOL_OBJ_DIR)/loadhttp.obj
+
+
## Install specific stuff
DESTDIR := $(PREFIX)/bin
diff --git a/utils/jenkins-build.sh b/utils/jenkins-build.sh
index b6ca21d..14983a2 100755
--- a/utils/jenkins-build.sh
+++ b/utils/jenkins-build.sh
@@ -357,6 +357,22 @@ case ${TARGET} in
PKG_SFX=
;;
+ "kolibrios")
+ case ${HOST} in
+ "kos32-gcc")
+ BUILD_CC := kos32-gcc
+ CC := kos32-gcc
+ AR := kos32-ar
+ LD := kos32-ld
+ ;;
+
+ *)
+ echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
+ exit 1
+ ;;
+ esac
+ ;;
+
*)
# TARGET must be in the environment and set correctly
echo "Unkown TARGET \"${TARGET}\""