Difference between revisions of "CompilingSunSolaris"

From Inkscape Wiki
Jump to navigation Jump to search
Line 8: Line 8:
* build GNU make and install it into /usr/local/bin
* build GNU make and install it into /usr/local/bin
* Build one of the newest versions of gcc (I built 4.5.1). Before that install the needed libraries gmp, mpfr, mpc also with --prefix=/usr/local. Build gcc. Re-build the gmp/mpfr/mpc. Re-build gcc. After that you should have no further dependencies to /usr/sfw/lib which is important
* Build one of the newest versions of gcc (I built 4.5.1). Before that install the needed libraries gmp, mpfr, mpc also with --prefix=/usr/local. Build gcc. Re-build the gmp/mpfr/mpc. Re-build gcc. After that you should have no further dependencies to /usr/sfw/lib which is important
* Edit the gcc specs to get a clean compilation independent if you use -m64 or -m32. To achieve this have a look at the *link_arch section where to put in additional -R/usr/local/lib and -R/usr/local/lib/64.
* Edit the gcc specs to get a clean compilation independent if you use -m64 or -m32. To achieve this have a look at the *link_arch section where to put in additional -R/usr/local/lib and -R/usr/local/lib/64 (gcc configured to use Sun's ld).
* build pkg-config with --prefix=/usr/local --libdir=/usr/local/lib/64 for the following packages
* build pkg-config with --prefix=/usr/local --libdir=/usr/local/lib/64 for the following packages



Revision as of 11:51, 5 April 2011

Compiling on Oracle/Sun Solaris

Compiling version 0.48.1

here you can find how to build inkscape 0.48.1 on Solaris 10 (x86) 64 bit.

  • Chose a prefix path where to install independent of Solaris' own libraries. In my example --prefix=/usr/local is used for all tools
  • build GNU make and install it into /usr/local/bin
  • Build one of the newest versions of gcc (I built 4.5.1). Before that install the needed libraries gmp, mpfr, mpc also with --prefix=/usr/local. Build gcc. Re-build the gmp/mpfr/mpc. Re-build gcc. After that you should have no further dependencies to /usr/sfw/lib which is important
  • Edit the gcc specs to get a clean compilation independent if you use -m64 or -m32. To achieve this have a look at the *link_arch section where to put in additional -R/usr/local/lib and -R/usr/local/lib/64 (gcc configured to use Sun's ld).
  • build pkg-config with --prefix=/usr/local --libdir=/usr/local/lib/64 for the following packages

For further installations I used a few environment variables:

export PATH="/usr/local/bin:/usr/bin:/usr/ccs/bin"
export MAKE=/usr/local/bin/make
export CC="gcc -m64"
export CXX="g++ -m64"

Build and install the following packages with ./configure --prefix=/usr/local --libdir=/usr/local/lib/64 --sysconfdir=/usr/local/etc/64 --enable-shared

zlib-1.2.5
jpeg-6.2
gettext-0.17
libiconv-1.12
fontconfig-2.8.0
t1lib-5.1.0
freetype-2.4.4
render-0.8
libxrender-0.8.4
libpng-1.4.4 (cave: 1.5.x does not work with Inkscape!)
gsl-1.14
pixman-0.21.6
glib-2.28.3
glibmm-2.24.2
atk-1.32.0
pango-1.28.3
cairo-1.10.2 (rebuild pango after building cairo!!)
gtk+-2.24.3 (I avoided the very new version 3.....)
gdk-pixbuf-2.22.1
poppler-0.16.3 (use the additional flag --enable-xpdf-headers)

Then make three small changes to inkscape's source:

src/color-profile.cpp, line 8: Change "#include <sys/fcntl.h>" into "#include <fcntl.h>"

src/2geom/isnan.h, line 57: The mentioned "#include <cmath>" must be set

src/2geom/convex-cover.cpp, line 36: include these two lines (ok, quick and dirty....):
#undef INFINITY
#define INFINITY (__builtin_inff())

Now configure inkscape as described above. You should get a clean compile. --Reinhard

Compiling version 0.44

This documents the changes that I needed to make Inkscape compile with gcc 3.3.2 on Solaris 8.

Add the following function to the file:
// from http://groups.google.de/group/comp.lang.c/msg/8ae70d02495768f5?dmode=source&hl=de
double log2(double x)
{
        static double ln2;
        if (ln2 == 0.0)
                ln2 = log (2.0);

        return log (x) / ln2;
}
  • Now stuck here (gc6.7, gcc version 3.3.2):
gc.cpp: In function `void Inkscape::GC::<unnamed>::do_init()':
gc.cpp:32: error: parse error before string constant
gc.cpp:32: error: `GC_noop1' undeclared (first use this function)
gc.cpp:32: error: (Each undeclared identifier is reported only once for each 
   function it appears in.)
gmake[2]: *** [gc.o] Error 1
gmake[2]: Leaving directory `/home/marquardt/Tools/inkscape-0.44/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/marquardt/Tools/inkscape-0.44'
gmake: *** [all] Error 2

See also http://sourceforge.net/tracker/index.php?func=detail&aid=1516476&group_id=93438&atid=604306

I got the following patch for "gc6.7/include/gc.h" from Hans Boehm which fixes these problems with gc6.7:

947a948
>     extern int _end[], _etext[];
949,952c950
< #     define GC_INIT() { extern int _end[], _etext[]; \
< 		         extern "C" void GC_noop1(GC_word); \
< 		         GC_noop1((GC_word)_end); \
< 			 GC_noop1((GC_word)_etext); }
---
>       extern "C" void GC_noop1(GC_word);
954,956c952
< #     define GC_INIT() { extern int _end[], _etext[]; \
< 		         extern void GC_noop(); \
< 		         GC_noop(_end, _etext); }
---
>       void GC_noop1();
957a954,955
> #   define GC_INIT() { GC_noop1((GC_word)_end); \
> 		       GC_noop1((GC_word)_etext); }

With these changes, I got Inkscape running fine. --Colin Marquardt

Compiling a 0.39 snapshot

When trying to compile the CVS snapshot from 2004-05-27 with gcc 3.3.2 on a SunOS foo 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Fire-V240 machine, I had to fix a few things.

First, I installed the following packages:

autoconf-2.59
automake-1.8.3
intltool-0.30
expat-1.95.7
libpng-1.2.5
libsigc++-2.0.3
glib-2.4.2
glibmm-2.4.2
atk-1.7.0
render-0.8
xrender-0.8.3
xft-2.1.2
pango-1.4.0
gtk+-2.4.2
gtkmm-2.4.2

I configured Inkscape with the following switches:

./configure --prefix=/home/foo[[/Tools]]/ --includedir=/home/foo[[/Tools/include]] CPPFLAGS=-I/home/foo[[/Tools/include]]

Then "fix" stuff in the inkscape sources:

Uncomment "@INTLTOOL_DESKTOP_RULE@" in Makefile.

Use <inttypes.h>, not <stdint.h> in

src/display/sp-canvas.h,
src/livarot[[/DblLinked]].h, 
src/livarot[[/LivarotDefs]].h, 
src/livarot[[/AVL]].h, 
src/livarot[[/Shape]].h, 
src/livarot[[/ShapeUtils]].h,
src/livarot[[/Ligne]].h
src/livarot[[/AlphaLigne]].h
src/livarot[[/BitLigne]].h
src/livarot[[/MyMath]].h

(see http://www.lns.cornell.edu/public/COMP/info/autoconf/Header-Portability.html)


Replace round() with rint() according to http://news.gw.com/freebsd.gnome/1237 in

src/object-edit.cpp, src/spiral-context.cpp src/star-context.cpp

fabsf() was undeclared (I just put in "fabs()", not sure if this is correct) in

src/sp-shape.cpp

(see http://gcc.gnu.org/ml/java/2001-01/msg00465.html).

Replaced fabsf(), floorf() and ceilf() with fabs(), floor() and ceil() in

src/display/nr-arena-shape.cpp
src/display/canvas-bpath.cpp
src/display/sp-ctrlline.cpp
src/libnrtype/nr-rasterfont.cpp
src/livarot[[/AlphaLigne]].cpp
src/livarot[[/BitLigne]].cpp
src/livarot[[/Ligne]].cpp
src/livarot[[/PathOutline]].cpp
src/livarot[[/ShapeMisc]].cpp

isfinite() is undeclared, use

#include <ieeefp.h>

and finite() (see http://devrsrc1.external.hp.com/STKS/impacts/i61.html) in

src/display/bezier-utils.cpp

Need to include

#include <ieeefp.h>

in

src/libnr/nr-svp.cpp

Missing strcasestr() used in libnrtype/nr-type-directory.cpp. I just use the internal version for WIN32 given in the file.

In file included from /home/foo[[/Tools/include/X11/extensions/Xrender]].h:33,
                 from /home/foo[[/Tools/include/X11/Xft/Xft]].h:47,
                 from libnrtype/nr-type-xft.cpp:16:
/usr/openwin/include[[/X11/Xutil]].h:56: warning: ignoring #pragma ident 
/usr/openwin/include[[/X11/Xutil]].h:117: error: 'Bool' is used as a type, but is 
   not defined as a type.
/usr/openwin/include[[/X11/Xutil]].h:120: error: 'Pixmap' is used as a type, but is 
   not defined as a type.
/usr/openwin/include[[/X11/Xutil]].h:121: error: 'Window' is used as a type, but is 
   not defined as a type.
[...]

etc. Fixed this by adding #include <X11/Xlib.h> before including Xft.h in src/libnrtype/nr-type-xft.cpp.

`bind_textdomain_codeset' undeclared in src/main.cpp and src/inkscape.cpp. Just copied the definition in that file outside the ifdef.

`fpresetsticky' undeclared (autoconf seems to have checks for it. Solaris has fpsetsticky() when ieeefp.h is included.)

No rule for target inkscape.desktop - just created an empty rule.

DONE! It runs on Solaris! Yay! :) --Colin Marquardt

See also