Difference between revisions of "NetSurf Source"


From SamyGO
Jump to: navigation, search
(Compilation instructions)
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
== Compilation instructions ==
 
== Compilation instructions ==
*setup environment (install cross compiler)
+
#setup environment (install a cross compiler)
*compile and <code>make install</code> required dependency libraries:  
+
#*The easiest way is to use the OpenEmbedded toolchain. Some information about that is available at the [[SamyGO OpenEmbedded]] page. The toolchain is built with the <code>make Toolchain</code> command.
**libiconv
+
#*If you don't want to use OpenEmbedded, you will need to compile a cross compiler manually, instructions can be found at [[Setting up a cross-compilation toolchain]].
**zlib
+
#compile (in the cross compile environment) and <code>make install</code> the required dependency libraries:
**libjpeg
+
#*libiconv
**libpng
+
#*zlib
**libxml2
+
#*libjpeg
**libidn
+
#*libpng
**(openssl)
+
#*libxml2
**curl
+
#*libidn
**SamyGO libSDL
+
#*(openssl)
*setup environment for netsurf compilation
+
#*curl
<pre>
+
#*SamyGO libSDL
#!/bin/sh
+
#setup environment for netsurf compilation
#export PATH=/usr/local/arm-linux-gnueabi/bin:$PATH
+
#:<code>#!/bin/sh</code>
export PKGCONFIG=arm-linux-gnueabi-pkg-config
+
#:<code>#export PATH=/usr/local/arm-linux-gnueabi/bin:$PATH</code>
export PKG_CONFIG=arm-linux-gnueabi-pkg-config
+
#:<code>export PKGCONFIG=arm-linux-gnueabi-pkg-config</code>
export XML2_CONFIG=/usr/local/arm-linux-gnueabi/bin/xml2-config
+
#:<code>export PKG_CONFIG=arm-linux-gnueabi-pkg-config</code>
export CC=arm-linux-gnueabi-gcc
+
#:<code>export XML2_CONFIG=/usr/local/arm-linux-gnueabi/bin/xml2-config</code>
export CXX=arm-linux-gnueabi-g++
+
#:<code>export CC=arm-linux-gnueabi-gcc</code>
export LD=arm-linux-gnueabi-ld
+
#:<code>export CXX=arm-linux-gnueabi-g++</code>
export STRIP=arm-linux-gnueabi-strip
+
#:<code>export LD=arm-linux-gnueabi-ld</code>
export AR=arm-linux-gnueabi-ar
+
#:<code>export STRIP=arm-linux-gnueabi-strip</code>
export HOST_CC=/usr/bin/gcc
+
#:<code>export AR=arm-linux-gnueabi-ar</code>
export CFLAGS="-fPIC -O2 -D_REENTRANT"
+
#:<code>export HOST_CC=/usr/bin/gcc</code>
export CXXFLAGS="-fPIC -O2 -D_REENTRANT"
+
#:<code>export CFLAGS="-fPIC -O2 -D_REENTRANT"</code>
export PREFIX=/usr/local/arm-linux-gnueabi
+
#:<code>export CXXFLAGS="-fPIC -O2 -D_REENTRANT"</code>
# turns off silencing of compiler commands in netsurf compilation
+
#:<code>export PREFIX=/usr/local/arm-linux-gnueabi</code>
export Q=
+
#:<code># turns off silencing of compiler commands in netsurf compilation</code>
</pre>
+
#:<code>export Q=</code>
*compile and <code>make install</code> netsurf member libraries
+
#compile and <code>make install</code> netsurf member libraries
(each time: <code>make HOST=SamsungDTV; make HOST=SamsungDTV install</code>)
+
#:(each time: <code>make HOST=SamsungDTV; make HOST=SamsungDTV install</code>)
**libparserutils
+
#*libparserutils
**libwapcaplet
+
#*libwapcaplet
**libnsbmp
+
#*libnsbmp
**libnsgif
+
#*libnsgif
**libnsfb
+
#*libnsfb
**libcss
+
#*libcss
**hubbub
+
#*hubbub
*compile netsurf
+
#compile netsurf
<code>make HOST=SamsungDTV TARGET=framebuffer</code>
+
#:<code>make HOST=SamsungDTV TARGET=framebuffer</code>
 +
 
 +
