Hello,
this patches enables MiNT users linking with libnsfb without hassle and
without further need of patching the sdl.pc file.
Without this patch, the developer needs to patch sdl.pc - because the
compiler complaints about doubly defined references to system functions
caused by the --whole-archive flag.
the -u hack is needed because the function _sdl_register_frontend must be
referenced by netsurf - otherwise it's not linked into netsurf (at least
not without the --whole-archive flag) and therefore not called before main.
Greets,
Ole
--- Makefile.orig Thu Jul 1 19:51:52 2010
+++ Makefile Thu Jul 1 19:55:18 2010
@@ -575,11 +575,12 @@
CFLAGS += $(shell curl-config --cflags)
else
CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
- endif
-
- LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb)
-Wl,--no-whole-archive
+ endif
ifeq ($(HOST),mint)
+ # Avoid --whole-archive flags with MiNT, its usage also requires patching
of sdl.pc
+ # therefore we use the -u trick to make sdl frontend registered before
main.
+ LDFLAGS += $(shell $(PKG_CONFIG) --libs libnsfb)
-Wl,-u,_sdl_register_frontend
LDFLAGS += $(shell curl-config --libs)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
# xml-config returns -lsocket which is not needed and does not exist on
all systems.
@@ -587,6 +588,7 @@
LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv
LDFLAGS += -lm
else
+ LDFLAGS += -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb)
-Wl,--no-whole-archive
LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub
openssl)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
endif