1 dnl Process this file with autoconf to produce a configure script.
4 AM_INIT_AUTOMAKE(dia, 0.86)
6 dnl Specify a header configuration file
7 AM_CONFIG_HEADER(config.h)
9 dnl Initialize maintainer mode
12 dnl Initialize libtool
16 dnl Build time sanity check
19 dnl Checks for programs.
26 dnl Checks for libraries.
29 dnl XIM support (on by default)
31 [ --disable-xim enable gnome code],,enable_xim=yes)
32 AC_MSG_CHECKING([whether to enable XIM support])
33 if test "x$enable_xim" != xno; then
36 AC_MSG_RESULT($enable_xim)
45 AC_MSG_CHECKING([whether GNOME specific code should be used])
47 [ --enable-gnome enable gnome code],
50 AC_ARG_ENABLE(gnome-print,
51 [ --enable-gnome-print enable gnome-print support],,enable_gnome_print=no)
53 [ --enable-bonobo enable bonobo support],,enable_bonobo=no)
58 if test "$GNOME" = "yes"; then
62 if test "$enable_gnome_print" = "yes"; then
63 AC_DEFINE(GNOME_PRINT)
64 components="$components print"
66 if test "$enable_bonobo" = "yes"; then
67 hcomponents="$hcomponents bonobo"
68 BONOBO_LIBS=`gnome-config bonobo $components --libs`
70 AC_MSG_CHECKING(if bonobo uses oaf)
72 if ( gnome-config --libs bonobo | grep oaf ) > /dev/null 2>&1 ; then
76 AC_MSG_RESULT($using_oaf)
77 AM_CONDITIONAL(USING_OAF, test x"$using_oaf" = xyes)
79 AC_MSG_CHECKING(if bonobo uses bonobox)
81 if ( gnome-config --libs bonobox ) > /dev/null 2>&1 ; then
83 AC_DEFINE(USE_BONOBOX)
84 BONOBO_LIBS=`gnome-config bonobo bonobox $components --libs`
86 AC_MSG_RESULT($using_bonobox)
87 AM_CONDITIONAL(USING_BONOBOX, test x"$using_bonobox" = xyes)
88 hcomponents="$hcomponents bonobox"
90 GNOME_CFLAGS=`gnome-config $hcomponents $components --cflags`
91 GNOME_LIBS=`gnome-config $components --libs`
93 AM_CONDITIONAL(HAVE_GNOME_PRINT,
94 test "$GNOME" = "yes" && test "$enable_gnome_print" = "yes")
95 AM_CONDITIONAL(HAVE_BONOBO,
96 test "$GNOME" = "yes" && test "$enable_bonobo" = "yes")
97 AC_SUBST(GNOME_CFLAGS)
101 dnl Check if this Gnome has Bonobo
102 OLDCPPFLAGS=$CPPFLAGS
103 CPPFLAGS="$CPPFLAGS `glib-config --cflags`"
106 CPPFLAGS=$OLDCPPFLAGS
112 AC_CHECK_LIB(popt, poptSetOtherOptionHelp, [AC_DEFINE(HAVE_LIBPOPT)
113 APP_LIBS="$APP_LIBS -lpopt"])
114 AC_CHECK_HEADERS(popt.h)
120 AM_PATH_LIBART(2.1.0,dnl
122 AC_DEFINE(HAVE_LIBART)],
129 AM_PATH_GDK_PIXBUF(0.7.0,,AC_MSG_ERROR([gdk-pixbuf >= 0.7.0 is required]))
136 AC_CHECK_LIB(png, png_read_info,
137 AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no),png_ok=no, -lz -lm)
138 if test "$png_ok" = yes; then
139 AC_MSG_CHECKING([for png_structp in png.h])
140 AC_TRY_COMPILE([#include <png.h>],
141 [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
144 AC_MSG_RESULT($png_ok)
145 if test "$png_ok" = yes; then
146 PNG_LIBS='-lpng -lz -lm'
147 AC_DEFINE(HAVE_LIBPNG)
158 [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],
160 enable_debug=minimum)
162 if test "x$enable_debug" = "xyes"; then
163 DEBUG_FLAGS="-g -DENABLE_DEBUG"
165 if test "x$enable_debug" = "xno"; then
171 AC_SUBST(DEBUG_FLAGS)
177 ALL_LINGUAS="ca da de el en_GB es fi fr ga hu it ja ko nl no pl pt ru sl sv tr uk zh_CN.GB2312 zh_TW.Big5"
180 localedir='${prefix}/${DATADIRNAME}/locale'
184 dnl Locate the gnome-xml library
186 AC_CHECK_PROG(XML_CONFIG, xml-config, xml-config)
187 if test "$XML_CONFIG" != ""
189 AC_MSG_CHECKING(for libxml >= 1.8.5)
190 vers=`$XML_CONFIG --version | sed -e "s/libxml //" | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
191 if test "$vers" -ge 1008005; then
194 AC_MSG_ERROR(you need libxml >= 1.8.5 for this version of dia)
196 XML_LIBS="`$XML_CONFIG --libs`"
197 XML_CFLAGS="`$XML_CONFIG --cflags`"
199 AC_MSG_ERROR(Can't find libxml library.)
204 dnl Checks for header files.
207 AC_CHECK_HEADERS(stddef.h fcntl.h unistd.h)
209 dnl Checks for typedefs, structures, and compiler characteristics.
212 dnl Checks for library functions.
213 AC_CHECK_FUNCS(select strcspn strdup strtol snprintf)
215 dnl Alpha needs -mieee or we get a segfault
216 dnl This shouldn't be needed but is here until a real solution is found
219 CFLAGS="$CFLAGS -mieee"
223 DIA_CHECK_CFLAG(-Wall)
224 DIA_CHECK_CFLAG(-Wunused)
225 DIA_CHECK_CFLAG(-Winline)
226 DIA_CHECK_CFLAG(-Wmissing-prototypes)
227 DIA_CHECK_CFLAG(-Wmissing-declarations)
229 dnl Relieve register pressure on i386. Other architectures may become unable
230 dnl to debug, and usually have more registers anyway.
233 DIA_CHECK_CFLAG(-fomit-frame-pointer)
237 DIA_CHECK_CFLAG(-finline-functions)
238 DIA_CHECK_CFLAG(-fstrict-aliasing)
246 objects/standard/Makefile
247 objects/network/Makefile
251 objects/sybase/Makefile
252 objects/flowchart/Makefile
253 objects/custom/Makefile
254 objects/GRAFCET/Makefile
255 objects/chronogram/Makefile
256 objects/SADT/Makefile
258 shapes/Circuit/Makefile
259 shapes/flowchart/Makefile
260 shapes/Contact/Makefile
261 shapes/network/Makefile
262 shapes/Pneumatic/Makefile
263 shapes/Electric/Makefile
264 shapes/Civil/Makefile
265 shapes/jigsaw/Makefile
273 sheets/GRAFCET/Makefile
275 plug-ins/cgm/Makefile
276 plug-ins/pstricks/Makefile
277 plug-ins/dxf/Makefile
278 plug-ins/hpgl/Makefile
279 plug-ins/wpg/Makefile
280 plug-ins/svg/Makefile
281 plug-ins/shape/Makefile
287 Source code location: ${srcdir}
290 Use gdk-pixbuf: ${have_gdkpixbuf}
291 Libart (AA rendering, png export): ${have_libart}
293 Gnome support: ${GNOME}
294 Build bonobo component (not supported): ${enable_bonobo}
295 Gnome-print support (not recommended): ${enable_gnome_print}
297 Now type make to build dia."