==Hacking guide==
 +
The browser core is in the 'content', 'css,' 'desktop', 'render', and 'image' subdirectories of the project. I have avoided touching it (if possible) while porting the browser for SamyGO.
 +
 
 +
The GUI and frontend code is in the framebuffer subdirectory. Unfortunately, compared to the other NetSurf ports (see the 'gtk', 'amiga' or 'riscos' subdirs, for example) it's quite incomplete and missing lots of useful features.
 +
I have worked on implementing some of them, but a lot remains to be done (e.g. file downloads and bookmarks).
 +
A good starting point would be the empty functions at the bottom of <code>fb_gui.c</code>.
 +
 
 +
If you have anything useful, please make a patch towards the latest released source code version (see top of page) and send it to florianfischer at gmx.de.

Latest revision as of 21:30, 21 August 2010

The NetSurf_Web_Browser is Open Source and licensed under the GPL. Of course, the source code is available. Get it here.

Compilation instructions

  1. setup environment (install a cross compiler)
    • The easiest way is to use the OpenEmbedded toolchain. Some information about that is available at the SamyGO OpenEmbedded page. The toolchain is built with the make Toolchain command.
    • If you don't want to use OpenEmbedded, you will need to compile a cross compiler manually, instructions can be found at Setting up a cross-compilation toolchain.
  2. compile (in the cross compile environment) and make install the required dependency libraries:
    • libiconv
    • zlib
    • libjpeg
    • libpng
    • libxml2
    • libidn
    • (openssl)
    • curl
    • SamyGO libSDL
  3. setup environment for netsurf compilation
    #!/bin/sh
    #export PATH=/usr/local/arm-linux-gnueabi/bin:$PATH
    export PKGCONFIG=arm-linux-gnueabi-pkg-config
    export PKG_CONFIG=arm-linux-gnueabi-pkg-config
    export XML2_CONFIG=/usr/local/arm-linux-gnueabi/bin/xml2-config
    export CC=arm-linux-gnueabi-gcc
    export CXX=arm-linux-gnueabi-g++
    export LD=arm-linux-gnueabi-ld
    export STRIP=arm-linux-gnueabi-strip
    export AR=arm-linux-gnueabi-ar
    export HOST_CC=/usr/bin/gcc
    export CFLAGS="-fPIC -O2 -D_REENTRANT"
    export CXXFLAGS="-fPIC -O2 -D_REENTRANT"
    export PREFIX=/usr/local/arm-linux-gnueabi
    # turns off silencing of compiler commands in netsurf compilation
    export Q=
  4. compile and make install netsurf member libraries
    (each time: make HOST=SamsungDTV; make HOST=SamsungDTV install)
    • libparserutils
    • libwapcaplet
    • libnsbmp
    • libnsgif
    • libnsfb
    • libcss
    • hubbub
  5. compile netsurf
    make HOST=SamsungDTV TARGET=framebuffer

Hacking guide

The browser core is in the 'content', 'css,' 'desktop', 'render', and 'image' subdirectories of the project. I have avoided touching it (if possible) while porting the browser for SamyGO.

The GUI and frontend code is in the framebuffer subdirectory. Unfortunately, compared to the other NetSurf ports (see the 'gtk', 'amiga' or 'riscos' subdirs, for example) it's quite incomplete and missing lots of useful features. I have worked on implementing some of them, but a lot remains to be done (e.g. file downloads and bookmarks). A good starting point would be the empty functions at the bottom of fb_gui.c.

If you have anything useful, please make a patch towards the latest released source code version (see top of page) and send it to florianfischer at gmx.de.