1 dnl configuration script for gerbv
3 dnl gEDA - GNU Electronic Design Automation
4 dnl This file is part of gerbv.
6 dnl Copyright (C) 2000-2001 Stefan Petersen (spe@stacken.kth.se)
10 dnl This program is free software; you can redistribute it and/or modify
11 dnl it under the terms of the GNU General Public License as published by
12 dnl the Free Software Foundation; either version 2 of the License, or
13 dnl (at your option) any later version.
15 dnl This program is distributed in the hope that it will be useful,
16 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 dnl GNU General Public License for more details.
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
25 AC_INIT([gerbv], [2.5A])
26 AC_CONFIG_SRCDIR([src/gerbv.c])
28 AM_INIT_AUTOMAKE([1.9])
30 dnl Create a configuration header
31 AM_CONFIG_HEADER([config.h])
33 dnl Initialize maintainer mode
37 ############################################################
39 # Checks for cygwin/mingw32
45 # if you want -mno-cygwin, then add it to MINGW_CFLAGS or CYGWIN_CFLAGS
46 # in your configure environment. After all you may or may not
47 # want to always force -mno-cygwin on all users.
48 AC_MSG_CHECKING([for windows])
52 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
53 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
58 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
59 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
63 AC_MSG_RESULT([$WIN32])
65 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
67 GERBV_PATH_DELIMETER=":"
68 GERBV_DIR_SEPARATOR_S="/"
69 GERBV_DIR_SEPARATOR_C='/'
70 if test "x$WIN32" = "xyes" ; then
71 GERBV_PATH_DELIMETER=";"
72 GERBV_DIR_SEPARATOR_S="\\\\"
73 GERBV_DIR_SEPARATOR_C='\\'
76 AC_DEFINE_UNQUOTED(GERBV_DIR_SEPARATOR_C,'$GERBV_DIR_SEPARATOR_C',[Directory separator char])
77 AC_DEFINE_UNQUOTED(GERBV_DIR_SEPARATOR_S,"$GERBV_DIR_SEPARATOR_S",[Directory separator string])
78 AC_DEFINE_UNQUOTED(GERBV_PATH_DELIMETER,"$_PATH_DELIMETER",[Search path separator string])
83 ############################################################
85 ############################################################
87 # Checks for our configure args
93 [ --enable-debug Enable fairly verbose debug output],
95 if test $enableval = "yes"; then
102 AC_DEFINE_UNQUOTED(DEBUG, $debug, [Define to 1 to enable debugging code])
104 dnl --enable-unit-mm : Set default unit for coordinates in status bar to mm
105 AC_ARG_ENABLE(unit-mm,
106 [ --enable-unit-mm Set default unit for coordinates in status bar to mm],
108 if test "$enableval" = "yes"; then
112 if test "$default_unit" = "mm"; then
113 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MMS, [Default unit to display in statusbar])
115 AC_DEFINE(GERBV_DEFAULT_UNIT, GERBV_MILS, [Default unit to display in statusbar])
120 ############################################################
123 ############################################################
128 dnl Build time sanity check... (?)
131 dnl Checks for programs.
137 if test "x$WIN32" = "xyes" ; then
138 AC_CHECK_TOOL(WINDRES, windres, no)
139 if test "$WINDRES" = "no"; then
140 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
144 # if we have gcc then add -Wall
145 if test "x$GCC" = "xyes"; then
146 if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
147 CFLAGS="$CFLAGS -Wall"
151 # Check for ImageMagick tools used by the testsuite
152 AC_PATH_PROG(IM_ANIMATE, animate, notfound)
153 AC_PATH_PROG(IM_COMPARE, compare, notfound)
154 AC_PATH_PROG(IM_COMPOSITE, composite, notfound)
155 AC_PATH_PROG(IM_CONVERT, convert, notfound)
156 AC_PATH_PROG(IM_DISPLAY, display, notfound)
157 AC_PATH_PROG(IM_MONTAGE, montage, notfound)
159 test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate"
160 test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare"
161 test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite"
162 test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert"
163 test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display"
164 test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage"
166 AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found])
167 if test "X${missing_magick}" != "X" ; then
168 AC_MSG_RESULT([no. The testsuite will be disabled because the following
169 tools from the ImageMagick suite were not found:
171 No loss in gerbv functionality should be experienced, you just will not
172 be able to run the regression testsuite.
179 AM_CONDITIONAL(HAVE_MAGICK, test x$have_magick = xyes)
181 # Check for pkg-config
182 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
183 if test "$PKG_CONFIG" = "no"; then
184 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
190 ############################################################
192 ############################################################
201 ############################################################
203 ############################################################
205 # GTK and cairo checks
209 PKG_CHECK_MODULES(CAIRO, cairo >= 1.2.0, , [AC_MSG_ERROR([
210 *** Cairo > 1.2.0 required but not found. ***
211 Please review the following errors:
215 CAIRO_VER=`$PKG_CONFIG cairo --modversion`
217 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, , [AC_MSG_ERROR([
218 *** GTK >= 2.4.0 is required but was not found. Please review
219 the following errors:
223 GTK_VER=`$PKG_CONFIG gtk+-2.0 --modversion`
227 ############################################################
230 ############################################################
234 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
235 AC_ARG_ENABLE([efence],
236 [ --enable-efence Link with ElectricFence for malloc debugging [default=no]],
238 if test "X$enable_efence" != "Xno" ; then
240 AC_CHECK_LIB(efence,main,,
241 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
253 ############################################################
255 ######################################################################
257 # desktop integration
260 AC_PATH_PROG(SETENV, env, [])
261 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
263 # Change default location for XDG files (MIME and Icons)
264 AC_ARG_WITH(xdgdatadir, [ --with-xdgdatadir=path Change where the theme icons
265 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
267 if test x$opt_xdgdatadir = x; then
268 # path was not specified with --with-xdgdatadir
269 XDGDATADIR='${datadir}'
271 # path WAS specified with --with-xdgdatadir
272 XDGDATADIR="$opt_xdgdatadir"
276 AC_ARG_ENABLE(update-desktop-database,
277 AC_HELP_STRING([--disable-update-desktop-database],
278 [do not update desktop database after installation]),,
279 enable_update_desktop_database=yes)
281 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
283 if test x$enable_update_desktop_database = xyes ; then
284 AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
285 if test $UPDATE_DESKTOP_DATABASE = no; then
286 AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
291 ######################################################################
293 AC_CHECK_HEADERS(unistd.h getopt.h string.h sys/mman.h sys/types.h sys/stat.h stdlib.h regex.h libgen.h time.h)
295 AC_CHECK_FUNCS(getopt_long)
296 AC_CHECK_FUNCS(strlwr)
299 AC_CHECK_FUNCS(realpath canonicalize_file_name)
300 libiberty_NEED_DECLARATION(canonicalize_file_name)
303 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS $GTK_CFLAGS $CAIRO_CFLAGS"
304 LIBS="$LIBS $GDK_PIXBUF_LIBS $GTK_LIBS $CAIRO_LIBS"
307 ############################################################
309 # scheme configure stuff
312 AC_DEFINE([STANDALONE], [0],[Scheme interpreter not used standalone])
313 AC_DEFINE([USE_DL],[1],[Dynamic linking in Scheme interpreter])
314 AC_DEFINE([SUN_DL],[1],[DL Sun method])
315 AC_DEFINE([USE_MATH],[1],[Math in Scheme interpreter])
316 AC_DEFINE([USE_ASCII_NAMES],[1],[ASCII names in Scheme interpreter])
317 AC_DEFINE([USE_COLON_HOOKS],[1],[Colon Hooks in Scheme interpreter])
318 AC_DEFINE([USE_STRING_HOOKS],[1],[String Hooks in Scheme interpreter])
319 AC_DEFINE([USE_INTERFACE],[1],[Use extension interface of Scheme interpreter])
323 ############################################################
325 ############################################################
327 # Figure out relative paths
330 # standard autoconf variables
331 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
332 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
334 # these relative paths will be used to help locate init.scm
335 # in the event that the installation directory is relocated.
337 AC_MSG_CHECKING([for the bindir to datadir relative path])
338 adl_COMPUTE_RELATIVE_PATHS([bindir:datadir:bindir_to_datadir])
339 adl_NORMALIZE_PATH([bindir_to_datadir], [$GERBV_DIR_SEPARATOR_S])
340 AC_MSG_RESULT([$bindir_to_datadir])
341 AC_DEFINE_UNQUOTED(BINDIR_TO_DATADIR, "$bindir_to_datadir", [Relative path from bindir to datadir])
343 PKGDATADIR=${datadir}/${PACKAGE}
344 AC_MSG_CHECKING([for the bindir to pkgdatadir relative path])
345 adl_COMPUTE_RELATIVE_PATHS([bindir:PKGDATADIR:bindir_to_pkgdatadir])
346 adl_NORMALIZE_PATH([bindir_to_pkgdatadir], [$GERBV_DIR_SEPARATOR_S])
347 AC_MSG_RESULT([$bindir_to_pkgdatadir])
348 AC_DEFINE_UNQUOTED(BINDIR_TO_PKGDATADIR, "$bindir_to_pkgdatadir", [Relative path from bindir to pkgdatadir])
350 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
351 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
352 adl_NORMALIZE_PATH([bindir_to_execprefix], [$GERBV_DIR_SEPARATOR_S])
353 AC_MSG_RESULT([$bindir_to_execprefix])
354 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
359 ############################################################
361 AC_OUTPUT( Makefile \
363 doc/PNG-print/Makefile \
366 doc/example-code/Makefile \
368 example/eaglecad1/Makefile \
369 example/nollezappare/Makefile \
370 example/numpres/Makefile \
371 example/jj/Makefile \
372 example/dan/Makefile \
373 example/ekf2/Makefile \
374 example/exposure/Makefile \
375 example/am-test/Makefile \
376 example/cslk/Makefile \
377 example/orcad/Makefile \
378 example/Mentor-BoardStation/Makefile \
379 example/pick-and-place/Makefile \
380 example/polarity/Makefile \
381 example/thermal/Makefile \
382 example/trailing/Makefile \
390 test/golden/Makefile \
391 test/inputs/Makefile )
393 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
396 ** Configuration summary for $PACKAGE $VERSION:
399 xdg data directory: $expandedXDGDATADIR
406 GTK Version: $GTK_VER
407 Cairo Version: $CAIRO_VER
409 Electric Fence Debugging: $with_efence