Subversion Repositories Kolibri OS

Rev

Rev 3584 | Blame | Last modification | View Log | RSS feed

  1. # ----------------------------------------------------------------------------
  2. # Options relating to all versions of NetSurf
  3. # ----------------------------------------------------------------------------
  4.  
  5. # Enable NetSurf's use of libnsbmp for displaying BMPs and ICOs
  6. # Valid options: YES, NO
  7. NETSURF_USE_BMP := YES
  8.  
  9. # Enable NetSurf's use of libnsgif for displaying GIFs
  10. # Valid options: YES, NO                                  (highly recommended)
  11. NETSURF_USE_GIF := YES
  12.  
  13. # Enable NetSurf's use of libjpeg for displaying JPEGs
  14. # Valid options: YES, NO                                  (highly recommended)
  15. NETSURF_USE_JPEG := YES
  16.  
  17. # Enable NetSurf's use of libpng for displaying PNGs.  If MNG and PNG
  18. # are both enabled then NetSurf will choose libpng for PNGs, leaving
  19. # MNGs and JNGs to libmng.
  20. # Valid options: YES, NO          (at least one of PNG/MNG highly recommended)
  21. NETSURF_USE_PNG := NO
  22.  
  23. # Enable NetSurf's use of libmng for displaying MNGs, JNGs and PNGs
  24. # Valid options: YES, NO          (at least one of PNG/MNG highly recommended)
  25. NETSURF_USE_MNG := NO
  26.  
  27. # Enable NetSurf's use of libwebp for displaying WebPs
  28. # Valid options: YES, NO
  29. NETSURF_USE_WEBP := NO
  30.  
  31. # Enable NetSurf's use of gstreamer for displaying videos
  32. # Valid options: YES, NO
  33. NETSURF_USE_VIDEO := NO
  34.  
  35. # Enable NetSurf's use of spidermonkey for javascript
  36. # Valid options: YES, NO, AUTO
  37. NETSURF_USE_JS := NO
  38. # Javascript support in older debian/ubuntu versions
  39. NETSURF_USE_MOZJS := NO
  40.  
  41. # Enable NetSurf's use of libharu for PDF export and GTK printing support.
  42. # There is no auto-detection available for this, as it does not have a
  43. # pkg-config file.
  44. # Valid options: YES, NO
  45. NETSURF_USE_HARU_PDF := NO
  46.  
  47. # Enable stripping the NetSurf binary
  48. # Valid options: YES, NO
  49. NETSURF_STRIP_BINARY := NO
  50.  
  51. # Template used for constructing the User Agent: string.  The first two
  52. # replacements are major/minor version, next is OS.
  53. # Please don't be tempted to mention Mozilla here!  Let's let that lie die.
  54. NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s)"
  55.  
  56. # Default home page, if one is not defined by the user.  Note that this
  57. # option does not apply to the RISC OS version, as it has its own local
  58. # home page, and it can be changed by editing the end of gui_init2() in
  59. # riscos/gui.c
  60. NETSURF_HOMEPAGE := "about:welcome"
  61.  
  62. # Force using glibc internal iconv implementation instead of external libiconv
  63. # Valid options: YES, NO
  64. NETSURF_USE_LIBICONV_PLUG := YES
  65.  
  66.   # Optimisation levels
  67.   CFLAGS += -O2
  68.  
  69.   # Framebuffer default surface provider.
  70.   # Valid values are: x, sdl, linux, vnc, able,
  71.   NETSURF_FB_FRONTEND := sdl
  72.  
  73.   # Use libharu to enable PDF export and GTK printing support.
  74.   # Valid options: YES, NO
  75.   NETSURF_USE_HARU_PDF := NO
  76.  
  77.   # Enable NetSurf's use of librosprite for displaying RISC OS Sprites
  78.   # Valid options: YES, NO, AUTO
  79.   NETSURF_USE_ROSPRITE := NO
  80.  
  81.   # Library to use for font plotting
  82.   # Valid options: internal, freetype
  83.   NETSURF_FB_FONTLIB := internal
  84.  
  85.   # Default freetype font files
  86.   NETSURF_FB_FONT_SANS_SERIF := DejaVuSans.ttf
  87.   NETSURF_FB_FONT_SANS_SERIF_BOLD := DejaVuSans-Bold.ttf
  88.   NETSURF_FB_FONT_SANS_SERIF_ITALIC := DejaVuSans-Oblique.ttf
  89.   NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD := DejaVuSans-BoldOblique.ttf
  90.   NETSURF_FB_FONT_SERIF := DejaVuSerif.ttf
  91.   NETSURF_FB_FONT_SERIF_BOLD := DejaVuSerif-Bold.ttf
  92.   NETSURF_FB_FONT_MONOSPACE := DejaVuSansMono.ttf
  93.   NETSURF_FB_FONT_MONOSPACE_BOLD := DejaVuSansMono-Bold.ttf
  94.   NETSURF_FB_FONT_CURSIVE := Comic_Sans_MS.ttf
  95.   NETSURF_FB_FONT_FANTASY := Impact.ttf
  96.  
  97.   PREFIX ?= /usr/local
  98.  
  99.   # Default binary install path
  100.   NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
  101.  
  102.   # Default resource install path
  103.   NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
  104.  
  105.   # Default framebuffer search path
  106.   NETSURF_FB_RESPATH := $${HOME}/.netsurf/:$${NETSURFRES}:$(NETSURF_FRAMEBUFFER_RESOURCES):./framebuffer/res
  107.  
  108.   # freetype compiled in font serch path
  109.   NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
  110.  
  111.  
  112. #
  113. # NetSurf source file inclusion
  114. #
  115. # Included by main makefile -- indicates generic sources for every build.
  116. #
  117.  
  118. S_CONTENT := content.c content_factory.c dirlist.c fetch.c hlcache.c    \
  119.         llcache.c mimesniff.c urldb.c
  120.  
  121. S_FETCHERS := curl.c data.c file.c about.c resource.c
  122.  
  123. S_CSS := css.c dump.c internal.c select.c utils.c
  124.  
  125. S_RENDER := box.c box_construct.c box_normalise.c                       \
  126.         font.c form.c                                                   \
  127.         html.c html_script.c html_interaction.c html_redraw.c           \
  128.         html_forms.c imagemap.c layout.c list.c search.c table.c        \
  129.         textinput.c textplain.c
  130.  
  131. S_UTILS := base64.c corestrings.c filename.c filepath.c hashtable.c     \
  132.         libdom.c locale.c log.c messages.c nsurl.c talloc.c url.c       \
  133.         utf8.c utils.c useragent.c
  134.  
  135. S_HTTP := challenge.c generics.c primitives.c parameter.c               \
  136.         content-disposition.c content-type.c www-authenticate.c
  137.  
  138. S_DESKTOP := cookies.c history_global_core.c hotlist.c knockout.c       \
  139.         mouse.c options.c plot_style.c print.c search.c searchweb.c     \
  140.         scrollbar.c sslcert.c textarea.c thumbnail.c tree.c             \
  141.         tree_url_node.c version.c
  142.  
  143. # Javascript source
  144. include Makefile.sources.javascript
  145.  
  146. # S_COMMON are sources common to all builds
  147. S_COMMON := $(addprefix content/,$(S_CONTENT))                          \
  148.         $(addprefix content/fetchers/,$(S_FETCHERS))                    \
  149.         $(addprefix css/,$(S_CSS))                                      \
  150.         $(addprefix render/,$(S_RENDER))                                \
  151.         $(addprefix utils/,$(S_UTILS))                                  \
  152.         $(addprefix utils/http/,$(S_HTTP))                              \
  153.         $(addprefix desktop/,$(S_DESKTOP))                              \
  154.         $(addprefix javascript/,$(S_JAVASCRIPT))                        \
  155.         $(S_JSAPI_BINDING)
  156.  
  157. # S_IMAGE are sources related to image management
  158. S_IMAGE_YES := image.c image_cache.c
  159. S_IMAGE_NO :=
  160. S_IMAGE_$(NETSURF_USE_BMP) += bmp.c ico.c
  161. S_IMAGE_$(NETSURF_USE_GIF) += gif.c
  162. S_IMAGE_$(NETSURF_USE_JPEG) += jpeg.c
  163. S_IMAGE_$(NETSURF_USE_MNG) += mng.c
  164. S_IMAGE_$(NETSURF_USE_ROSPRITE) += nssprite.c
  165. S_IMAGE_$(NETSURF_USE_PNG) += png.c
  166. S_IMAGE_$(NETSURF_USE_NSSVG) += svg.c
  167. S_IMAGE_$(NETSURF_USE_RSVG) += rsvg.c
  168. S_IMAGE_$(NETSURF_USE_WEBP) += webp.c
  169. S_IMAGE_$(NETSURF_USE_VIDEO) += video.c
  170.  
  171. S_IMAGE := $(addprefix image/,$(S_IMAGE_YES))
  172.  
  173. # S_PDF are sources of the pdf plotter + the ones for paged-printing
  174. S_PDF := pdf_plotters.c font_haru.c
  175. S_PDF := $(addprefix desktop/save_pdf/,$(S_PDF))
  176.  
  177. # S_BROWSER are sources related to full browsers but are common
  178. # between RISC OS, GTK, BeOS and AmigaOS builds
  179. S_BROWSER := browser.c download.c frames.c history_core.c netsurf.c \
  180.         save_complete.c save_text.c selection.c textinput.c
  181.  
  182. S_BROWSER := $(addprefix desktop/,$(S_BROWSER))
  183.  
  184.  
  185.  
  186. $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
  187. $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng)  ))
  188.  
  189. ifeq ($(NETSURF_FB_FONTLIB),freetype)
  190.   CFLAGS += -DFB_USE_FREETYPE $(shell freetype-config --cflags)
  191.   LDFLAGS += $(shell freetype-config --libs)
  192. endif
  193.  
  194. # define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
  195. NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
  196. NETSURF_FEATURE_ROSPRITE_CFLAGS := -DWITH_NSSPRITE
  197. NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
  198. NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
  199. NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
  200. NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
  201. NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
  202.  
  203. CFLAGS += -Dnsframebuffer
  204.  
  205. #resource path
  206. CFLAGS += '-DNETSURF_FB_RESPATH="$(NETSURF_FB_RESPATH)"'
  207.  
  208. # compile time font locations
  209. CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_FB_FONTPATH)"'
  210. CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF="$(NETSURF_FB_FONT_SANS_SERIF)"'
  211. CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_BOLD)"'
  212. CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC)"'
  213. CFLAGS += '-DNETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD="$(NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD)"'
  214. CFLAGS += '-DNETSURF_FB_FONT_SERIF="$(NETSURF_FB_FONT_SERIF)"'
  215. CFLAGS += '-DNETSURF_FB_FONT_SERIF_BOLD="$(NETSURF_FB_FONT_SERIF_BOLD)"'
  216. CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
  217. CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
  218. CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
  219. CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
  220.  
  221. $(eval $(call pkg_config_find_and_add_enabled,ROSPRITE,librosprite,Sprite))
  222. $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
  223. $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
  224. $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
  225. $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
  226.  
  227.  
  228. # ----------------------------------------------------------------------------
  229. # Source file setup
  230. # ----------------------------------------------------------------------------
  231.  
  232. # S_FRAMEBUFFER are sources purely for the framebuffer build
  233. S_FRAMEBUFFER := gui.c framebuffer.c tree.c schedule.c                  \
  234.         thumbnail.c misc.c bitmap.c filetype.c login.c findfile.c       \
  235.         localhistory.c system_colour.c clipboard.c
  236.  
  237. S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c    \
  238.         text.c scroll.c osk.c
  239.  
  240. S_FRAMEBUFFER += font_$(NETSURF_FB_FONTLIB).c
  241.  
  242. ifeq ($(NETSURF_FB_FONTLIB),internal)
  243. S_FRAMEBUFFER += nsfont_regular.c nsfont_italic.c nsfont_bold.c         \
  244.         nsfont_italic_bold.c
  245. endif
  246.  
  247. S_FRAMEBUFFER := $(addprefix framebuffer/,$(S_FRAMEBUFFER)) $(addprefix framebuffer/fbtk/,$(S_FRAMEBUFFER_FBTK))
  248.  
  249. # This is the final source build list
  250. # Note this is deliberately *not* expanded here as common and image
  251. #   are not yet available
  252. SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_FRAMEBUFFER) $(S_IMAGES)
  253. EXETARGET := nsfb
  254.  
  255. # ----------------------------------------------------------------------------
  256. # Install target
  257. # ----------------------------------------------------------------------------
  258.  
  259. NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html   \
  260.         default.css internal.css licence.html                   \
  261.         netsurf.png quirks.css welcome.html
  262.  
  263.  
  264.