--- Makefile.orig Sat Jun 19 00:34:22 2010 +++ Makefile Sun Jun 20 13:29:56 2010 @@ -76,8 +76,14 @@ else ifeq ($(HOST),Darwin) HOST := macosx - endif - + endif + ifeq ($(HOST),FreeMiNT) + HOST := mint + ifeq ($(TARGET),) + TARGET := mint + endif + endif + # Default target is GTK backend ifeq ($(TARGET),) TARGET := gtk @@ -94,7 +100,9 @@ ifneq ($(TARGET),amiga) ifneq ($(TARGET),framebuffer) ifneq ($(TARGET),windows) - $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer" or "windows") + ifneq ($(TARGET),mint) + $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer" or "windows") + endif endif endif endif @@ -537,7 +545,12 @@ $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng))) $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) )) - + ifeq ($(HOST),mint) + XML_CONFIG = xml2-config + CURL_CONFIG = curl-config + FT_CONFIG = freetype-config + endif + ifeq ($(NETSURF_FB_FONTLIB),freetype) CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags) LDFLAGS += $(shell freetype-config --libs) @@ -556,8 +569,20 @@ $(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP)) $(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF)) - - CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \ + ifeq ($(HOST),mint) + # freemint does not support pkg-config for all packages + CFLAGS += -std=c99 -I. -Dsmall $(WARNFLAGS) \ + -D_BSD_SOURCE \ + -D_XOPEN_SOURCE=600 \ + -D_POSIX_C_SOURCE=200112L \ + $(shell $(PKG_CONFIG) --cflags libnsfb) \ + $(shell $(PKG_CONFIG) --cflags libhubbub) \ + $(shell $(CURL_CONFIG) --cflags) \ + $(shell $(PKG_CONFIG) --cflags openssl) \ + $(shell $(PKG_CONFIG) --cflags libcss) \ + $(shell $(XML_CONFIG) --cflags) + else + CFLAGS += -std=c99 -g -I. -Dsmall $(WARNFLAGS) \ -D_BSD_SOURCE \ -D_XOPEN_SOURCE=600 \ -D_POSIX_C_SOURCE=200112L \ @@ -565,11 +590,21 @@ $(shell $(PKG_CONFIG) --cflags libhubbub libcurl openssl) \ $(shell $(PKG_CONFIG) --cflags libcss) \ $(shell xml2-config --cflags) + endif 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) - + ifeq ($(HOST),mint) + 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. + # because of that - hardcoded reference to libxml-2.0 here. + LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv + LDFLAGS += -lSDL -lgem -lm + else + LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl) + LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss) + endif + endif # ----------------------------------------------------------------------------