Hi,I managed to get dia for mac os x compiled and running. here is a list of issues I found with it: First off gcc4 on mac os X complains that parse_path is delcared as non-static and defined as static. This patch fixes that:
diff -rpwu dia-0.94/objects/custom/shape_info.h dia-0.94-patched/ objects/custom/shape_info.h --- dia-0.94/objects/custom/shape_info.h 2004-08-16 00:56:15.000000000 -0700 +++ dia-0.94-patched/objects/custom/shape_info.h 2005-07-19 10:06:57.000000000 -0700
@@ -166,7 +166,7 @@ ShapeInfo *shape_info_getbyname(const gc void shape_info_realise(ShapeInfo* info); void shape_info_print(ShapeInfo *info);-void parse_path(ShapeInfo *info, const char *path_str, DiaSvgGraphicStyle *s); +void static parse_path(ShapeInfo *info, const char *path_str, DiaSvgGraphicStyle *s);
/*MC 11/03 handy g_new0 variant for struct with variable size */ #define g_new0_ext(struct_type, ext_size) \ Second, I think there is a bug with the way libtool is used to link dia.lib/Makefile.am declares libdia.la to be linked as -export-dynamic - module. According to the libtool manual, these two options should never be used together. -module is used to link a library which is going to be opened with dlopen. -export-dynamic is used when you need to use symbols from your executable to resolve dependencies in your dlopened module. Which means, if used correctly, -module appears on the link command for the dlopened library, and -export- dynamic appears on the command to link the executable which will be dlopening said module, and only if necessary. Futhermore, even when using -export-dynamic is used, you don't need to link directly with a dlopenable module (that is the point, even), which according to app/ Makefile.am, you are.
However, it just so happens that on linux, and probably other systems, the process of creating a dlopenable module is exactly the same as the process of creating a dynamic linker shared library. On mac os x, however this doesn't work (and libtool will actually inform you that this is non-portable, at least when run on mac os x).
This patch modifies lib/Makefile.am to have the correct libtool flags to properly compile on mac os x Given all these details I suspect that this fixes compile problems on other platforms as well.
diff -rpwu dia-0.94/lib/Makefile.am dia-0.94-patched/lib/Makefile.am --- dia-0.94/lib/Makefile.am 2004-08-16 00:56:07.000000000 -0700+++ dia-0.94-patched/lib/Makefile.am 2005-07-19 11:32:48.000000000 -0700
@@ -145,7 +145,7 @@ libdia_la_SOURCES = \ # render.h \ # render.c -libdia_la_LDFLAGS = -export-dynamic -module -avoid-version +libdia_la_LDFLAGS = -avoid-version AM_CPPFLAGS = \ $(LIBART_CFLAGS) \I've successfully compiled and run dia 0.94 on mac os 10.4.2, using fink versions of libtool 1.5.10, autoconf 2.59, and automake 1.9.4 (I actually regenerated configure using these tools, I am not sure if this is necessary).
-- Daniel
Attachment:
PGP.sig
Description: This is a digitally signed message part