Hello,

Am Sonntag, den 20.06.2010, 10:42 +0200 schrieb John-Mark Bell
<[email protected]>:

>> Added an new target called mint when host == mint and the target is not
>> set. 
> 
> I don't see this in your patch.

Yes you are right, it's missing. I attached a new patch. It now adds a new
valid default target for mint ( which is not implemented yet ).
 
> Can you explain this, please?:
> 
> +    LDFLAGS += -lSDL  -lldg -lgem -lm

On MiNT only SDL framebuffer backend is available. (Altough there is an
old X11 version available for MiNT. If someone really want to use that X11
with MiNT/Netsurf he/she should figure it out how to adjust the makefile.)
-lSDL -lgem is needed for SDL. 
I've seen that the -lldg entry isn't really needed. I removed that entry
within the attached patch. 
-lm is needed for the math function, If it's missing the compiler (gcc 4.3
and 4.5 are available for MiNT systems) complaints about undefined
references to the math functions. 

On 19.06.10, you wrote:

> I know not much of netsurf buildsystem, so i a have avoid to answer
early, but the amiga OS Version
> need
> no makefile changes.only makefile.config need modify.

I understood it that way: the Makefile.config LDFLAGS would be prepended
before the framebuffer target LDFLAGS, that's is not acceptable for my
changes. Anyway, the configuration of the LDFLAGS through pkg-config within
the framebuffer part spits out errors when used for packages which do not
provide an pkg-config file, these errors are passed along... 

Thanks to all of you for having a closer look at the file! 

Greets,
Ole
--- 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
 
 # ----------------------------------------------------------------------------

Reply via email to