2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([pcb], [1.99y])
5 AC_CONFIG_SRCDIR([src/draw.c])
7 AM_INIT_AUTOMAKE([1.9])
9 AM_CONFIG_HEADER([config.h])
13 dnl determine host type
15 AC_MSG_CHECKING(for windows)
16 PCB_PATH_DELIMETER=":"
17 PCB_DIR_SEPARATOR_S="/"
18 PCB_DIR_SEPARATOR_C='/'
21 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
22 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
27 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
28 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
38 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
39 if test "x$WIN32" = "xyes" ; then
40 PCB_PATH_DELIMETER=";"
41 PCB_DIR_SEPARATOR_S="\\\\"
42 PCB_DIR_SEPARATOR_C='\\'
45 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
46 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
47 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
50 dnl Checks for programs.
53 if test "x$WIN32" = "xyes" ; then
54 AC_CHECK_TOOL(WINDRES, windres, [no])
55 if test "$WINDRES" = "no" ; then
56 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
61 GETTEXT_PACKAGE=$PACKAGE
62 AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain])
63 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
64 AC_SUBST(GETTEXT_PACKAGE)
66 AM_GNU_GETTEXT_VERSION([0.14])
68 IT_PROG_INTLTOOL([0.35.0])
77 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
78 if test "$LEX_PATH" = "notfound" ; then
79 AC_MSG_ERROR([Couldn't find a usable lex program.
80 Please install flex which is available from
81 ftp://ftp.gnu.org/pub/non-gnu/flex/
87 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
88 if test "$YACC_PATH" = "notfound" ; then
89 AC_MSG_ERROR([Couldn't find a usable yacc program.
90 Please install bison which is available from
91 ftp://ftp.gnu.org/pub/gnu/bison/
99 # Used for building the icons
101 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
102 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
103 AC_PATH_PROG(CONVERT, convert, notfound)
107 AC_MSG_CHECKING([if the documentation should be built])
109 [ --enable-doc Build and install the documentation [[default=yes]]],
111 if test "X$enable_doc" = "Xno" ; then
128 if test "X$docs_yesno" = "Xyes" -a "X$USE_MAINTAINER_MODE" = "Xyes" ; then
129 AC_CHECK_PROGS(MKINFO, makeinfo, no)
130 if test "X$MKINFO" != "Xno"; then
131 AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
132 v=`$MKINFO --version | grep "GNU texinfo"`
133 if test $? -ne 0; then
134 AC_MSG_RESULT([non-GNU])
138 if test "X$MKINFO" != "Xno"; then
139 vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
140 vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
141 AC_MSG_RESULT([$vmajor.$vminor])
142 if test "$vmajor" -lt 4 \
143 || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
147 if test "X$MKINFO" = "Xno"; then
148 AC_MSG_ERROR([You have requested a maintainer-mode build and a build
149 of the documentation. For this to work, you must have version 4.6 or newer of
150 the GNU texinfo package. You seem to have
157 AC_CHECK_PROGS(TEXI2DVI, texi2dvi, no)
158 if test "X$TEXI2DVI" = "Xno"; then
159 AC_MSG_ERROR([You have requested a maintainer-mode build and a build
160 of the documentation. For this to work, you must have the texi2dvi program
165 AC_PATH_PROG(PERL, perl, notfound)
166 if test "X$PERL" = "Xnotfound"; then
167 AC_MSG_ERROR([You have requested a maintainer-mode build and a build
168 of the documentation. For this to work, you must have perl installed.
173 # FIXME: for now, only try to add -rdynamic if we're using gcc. We really
174 # need to figure out what the correct test is here. In the mean time, this
175 # should let things build with SunPRO again.
176 if test "x$GCC" = "xyes"; then
177 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
178 old_LDFLAGS="$LDFLAGS"
179 LDFLAGS="$LDFLAGS -rdynamic"
180 AC_LINK_IFELSE([int main(){}],
181 [AC_MSG_RESULT([yes])],
182 [LDFLAGS="$old_LDFLAGS"
187 # ------------- HID config -------------------
194 for hid in `cd $srcdir/src/hid; echo *`; do
195 F=$srcdir/src/hid/$hid/hid.conf
201 gui ) hid_guis="$hid_guis $hid" ;;
202 printer ) hid_printers="$hid_printers $hid" ;;
203 export ) hid_exporters="$hid_exporters $hid" ;;
204 always ) hid_always="$hid_always $hid" ;;
209 AC_MSG_CHECKING([for which gui to use])
211 [ --with-gui= Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
215 AC_MSG_RESULT([$with_gui])
216 case " $hid_guis no none " in
217 *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
218 * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
221 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
226 AC_MSG_CHECKING([for whether to use DBUS])
227 AC_ARG_ENABLE([dbus],
228 [ --enable-dbus Enable DBUS IPC],
231 AC_MSG_RESULT([$enable_dbus])
232 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
234 if test "x$enable_dbus" = "xyes"; then
235 case " $with_gui " in
238 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
239 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
242 # Check for pkg-config
243 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
244 if test "$PKG_CONFIG" = "no"; then
245 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
248 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61,
250 LIBS="$LIBS $DBUS_LIBS"
251 AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
252 LIBS="$saved_LIBS" ],
253 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
254 Please review the following errors:
257 DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
259 AC_DEFINE([HAVE_DBUS], 1,
260 [Define to 1 if DBUS IPC is to be compiled in])
264 AC_MSG_CHECKING([for which printer to use])
265 AC_ARG_WITH([printer],
266 [ --with-printer= Specify the printer: lpr [[default=lpr]]],
267 [],[with_printer=lpr])
268 AC_MSG_RESULT([$with_printer])
269 case " $hid_printers " in
270 *\ $with_printer\ * )
271 HIDLIST="$HIDLIST $with_printer"
273 * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
276 AC_MSG_CHECKING([for which exporters to use])
277 AC_ARG_WITH([exporters],
278 [ --with-exporters= Enable export devices: bom gerber nelma png ps [[default=bom gerber nelma png ps]]],
279 [],[with_exporters=$hid_exporters])
280 AC_MSG_RESULT([$with_exporters])
281 for e in `echo $with_exporters | sed 's/,/ /g'`; do
282 case " $hid_exporters " in
284 HIDLIST="$HIDLIST $e"
286 * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
290 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
291 case " ${HIDLIST} " in
293 AC_MSG_ERROR([you have requested the png HID but turned off all output
294 formats! If you do not want gif/jpeg/png output, use --with-exporters to list
295 which exporters you want and do not list png there.])
303 for e in $HIDLIST; do
304 HIDLIBS="$HIDLIBS lib$e.a"
310 # ------------- end HID config -------------------
312 ######################################################################
314 # desktop integration
317 AC_PATH_PROG(SETENV, env, [])
318 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
320 # Change default location for XDG files (MIME and Icons)
321 AC_ARG_WITH(xdgdatadir, [ --with-xdgdatadir=path Change where the theme icons
322 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
324 # Change default location for KDE data files (KDE MIME registrations)
325 AC_ARG_WITH(kdedatadir, [ --with-kdedatadir=path Change where the KDE mime reg
326 istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval])
328 if test x$opt_xdgdatadir = x; then
329 # path was not specified with --with-xdgdatadir
330 XDGDATADIR='${datadir}'
332 # path WAS specified with --with-xdgdatadir
333 XDGDATADIR="$opt_xdgdatadir"
337 if test x$opt_kdedatadir = x; then
338 # path was not specified with --with-kdedatadir
339 KDEDATADIR='${datadir}'
341 # path WAS specified with --with-kdedatadir
342 KDEDATADIR="$opt_kdedatadir"
346 AC_ARG_ENABLE(update-desktop-database,
347 AC_HELP_STRING([--disable-update-desktop-database],
348 [do not update desktop database after installation]),,
349 enable_update_desktop_database=yes)
351 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
353 if test x$enable_update_desktop_database = xyes ; then
354 AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
355 if test $UPDATE_DESKTOP_DATABASE = no; then
356 AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
360 AC_ARG_ENABLE(update-mime-database,
361 AC_HELP_STRING([--disable-update-mime-database],
362 [do not update mime database after installation]),,
363 enable_update_mime_database=yes)
365 AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes)
367 if test x$enable_update_mime_database = xyes ; then
368 AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
369 if test $UPDATE_MIME_DATABASE = no; then
370 AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database])
375 ######################################################################
377 AC_PATH_PROGS(M4, gm4 m4, [none])
378 if test "X$M4" = "Xnone" ; then
379 AC_MSG_ERROR([Did not find a m4 executible. You need to make sure
380 that m4 is installed on your system and that m4 is in your path])
382 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
383 pcb_m4_r=`echo "eval(-2/2)" | $M4`
384 if test "$pcb_m4_r" != "-1" ; then
386 AC_MSG_ERROR([It appears that $M4 has a bug involving division
387 with negative numbers. In particular it just returned the result that
388 -2/2 = $pcb_m4_r instead of -1. This is a known bug in GNU m4-1.4.9. Please
389 install a non-broken m4.])
395 AC_PATH_PROGS(WISH, wish wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
396 if test "X$WISH" = "Xnone" ; then
397 AC_MSG_ERROR([Did not find the wish executible. You need to make sure
398 that tcl is installed on your system and that wish is in your path])
401 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
404 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
406 AC_CHECK_PROGS(LATEX, latex, notfound)
407 AM_CONDITIONAL(MISSING_LATEX, test x$LATEX = xnotfound)
409 AC_CHECK_PROGS(PDFLATEX, pdflatex, notfound)
410 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
412 AC_CHECK_PROGS(DVIPS, dvips, notfound)
413 AM_CONDITIONAL(MISSING_DVIPS, test x$DVIPS = xnotfound)
415 AC_CHECK_PROGS(TEXI2DVI, texi2dvi, notfound)
416 AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound)
418 AC_CHECK_PROGS(PS2PDF, ps2pdf, notfound)
419 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
421 dnl Checks for libraries.
422 AC_CHECK_LIB(m, sqrt)
423 AC_CHECK_LIB(dl, dlopen)
424 AC_CHECK_LIB(xnet, gethostbyname)
425 AC_CHECK_LIB(fl, yywrap)
426 AC_CHECK_FUNCS(strerror)
427 AC_CHECK_FUNCS(regcomp re_comp)
428 AC_CHECK_FUNCS(logf expf rint)
429 AC_CHECK_FUNCS(vsnprintf)
430 AC_CHECK_FUNCS(getpwuid gethostname getcwd)
431 AC_CHECK_FUNCS(random)
434 # normally used for all file i/o
435 AC_CHECK_FUNCS(popen)
438 AC_CHECK_FUNCS(realpath canonicalize_file_name)
439 libiberty_NEED_DECLARATION(canonicalize_file_name)
442 AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
443 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h)
444 AC_CHECK_HEADERS(dlfcn.h)
446 if test "x${WIN32}" = "xyes" ; then
447 AC_CHECK_HEADERS(windows.h)
450 for e in $HIDLIST; do
454 CPPFLAGS="$CFLAGS $X_CFLAGS"
455 AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
456 AC_CHECK_LIB(ICE, main, , , $X_LIBS)
457 AC_CHECK_LIB(SM, main, , , $X_LIBS)
458 AC_CHECK_LIB(Xext, main, , , $X_LIBS)
459 AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
460 AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
461 AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
462 AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
463 case $ac_cv_lib_Xm_XmCreateMainWindow in
465 AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
469 AC_CHECK_HEADERS(Xm/Xm.h)
470 case $ac_cv_header_Xm_Xm_h in
472 AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
479 # Check for pkg-config
480 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
481 if test "$PKG_CONFIG" = "no"; then
482 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
485 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, ,
486 [AC_MSG_ERROR([Cannot find gtk+ >= 2.4.0, install it and rerun ./configure
487 Please review the following errors:
490 GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
492 # if we are building for gtk >= 2.8.0, we can use gdk_display_warp_pointer()
493 # otherwise we need XWarpPointer and we'll pull in the required headers with
494 # gdk/gdkx.h and we'll need to link with X11
495 if ! $PKG_CONFIG gtk+-2.0 --atleast-version=2.8.0 ; then
496 CPPFLAGS="$CFLAGS $GTK_CFLAGS"
497 AC_CHECK_HEADERS([gdk/gdkx.h])
501 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4.0, ,
502 [AC_MSG_ERROR([Cannot find glib >= 2.4.0, install it and rerun ./configure.
503 Please review the following errors:
506 GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
510 # Check for gdlib-config for gd (www.boutell.com/gd)
511 AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
512 if test "$GDLIB_CONFIG" = "no"; then
513 AC_MSG_RESULT([Cannot find gdlib-config.
514 Make sure it is installed and in your PATH.
515 gdlib-config is part of the GD library available from www.boutell.com/gd.
516 This is needed for the png HID. I will look for libgd anyway and maybe
519 if test "$WIN32" != "yes" ; then
520 AC_CHECK_LIB(gd,main,,
521 AC_MSG_ERROR([You have requested the nelma and/or png HID but -lgd could not be found]))
523 AC_CHECK_LIB(bgd,main,,
524 AC_MSG_ERROR([You have requested the nelma and/or png HID but -lbgd could not be found]))
527 if test "$WIN32" = "yes" ; then
532 AC_MSG_CHECKING([for libgd cflags])
533 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
534 AC_MSG_RESULT([$GD_CFLAGS])
535 AC_MSG_CHECKING([for libgd libs])
536 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
537 AC_MSG_RESULT([$GD_LIBS])
540 # since some linux systems evidently install gdlib-config but fail to
541 # install the headers (nice), check for the header too and fail if it
543 CFLAGS="$CFLAGS $GD_CFLAGS"
544 CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
545 AC_CHECK_HEADERS(gd.h)
546 case $ac_cv_header_gd_h in
549 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
550 This is needed for the nelma and/or png HID.
556 # Some versions of gd (prior to the expiration of the
557 # patent related to gif compression) do not support
558 # gif output. Check for that here.
560 LIBS="$save_LIBS $GD_LIBS $X_LIBS"
562 AC_MSG_CHECKING([if GIF output from the png HID is desired])
564 [ --disable-gif Disable support for gif output when the png HID is used [[default=include gif support]]],
566 if test "X$enable_gif" != "Xno" ; then
578 if test "X$with_gif" = "Xyes" ; then
579 AC_CHECK_FUNCS(gdImageGif)
580 if test "$ac_cv_func_gdImageGif" != "yes"; then
581 AC_MSG_ERROR([Your gd installation does not appear to include gif support.
582 You may need to update your installation of gd or disable
583 gif export with --disable-gif])
587 AC_MSG_CHECKING([if JPEG output from the png HID is desired])
588 AC_ARG_ENABLE([jpeg],
589 [ --disable-jpeg Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
591 if test "X$enable_jpeg" != "Xno" ; then
603 if test "X$with_jpeg" = "Xyes" ; then
604 AC_CHECK_FUNCS(gdImageJpeg)
605 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
606 AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
607 You may need to update your installation of gd or disable
608 JPEG export with --disable-jpeg])
613 AC_MSG_CHECKING([if PNG output from the png HID is desired])
615 [ --disable-png Disable support for PNG output when the png HID is used [[default=include PNG support]]],
617 if test "X$enable_png" != "Xno" ; then
629 if test "X$with_png" = "Xyes" ; then
630 AC_CHECK_FUNCS(gdImagePng)
631 if test "$ac_cv_func_gdImagePng" != "yes"; then
632 AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
633 You may need to update your installation of gd or disable
634 PNG export with --disable-png])
644 AM_CONDITIONAL(PNG, test x$with_png = xyes)
645 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
647 # ------------- check if png previews should be built for pcblib-newlib
648 AC_MSG_CHECKING([if the m4lib to newlib export should create png previews])
651 [ --enable-m4lib-png Enable creating png previews for the m4 library],
652 [],[enable_m4lib_png=no])
653 AC_MSG_RESULT([$enable_m4lib_png])
654 AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes)
656 if test "X$cross_compiling" = "Xyes" ; then
657 # we are cross compiling so we will need a build host binary for pcb
658 AC_PATH_PROG(PCB, [pcb], [notfound])
660 PCB="\${top_builddir}/src/pcb"
664 # now make see how essential it was that we have a pcb executable for the build
666 if test "X$USE_MAINTAINER_MODE" = "Xyes" ; then
667 if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then
668 if test "$PCB" = "notfound" ; then
669 AC_MSG_ERROR([You have selected a maintainer mode build with m4lib png
670 previews enabled and/or with building the documentation enabled but you also
671 appear to be cross-compiling. For this to work, you must have a pcb installed that
672 can run on this machine (the build machine) because it is needed for generating
673 library footprint png previews as well as some of the figures in the documentation.
674 If you wish to skip building the documentation and the footprint previews then add
675 --disable-doc --disable-m4lib-png
676 This will allow your cross build to work.])
681 # ------------- Xrender -------------------
683 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
685 AC_ARG_ENABLE([xrender],
686 [ --disable-xrender Compile and link with Xrender [default=yes]])
687 case "$have_xrender:$enable_xrender" in
691 X_LIBS="-lXrender $X_LIBS"
692 AC_DEFINE([HAVE_XRENDER], 1,
693 [Define to 1 if Xrender is available])
697 # ------------- dmalloc -------------------
700 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
701 AC_ARG_ENABLE([dmalloc],
702 [ --enable-dmalloc Compile and link with dmalloc for malloc debugging [default=no]],
704 if test "X$enable_dmalloc" != "Xno" ; then
706 AC_CHECK_HEADER(dmalloc.h,,
707 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
708 AC_CHECK_LIB(dmalloc,main,,
709 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
710 DMALLOC_LIBS="-ldmalloc"
722 # ------------- ElectricFence -------------------
723 dnl ElectricFence checks
725 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
726 AC_ARG_ENABLE([efence],
727 [ --enable-efence Link with ElectricFence for malloc debugging [default=no]],
729 if test "X$enable_efence" != "Xno" ; then
731 AC_CHECK_LIB(efence,main,,
732 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
742 # ------------- Enable Debug code -------------------
743 AC_MSG_CHECKING([for whether to enable debugging code])
744 AC_ARG_ENABLE([debug],
745 [ --enable-debug Enable debugging code],
746 [],[enable_debug=no])
748 AC_MSG_RESULT([$enable_debug])
749 AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
752 # ------------- Complete set of CFLAGS and LIBS -------------------
754 CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GTK_CFLAGS"
755 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS"
758 # if we have gcc then add -Wall
759 if test "x$GCC" = "xyes"; then
760 # see about adding some extra checks if the compiler takes them
761 for flag in -Wall -Wdeclaration-after-statement ; do
762 case " ${CFLAGS} " in
764 # flag is already present
767 AC_MSG_CHECKING([if the compiler accepts ${flag}])
768 ac_save_CFLAGS="$CFLAGS"
769 CFLAGS="$CFLAGS ${flag}"
770 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
771 [AC_MSG_RESULT([yes])],
773 CFLAGS="$ac_save_CFLAGS"
782 FONTFILENAME=${FONTFILENAME:-"default_font"}
783 AC_SUBST(FONTFILENAME)
784 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
786 # standard autoconf variables
787 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
788 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
789 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
791 # directory for old-style library and for fonts
792 PCBLIBDIR=${datadir}/pcb
794 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
795 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
797 # name for old-style library
798 LIBRARYFILENAME=pcblib
799 AC_SUBST(LIBRARYFILENAME)
800 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
803 # directory for new library
804 PCBTREEDIR=${datadir}/pcb/newlib
805 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
806 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
808 AC_SUBST(PCBTREEPATH)
809 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
810 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
811 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
813 # Figure out relative paths
814 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
815 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
816 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
817 AC_MSG_RESULT([$bindir_to_pcblibdir])
818 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
820 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
821 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
822 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
823 AC_MSG_RESULT([$bindir_to_pcbtreedir])
824 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
827 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
828 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
829 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
830 AC_MSG_RESULT([$bindir_to_execprefix])
831 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
834 BTNMOD=${BTNMOD:-"Mod1"}
838 for dir in src lib newlib doc example tools tutorial README_FILES
840 test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
844 AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in)
846 if test -d $srcdir/README_FILES; then
847 AC_CONFIG_FILES(README_FILES/Makefile)
849 if test -d $srcdir/doc; then
850 AC_CONFIG_FILES(doc/Makefile)
851 AC_CONFIG_FILES(doc/gs/Makefile)
853 if test -d $srcdir/example; then
854 AC_CONFIG_FILES(example/Makefile)
855 AC_CONFIG_FILES(example/libraries/Makefile)
857 if test -d $srcdir/lib; then
858 AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
859 AC_CONFIG_FILES(lib/CreateLibrary.sh)
860 AC_CONFIG_FILES(lib/ListLibraryContents.sh)
861 AC_CONFIG_FILES(lib/Makefile)
862 AC_CONFIG_FILES(lib/QueryLibrary.sh)
863 AC_CONFIG_FILES(lib/qfp-ui)
865 if test -d $srcdir/newlib; then
866 AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
867 AC_CONFIG_FILES(newlib/Makefile)
868 AC_CONFIG_FILES(newlib/analog-devices/Makefile)
869 AC_CONFIG_FILES(newlib/burr-brown/Makefile)
870 AC_CONFIG_FILES(newlib/connectors/Makefile)
871 AC_CONFIG_FILES(newlib/crystal/Makefile)
872 AC_CONFIG_FILES(newlib/electro-optics/Makefile)
873 AC_CONFIG_FILES(newlib/headers/Makefile)
874 AC_CONFIG_FILES(newlib/keystone/Makefile)
875 AC_CONFIG_FILES(newlib/msp430/Makefile)
876 AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
877 AC_CONFIG_FILES(newlib/sockets/Makefile)
878 AC_CONFIG_FILES(newlib/tests/Makefile)
880 AC_CONFIG_FILES(src/Makefile)
881 AC_CONFIG_FILES(src/icons/Makefile)
882 if test -d $srcdir/tools; then
883 AC_CONFIG_FILES(tools/Makefile)
885 if test -d $srcdir/tutorial; then
886 AC_CONFIG_FILES(tutorial/Makefile)
889 AC_CONFIG_FILES(win32/Makefile)
893 with_gui=`echo $with_gui`
894 with_printer=`echo $with_printer`
895 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
897 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
898 expandedKDEDATADIR=`eval "echo $KDEDATADIR"`
901 ** Configuration summary for $PACKAGE $VERSION:
904 Printer: $with_printer
905 Exporters: $with_exporters
906 Build documentation: $docs_yesno
907 xdg data directory: $expandedXDGDATADIR
908 KDE data directory: $expandedKDEDATADIR
909 dmalloc debugging: $with_dmalloc
910 ElectricFence debugging: $with_efence
912 Cross Compiling: $cross_compiling