Dimitri Papadopoulos <papadopo@REMOVE.shfj.DECOY.cea.fr> writes:
> Hi,
>
> As a workaround to the build problems previously reported, I've modified
> some Makefiles to look for libxml2 header files in include/libxml2/libxml
> instead of include/libxml2.
If you had to do this workaround your xml2-config script is probably
buggy. It should work something like this:
>xml2-config --cflags
-I/usr/local/hacks/include/libxml2/libxml -I/usr/local/hacks/include/libxml2
>
> I now get compilation errors:
>
>
> First in "lib":
> $ cc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I/usr/local/gdk-pixbuf-0.13.0/include/gdk-pixbuf-1.0 -I/usr/local/gtk+-1.2.10/include/gtk-1.2 -I/usr/local/glib-1.2.10/include/glib-1.2 -I/usr/local/glib-1.2.10/lib/glib/include -I/usr/openwin/include -I/usr/local/libxml2-2.4.20/include/libxml2/libxml -I/usr/local/gtk+-1.2.10/include/gtk-1.2 -I/usr/local/glib-1.2.10/include/glib-1.2 -I/usr/local/glib-1.2.10/lib/glib/include -I/usr/openwin/include -DDIA_SHEETDIR=\"/usr/local/dia-0.90/share/dia/sheets\" -I/usr/local/libart-2.3.3/include -I/usr/local/libunicode-0.4/include -DUNICODE_USE_SYSTEM_ICONV -I/usr/local/libart-2.3.3/include -DLIBDIR=\"/usr/local/dia-0.90/lib\" -DDATADIR=\"/usr/local/dia-0.90/share/dia\" -I/usr/local/libxml2-2.4.20/include/libxml2 -O -finline-functions -fstrict-aliasing -c dia_xml.c
> [...]
> "dia_xml.c", line 320: operands have incompatible types:
> pointer to const unsigned char ":" pointer to char
> "dia_xml.c", line 320: warning: assignment type mismatch:
> pointer to const char "=" pointer to const unsigned char
> [...]
> cc: acomp failed for dia_xml.c
> $
>
> I had to change line 320 from
> name = data ? data->name : "";
> to
> name = data ? (const char *)data->name : "";
>
>
>
> Then in direcotyr "intl" I get:
> $ cc -c -DLOCALEDIR=\"/usr/local/dia-0.90/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/dia-0.90/share/locale\" -DLIBDIR=\"/usr/local/dia-0.90/lib\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I/usr/local/libxml2-2.4.20/include/libxml2/libxml -O -finline-functions -fstrict-aliasing dcigettext.c
> [...]
> "dcigettext.c", line 993: function designator is not of function type
> "dcigettext.c", line 993: warning: assignment type mismatch:
> pointer to const char "=" pointer to unsigned long
> cc: acomp failed for dcigettext.c
>
> I had to change the local variable "index" to "foo" because
> "strchr" is already defined to be "index" and there's a clash
> between the system function index() and the local variable
> index.
I see that you use cc as the compiler. I presume that cc on your
machine is a compiler from Sun. You could probably save yourself
from trouble by using gcc instead.
>
> Having applied the changes already mentioned, there are still
> problems with libpng. I have the libpng headers installed in
> /usr/local/libpng-1.2.2/include with links /usr/local/include.
>
> There's no way to tell Dia to look for the libpng headers in
> /usr/local/include. I had to add -I/usr/local/include in file
> app/Makefile
This is strange, your compiler should look in /usr/local/include
automaticly. On my machine both Suns compiler and gcc does that.
But if you have to work around it you should ne able to use the
ordinary features of the configure script to set arbitrary compile
flags. If you run bash or something like it you could run configure
like this:
CPPFLAGS="-I/usr/local/libpng-1.2.2/include" ./configure
or with help of env (in case you use tcsh for example):
env CPPFLAGS="-I/usr/local/libpng-1.2.2/include" ./configure
For reference these are some of the variables that configure honour:
- Variable: CFLAGS
Debugging and optimization options for the C compiler.
- Variable: CPPFLAGS
Header file search directory (`-IDIR') and any other miscellaneous
options for the C preprocessor and compiler.
- Variable: CXXFLAGS
Debugging and optimization options for the C++ compiler.
- Variable: LDFLAGS
Stripping (`-s') and any other miscellaneous options for the
linker.
- Variable: LIBS
`-l' and `-L' options to pass to the linker.
--
- Mårten
mail: msv@kth.se *** phone: +46 (0)8 7529933
ICQ: 4356928 *** mobile: +46 (0)707390385