Hello, 

As I posted earlier, I wanted to submit patches for the Makefile to
support the FreeMiNT OS. 
No one responded to my questions, so here is my patch. Please tell me if
there is something wrong.

Heres the description of the patch: 
Added specific LDFLAGS for MiNT in framebuffer target. (I know that
Makefile.config is the first place to make additions, but Makefile.config
can't be used for LDFLAGS)
Also added MiNT specific CFLAGS to the framebuffer target part.
Added an new target called mint when host == mint and the target is not
set. 

I would be really nice if someone could integrate this into SVN, or let me
know why the patch is rejected.

Greets,
Ole


--- Makefile.orig       Sat Jun 19 00:34:22 2010
+++ Makefile    Sun Jun 20 00:27:16 2010
@@ -76,8 +76,11 @@
     else
       ifeq ($(HOST),Darwin)
         HOST := macosx
-      endif
-
+      endif  
+      ifeq ($(HOST),FreeMiNT)
+        HOST := mint
+      endif  
+      
       # Default target is GTK backend
       ifeq ($(TARGET),)
         TARGET := gtk
@@ -537,7 +540,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 +564,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 +585,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  -lldg -lgem -lm
+  else
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub 
openssl)
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
+  endif
+  
 endif
 
 # ----------------------------------------------------------------------------

Reply via email to