Add ghid_route_style_selector_empty to GHidRouteStyleSelector
[geda-pcb/whiteaudio.git] / configure.ac
blob71ab1c4c5841aa0dc32d3dd6d9e4043a4fab3bf0
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([pcb], [1.99z])
4 AC_CONFIG_SRCDIR([src/draw.c])
5 AC_PREREQ([2.60])
6 AM_INIT_AUTOMAKE([1.9])
7 AC_GNU_SOURCE
8 AM_CONFIG_HEADER([config.h])
10 ##########################################################################
12 # Try to figure out if we are building from git sources.
13 # If we are then unless building of the documentation has
14 # been disabled then just require the user have all the right
15 # tools.  Users building from a tarball won't need latex, makeinfo,
16 # etc. but if you're already downloading development sources, then
17 # it is not unreasonable to require development tools.  What motivated
18 # this is that using maintainer mode proved to cause regular confusion.
20 pcb_sources="tarball"
21 AC_MSG_CHECKING([if you are building from a git checkout])
22 pcb_git_version=no
23 if test -f $srcdir/.gitignore ; then
24         pcb_git_version=yes
25         AC_MSG_RESULT([yes])
26         pcb_sources="GIT"
27 else
28         AC_MSG_RESULT([no])
30 AM_CONDITIONAL(GIT_VERSION, test x$pcb_git_version = xyes)
32 AC_MSG_CHECKING([if you are building from a anoncvs checkout])
33 pcb_cvs_version=no
34 if test -f $srcdir/CVS/Root ; then
35         pcb_cvs_version=yes
36         AC_MSG_RESULT([yes])
37         pcb_sources="CVS"
38 else
39         AC_MSG_RESULT([no])
41 AM_CONDITIONAL(CVS_VERSION, test x$pcb_cvs_version = xyes)
42 AM_CONDITIONAL(GIT_OR_CVS_VERSION, test x$pcb_git_version = xyes -o x$pcb_cvs_version = xyes)
45 ##########################################################################
47 # See if we are supposed to build the docs
50 docs_yesno=yes
51 AC_MSG_CHECKING([if the documentation should be built])
52 AC_ARG_ENABLE([doc],
53 [  --enable-doc            Build and install the documentation [[default=yes]]],
55 if test "X$enable_doc" = "Xno" ; then
56         DOC=""
57         AC_MSG_RESULT([no])
58         docs_yesno=no
59 else
60         DOC=doc
61         AC_MSG_RESULT([yes])
62         docs_yesno=yes
66 DOC=doc
67 AC_MSG_RESULT([yes])
68 docs_yesno=yes
70 AC_SUBST(DOC)
73 AC_MSG_CHECKING([if maintainer mode is required])
74 if test "$docs_yesno" = "yes" -a "$pcb_git_version" = "yes" ; then
75         AC_MSG_RESULT([yes -- the documentation build is enabled and your sources are from git])
76         enable_maintainer_mode=yes
77 else
78         AC_MSG_RESULT([no])
81 AM_MAINTAINER_MODE
84 dnl determine host type
85 AC_CANONICAL_HOST
86 AC_MSG_CHECKING(for windows)
87 PCB_PATH_DELIMETER=":"
88 PCB_DIR_SEPARATOR_S="/"
89 PCB_DIR_SEPARATOR_C='/'
90 case $host in
91         *-*-cygwin* )
92                 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
93                 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
94                 ;;
96         *-*-mingw* )
97                 WIN32=yes
98                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
99                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
100                 ;;
102         * )
103                 WIN32=no
104                 ;;
105 esac
107 AC_MSG_RESULT($WIN32)
108 AC_SUBST(WIN32)
109 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
110 if test "x$WIN32" = "xyes" ; then
111         PCB_PATH_DELIMETER=";"
112         PCB_DIR_SEPARATOR_S="\\\\"
113         PCB_DIR_SEPARATOR_C='\\'
116 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
117 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
118 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
121 dnl Checks for programs.
122 AC_PROG_CC
123 AC_PROG_CXX
125 if test "x$WIN32" = "xyes" ; then
126         AC_CHECK_TOOL(WINDRES, windres, [no])
127         if test "$WINDRES" = "no" ; then
128                 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
129         fi
132 # i18n
133 GETTEXT_PACKAGE=$PACKAGE
134 AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain])
135 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
136 AC_SUBST(GETTEXT_PACKAGE)
138 AM_GNU_GETTEXT_VERSION([0.14])
139 AM_GNU_GETTEXT
140 IT_PROG_INTLTOOL([0.35.0])
142 AC_C_INLINE
143 AC_PROG_CC_STDC
144 AM_PROG_CC_C_O
145 AC_PROG_CPP
146 AC_PROG_AWK
147 AC_PROG_MKDIR_P
149 AM_PROG_LEX
150 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
151 if test "$LEX_PATH" = "notfound" ; then
152         AC_MSG_ERROR([Couldn't find a usable lex program.
153 Please install flex which is available from
154 ftp://ftp.gnu.org/pub/non-gnu/flex/
159 AC_PROG_YACC
160 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
161 if test "$YACC_PATH" = "notfound" ; then
162         AC_MSG_ERROR([Couldn't find a usable yacc program.
163 Please install bison which is available from
164 ftp://ftp.gnu.org/pub/gnu/bison/
168 AC_PROG_INSTALL
169 AC_PROG_RANLIB
172 # Used for building the icons
174 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
175 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
176 AC_PATH_PROG(CONVERT, convert, notfound)
178 ##########################################################################
181 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
182    AC_PATH_PROG(MKINFO, makeinfo, no)
183    if test "X$MKINFO" != "Xno"; then
184       AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
185       v=`$MKINFO --version | grep "GNU texinfo"`
186       if test $? -ne 0; then
187          AC_MSG_RESULT([non-GNU])
188          MKINFO="no"
189       fi
190    fi
191    if test "X$MKINFO" != "Xno"; then
192       vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
193       vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
194       AC_MSG_RESULT([$vmajor.$vminor])
195       if test "$vmajor" -lt 4 \
196               || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
197          MKINFO=no
198       fi
199    fi
200    if test "X$MKINFO" = "Xno"; then
201       AC_MSG_ERROR([You have requested a build
202 of the documentation.  For this to work, you must have version 4.6 or newer of
203 the GNU texinfo package.  You seem to have
207 Please update to a newer version of texinfo or disable building of
208 the documentation with --disable-doc
210    fi
212    AC_PATH_PROG(TEXI2DVI, texi2dvi, no)
213    if test "X$TEXI2DVI" = "Xno"; then
214       AC_MSG_ERROR([You have requested a build
215 of the documentation.  For this to work, you must have the texi2dvi program
216 installed.  Alternatively, you can disable building the documentation with
217 --disable-doc.])
218    fi
221         AC_PATH_PROG(PERL, perl, notfound)
222         if test "X$PERL" = "Xnotfound"; then
223                         AC_MSG_ERROR([You have requested a build
224 of the documentation.  For this to work, you must have perl installed.
225 Alternatively, you can disable building the documentation with
226 --disable-doc.
228         fi
231    AC_PATH_PROG([KPSEWHICH], [kpsewhich], [no])
232    if test "X$KPSEWHICH" = "Xno"; then
233       AC_MSG_ERROR([You have requested a build
234 of the documentation.  For this to work, you must have a functional install of
235 TeX and LaTeX.  kpsewhich is part of TeX.
236 Alternatively, you can disable building the documentation with
237 --disable-doc.])
238    fi
240    AC_MSG_CHECKING([If your TeX installation contains epsf.tex])
241    f=`$KPSEWHICH epsf.tex`
242    if test $? -eq 0 ; then
243         AC_MSG_RESULT([yes ($f)])
244    else
245         AC_MSG_RESULT([no])
246         AC_MSG_ERROR([You have requested a build
247 of the documentation.  For this to work, you must have a functional install of
248 TeX and LaTeX that includes epsf.tex.  On some linux distributions this is
249 part of the texlive-generic-recommended package.
250 Alternatively, you can disable building the documentation with
251 --disable-doc.])
252    fi
256 ##########################################################################
260 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
261 # need to figure out what the correct test is here.  In the mean time, this
262 # should let things build with SunPRO again.
263 if test "x$GCC" = "xyes"; then
264 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
265 old_LDFLAGS="$LDFLAGS"
266 LDFLAGS="$LDFLAGS -rdynamic"
267 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
268         [AC_MSG_RESULT([yes])],
269         [LDFLAGS="$old_LDFLAGS"
270         AC_MSG_RESULT([no])
271         ])
274 # ------------- HID config -------------------
276 hid_guis=""
277 hid_printers=""
278 hid_exporters=""
279 hid_always=""
281 for hid in `cd $srcdir/src/hid; echo *`; do
282     F=$srcdir/src/hid/$hid/hid.conf
283     if test -f $F 
284     then
285     echo checking $F
286         . $F
287         case $type in
288           gui ) hid_guis="$hid_guis $hid" ;;
289           printer ) hid_printers="$hid_printers $hid" ;;
290           export ) hid_exporters="$hid_exporters $hid" ;;
291           always ) hid_always="$hid_always $hid" ;;
292         esac
293     fi
294 done
296 AC_MSG_CHECKING([for which gui to use])
297 AC_ARG_WITH([gui],
298 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
300 [with_gui=gtk]
302 AC_MSG_RESULT([$with_gui])
303 case " $hid_guis no none " in
304      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
305      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
306 esac
308 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
309 then
310     HIDLIST=
313 AC_MSG_CHECKING([whether to enable toporouter])
314 AC_ARG_ENABLE([toporouter],
315  [AS_HELP_STRING([--enable-toporouter], [build toporouter [default=yes]]) ]
317 AS_CASE(["x$enable_toporouter"],[xyes | xno],,
318  [enable_toporouter=yes
321 AC_MSG_RESULT([$enable_toporouter])
322 AM_CONDITIONAL([WITH_TOPOROUTER], test $enable_toporouter != no)
324 AC_MSG_CHECKING([whether to enable toporouter output])
325 AC_ARG_ENABLE([toporouter-output],
326  [AS_HELP_STRING([--enable-toporouter-output], [enable toporouter graphical output [default=no]]) ]
328 AS_CASE(["z$enable_toporouter_output"],[zyes | zno],,
329  [enable_toporouter_output=no]
331 AC_MSG_RESULT([$enable_toporouter_output])
332 AS_CASE([$enable_toporouter_output],[yes],
334   topo_output_enabled=1
335  ],
337   topo_output_enabled=0
340 AC_DEFINE_UNQUOTED([TOPO_OUTPUT_ENABLED], [$topo_output_enabled],
341  [Define to 1 to enable toporouter graphical output]
344 PKG_PROG_PKG_CONFIG()
346 if test "x$enable_toporouter_output" = "xyes"; then
347    PKG_CHECK_MODULES(CAIRO, cairo,,
348                      [AC_MSG_ERROR([Cannot find cairo, needed by the toporouter
349 Please review the following errors:
350 $CAIRO_PKG_ERRORS])]
351    )
354 AC_MSG_CHECKING([for whether to use DBUS])
355 AC_ARG_ENABLE([dbus],
356 [  --enable-dbus           Enable DBUS IPC],
357 [],[
358         case " $with_gui " in
359                 *\ gtk\ *)     enable_dbus=yes ;;
360                 *\ lesstif\ *) enable_dbus=yes ;;
361                 * )            enable_dbus=no ;;
362         esac
365 AC_MSG_RESULT([$enable_dbus])
366 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
368 if test "x$enable_dbus" = "xyes"; then
369         case " $with_gui " in
370                 *\ gtk\ *) ;;
371                 *\ lesstif\ *) ;;
372                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
373 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
374         esac
375         
376         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61,
377                 [saved_LIBS="$LIBS"
378                  LIBS="$LIBS $DBUS_LIBS"
379                  AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
380                  LIBS="$saved_LIBS" ],
381                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
382 Please review the following errors:
383 $DBUS_PKG_ERRORS])]
384         )
385         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
386         
387         AC_DEFINE([HAVE_DBUS], 1,
388                 [Define to 1 if DBUS IPC is to be compiled in])
393 AC_MSG_CHECKING([for whether to use GL drawing])
394 AC_ARG_ENABLE([gl],
395 [  --enable-gl           Enable GL drawing (with GTK HID)],
396 [],[
397         case " $with_gui " in
398                 *\ gtk\ *) enable_gl=yes;;
399                 * ) enable_gl=no;;
400         esac
402 AC_MSG_RESULT([$enable_gl])
403 AM_CONDITIONAL(USE_GL, test x$enable_gl = xyes)
405 if test "x$enable_gl" = "xyes"; then
406         case " $with_gui " in
407                 *\ gtk\ *) ;;
408                 * ) AC_MSG_ERROR([GL drawing enabled but only works with the GTK HID.
409 Either do not use --enable-gl or enable the gtk HID.])
410         ;;
411         esac
413         AC_CHECK_HEADERS(GL/gl.h)
414         case $ac_cv_header_GL_gl_h in
415           no )
416             AC_MSG_ERROR([You don't seem to have the GL library headers installed.])
417             ;;
418           * ) ;;
419         esac
421         AC_CHECK_HEADERS(GL/glu.h)
422         case $ac_cv_header_GL_glu_h in
423           no )
424             AC_MSG_ERROR([You don't seem to have the GL glu library headers installed.])
425             ;;
426           * ) ;;
427         esac
429         GLU_CFLAGS=
430         GLU_LIBS=-lGLU
432         AC_DEFINE([ENABLE_GL], 1,
433                 [Define to 1 if GL support is to be compiled in])
436 AC_MSG_CHECKING([for which printer to use])
437 AC_ARG_WITH([printer],
438 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
439 [],[with_printer=lpr])
440 AC_MSG_RESULT([$with_printer])
441 case " $hid_printers " in
442      *\ $with_printer\ * )
443          HIDLIST="$HIDLIST $with_printer"
444          ;;
445      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
446 esac
448 AC_MSG_CHECKING([for which exporters to use])
449 AC_ARG_WITH([exporters],
450 [  --with-exporters=       Enable export devices: bom gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]],
451 [],[with_exporters=$hid_exporters])
452 AC_MSG_RESULT([$with_exporters])
453 for e in `echo $with_exporters | sed 's/,/ /g'`; do
454     case " $hid_exporters " in
455       *\ $e\ * )
456          HIDLIST="$HIDLIST $e"
457          ;;
458       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
459     esac
460 done
462 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
463         case " ${HIDLIST} " in
464                 *\ png\ *)
465                         AC_MSG_ERROR([you have requested the png HID but turned off all output
466 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
467 which exporters you want and do not list png there.])
468                         ;;
470                 *)
471                         ;;
472         esac
475 for hid in $HIDLIST; do
476     F=$srcdir/src/hid/$hid/hid.conf
477     if test -f $F ; then
478         echo checking $hid depedencies
479         deps=
480         . $F
481         for dep in $deps; do
482             if test "X`echo $HIDLIST | grep $dep`" = "X"; then
483                 AC_MSG_ERROR([you have requested the $hid HID but not the $dep HID, which it depends on])
484             fi
485         done
486    fi
487 done
489 for e in $HIDLIST; do
490     HIDLIBS="$HIDLIBS lib$e.a"
491 done
493 AC_SUBST(HIDLIST)
494 AC_SUBST(HIDLIBS)
496 # ------------- end HID config -------------------
498 ######################################################################
500 # desktop integration
503 AC_PATH_PROG(SETENV, env, [])
504 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
506 # Change default location for XDG files (MIME and Icons)
507 AC_ARG_WITH(xdgdatadir, [  --with-xdgdatadir=path  Change where the theme icons 
508 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
510 # Change default location for KDE data files (KDE MIME registrations)
511 AC_ARG_WITH(kdedatadir, [  --with-kdedatadir=path  Change where the KDE mime reg
512 istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval])
514 if test x$opt_xdgdatadir = x; then
515         # path was not specified with --with-xdgdatadir
516         XDGDATADIR='${datadir}'
517 else
518         # path WAS specified with --with-xdgdatadir
519         XDGDATADIR="$opt_xdgdatadir"
521 AC_SUBST(XDGDATADIR)
523 if test x$opt_kdedatadir = x; then
524         # path was not specified with --with-kdedatadir
525         KDEDATADIR='${datadir}'
526 else
527         # path WAS specified with --with-kdedatadir
528         KDEDATADIR="$opt_kdedatadir"
530 AC_SUBST(KDEDATADIR)
532 AC_ARG_ENABLE(update-desktop-database,
533         AC_HELP_STRING([--disable-update-desktop-database],
534         [do not update desktop database after installation]),,
535         enable_update_desktop_database=yes)
537 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
539 if test x$enable_update_desktop_database = xyes ; then
540         AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
541         if test $UPDATE_DESKTOP_DATABASE = no; then
542         AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
543         fi
546 AC_ARG_ENABLE(update-mime-database,
547         AC_HELP_STRING([--disable-update-mime-database],
548         [do not update mime database after installation]),,
549         enable_update_mime_database=yes)
551 AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes)
553 if test x$enable_update_mime_database = xyes ; then
554         AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
555         if test $UPDATE_MIME_DATABASE = no; then
556         AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database])
557         fi
561 ######################################################################
563 AC_PATH_PROGS(M4, gm4 m4, [none])
564 if test "X$M4" = "Xnone" ; then
565         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
566         that m4 is installed on your system and that m4 is in your path])
568 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
569 pcb_m4_r=`echo "eval(-2/2)" | $M4`
570 if test "$pcb_m4_r" != "-1" ; then
571         AC_MSG_RESULT([yes])
572         AC_MSG_ERROR([It appears that $M4 has a bug involving division
573 with negative numbers.  In particular it just returned the result that
574 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
575 install a non-broken m4.])
576 else
577         AC_MSG_RESULT([no])
581 AC_PATH_PROGS(WISH, wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
582 if test "X$WISH" = "Xnone" ; then
583         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
584         that tcl is installed on your system and that wish is in your path])
587 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
588 GNUM4=$M4
589 AC_SUBST(GNUM4)
590 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
592 AC_PATH_PROG(PDFLATEX, pdflatex, notfound)
593 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
595 AC_PATH_PROG(TEXI2DVI, texi2dvi, notfound)
596 AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound)
598 AC_PATH_PROG(PS2PDF, ps2pdf, notfound)
599 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
601 # used to build some of the getting started guide
602 AC_PATH_PROG(GSCHEM, gschem, notfound)
603 AM_CONDITIONAL(MISSING_GSCHEM, test x$GSCHEM = xnotfound)
605 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
606         if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then
607                 AC_MSG_ERROR([It appears that you are building from a source tree obtained
608 via git but you do not have the required tools installed to build the documentation.  Here
609 is a list of tools and the detected values:
610 PDFLATEX:  $PDFLATEX
611 TEXI2DVI:  $TEXI2DVI
612 PS2PDF:    $PS2PDF
613 GSCHEM:    $GSCHEM
615 Either make sure these tools are installed or disable building and installing the documentation
616 by using the --disable-doc configure option.
618         fi
621 ############################################################################
623 # These checks are for tools used by the testsuite.  It will not be fatal
624 # if these are missing because this is primarily for developer use.  It is
625 # possible that we might add some --enable flag in the future that forces
626 # full tools for development work.
628 # Check for ImageMagick tools used by the testsuite
629 AC_PATH_PROG(IM_ANIMATE, animate, notfound)
630 AC_PATH_PROG(IM_COMPARE, compare, notfound)
631 AC_PATH_PROG(IM_COMPOSITE, composite, notfound)
632 AC_PATH_PROG(IM_CONVERT, convert, notfound)
633 AC_PATH_PROG(IM_DISPLAY, display, notfound)
634 AC_PATH_PROG(IM_MONTAGE, montage, notfound)
635 missing_magick=""
636 test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate"
637 test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare"
638 test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite"
639 test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert"
640 test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display"
641 test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage"
643 AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found])
644 if test "X${missing_magick}" != "X" ; then
645     AC_MSG_RESULT([no.  The testsuite will be disabled because the following
646 tools from the ImageMagick suite were not found:
647 ${missing_magick}
648 No loss in pcb functionality should be experienced, you just will not
649 be able to run the full regression testsuite.
651     have_magick=no
652 else
653     AC_MSG_RESULT([yes])
654     have_magick=yes
657 have_test_tools=yes
659 test $have_magick = yes || have_test_tools=no
661 # the RS274-X export HID is partially checked by looking at the result with
662 # gerbv
663 AC_PATH_PROG(GERBV, gerbv, notfound)
664 test $GERBV != notfound || have_test_tools=no
667 AM_CONDITIONAL(HAVE_TEST_TOOLS, test x$have_test_tools = xyes)
668 AC_MSG_CHECKING([if all the requried testsuite tools were found])
669 if test x$have_test_tools = xyes ; then
670         AC_MSG_RESULT([yes])
671 else
672         AC_MSG_RESULT([no -- the testsuite will be disabled])
677 ############################################################################
680 dnl Checks for libraries.
681 AC_CHECK_LIB(m, sqrt)
682 AC_CHECK_LIB(dl, dlopen)
683 AC_CHECK_LIB(xnet, gethostbyname)
684 AC_CHECK_LIB(fl, yywrap)
685 AC_CHECK_FUNCS(strerror)
686 AC_CHECK_FUNCS(regcomp re_comp)
687 AC_CHECK_FUNCS(logf expf rint)
688 AC_CHECK_FUNCS(vsnprintf)
689 AC_CHECK_FUNCS(getpwuid getcwd)
690 AC_CHECK_FUNCS(rand random)
691 AC_CHECK_FUNCS(stat)
693 AC_CHECK_FUNCS(mkdtemp)
695 # normally used for all file i/o
696 AC_CHECK_FUNCS(popen)
698 # for lrealpath.c
699 AC_CHECK_FUNCS(realpath canonicalize_file_name)
700 libiberty_NEED_DECLARATION(canonicalize_file_name)
702 # for pcb_spawnvp in action.c on Windows
703 AC_CHECK_FUNCS(_spawnvp)
705 AC_HEADER_STDC
706 AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
707 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h)
708 AC_CHECK_HEADERS(dlfcn.h)
710 if test "x${WIN32}" = "xyes" ; then
711         AC_CHECK_HEADERS(windows.h)
713 # Search for glib
714 PKG_CHECK_MODULES(GLIB, glib-2.0, ,
715                 [AC_MSG_RESULT([Note: cannot find glib-2.0.
716 You may want to review the following errors:
717 $GLIB_PKG_ERRORS])]
720 for e in $HIDLIST; do
721     case $e in
722       lesstif )
723         AC_PATH_XTRA
724         CPPFLAGS="$CFLAGS $X_CFLAGS"
725         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
726         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
727         AC_CHECK_LIB(SM, main, , , $X_LIBS)
728         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
729         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
730         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
731         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
732         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
733         case $ac_cv_lib_Xm_XmCreateMainWindow in
734           no )
735             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
736             ;;
737           * ) ;;
738         esac
739         AC_CHECK_HEADERS(Xm/Xm.h)
740         case $ac_cv_header_Xm_Xm_h in
741           no )
742             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
743             ;;
744           * ) ;;
745         esac
746         ;;
748       gtk )
749         # Check for pkg-config
750         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
751         if test "$PKG_CONFIG" = "no"; then
752                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
753         fi
755         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0, ,
756                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.18.0, install it and rerun ./configure
757 Please review the following errors:
758 $GTK_PKG_ERRORS])]
759         )
760         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
761         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
763         if test "x$enable_gl" = "xyes"; then
764                 # Check for GtkGLExt
765                 PKG_CHECK_MODULES(GTKGLEXT, gtkglext-1.0 >= 1.0.0, , [AC_MSG_ERROR([
766 *** Required version of gtkglext is not installed - please install first ***
767 Please review the following errors:
768 $GTKGLEXT_PKG_ERRORS])]
769                 )
770         GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion`
771         fi
773         ;;
775       gcode|nelma|png )
776         # Check for gdlib-config for gd (www.boutell.com/gd)
777         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
778         if test "$GDLIB_CONFIG" = "no"; then
779                 AC_MSG_RESULT([Cannot find gdlib-config.
780 Make sure it is installed and in your PATH.
781 gdlib-config is part of the GD library available from www.boutell.com/gd.
782 This is needed for the png HID.  I will look for libgd anyway and maybe
783 you will get lucky.
785                 if test "$WIN32" != "yes" ; then
786                         AC_CHECK_LIB(gd,main,,
787                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lgd could not be found]]))
788                 else 
789                         AC_CHECK_LIB(bgd,main,,
790                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lbgd could not be found]]))
791                 fi
792         else
793                 if test "$WIN32" = "yes" ; then
794                         GD=bgd
795                 else
796                         GD=gd
797                 fi
798                 AC_MSG_CHECKING([for libgd cflags])
799                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
800                 AC_MSG_RESULT([$GD_CFLAGS])
801                 AC_MSG_CHECKING([for libgd libs])
802                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
803                 AC_MSG_RESULT([$GD_LIBS])
804         fi
805    
806         # since some linux systems evidently install gdlib-config but fail to
807         # install the headers (nice), check for the header too and fail if it
808         # is not there.
809         CFLAGS="$CFLAGS $GD_CFLAGS"
810         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
811         AC_CHECK_HEADERS(gd.h)
812         case $ac_cv_header_gd_h in
813              no )
814                 AC_MSG_ERROR([
815 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
816 This is needed for the nelma and/or png HID.
818                 ;;
819              * ) ;;
820         esac
821         
822         # Some versions of gd (prior to the expiration of the
823         # patent related to gif compression) do not support
824         # gif output.  Check for that here.
825         save_LIBS="$LIBS"
826         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
828         AC_MSG_CHECKING([if GIF output from the png HID is desired])
829         AC_ARG_ENABLE([gif],
830                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
831                 [
832                 if test "X$enable_gif" != "Xno" ; then
833                         AC_MSG_RESULT([yes])
834                         with_gif=yes
835                 else
836                         AC_MSG_RESULT([no])
837                         with_gif=no
838                 fi
839                 ],
840                 [
841                 AC_MSG_RESULT([yes])
842                 with_gif=yes
843                 ])
844         if test "X$with_gif" = "Xyes" ; then
845                 AC_CHECK_FUNCS(gdImageGif)
846                 if test "$ac_cv_func_gdImageGif" != "yes"; then
847                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
848 You may need to update your installation of gd or disable
849 gif export with --disable-gif])
850                 fi
851         fi
853         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
854         AC_ARG_ENABLE([jpeg],
855                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
856                 [
857                 if test "X$enable_jpeg" != "Xno" ; then
858                         AC_MSG_RESULT([yes])
859                         with_jpeg=yes
860                 else
861                         AC_MSG_RESULT([no])
862                         with_jpeg=no
863                 fi
864                 ],
865                 [
866                 AC_MSG_RESULT([yes])
867                 with_jpeg=yes
868                 ])
869         if test "X$with_jpeg" = "Xyes" ; then
870                 AC_CHECK_FUNCS(gdImageJpeg)
871                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
872                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
873 You may need to update your installation of gd or disable
874 JPEG export with --disable-jpeg])
875                 fi
876         fi
879         AC_MSG_CHECKING([if PNG output from the png HID is desired])
880         AC_ARG_ENABLE([png],
881                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
882                 [
883                 if test "X$enable_png" != "Xno" ; then
884                         AC_MSG_RESULT([yes])
885                         with_png=yes
886                 else
887                         AC_MSG_RESULT([no])
888                         with_png=no
889                 fi
890                 ],
891                 [
892                 AC_MSG_RESULT([yes])
893                 with_png=yes
894                 ])
895         if test "X$with_png" = "Xyes" ; then
896                 AC_CHECK_FUNCS(gdImagePng)
897                 if test "$ac_cv_func_gdImagePng" != "yes"; then
898                         AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
899 You may need to update your installation of gd or disable
900 PNG export with --disable-png])
901                 fi
902         fi
903         LIBS="$save_LIBS"
904         ;;
906     esac
907 done
910 AM_CONDITIONAL(PNG, test x$with_png = xyes)
911 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
913 # ------------- check if png previews should be built for pcblib-newlib
914 AC_MSG_CHECKING([if the m4lib to newlib export should create png previews])
915 AC_ARG_ENABLE(
916         [m4lib-png],
917         [  --enable-m4lib-png      Enable creating png previews for the m4 library],
918         [],[enable_m4lib_png=no])
919 AC_MSG_RESULT([$enable_m4lib_png])
920 AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes)
923 # Run away.... more ugly stuff here.  By default we don't actually build
924 # pcblib-newlib from pcblib unless we are building from cvs or git sources.
925 # The reason is it takes a while and requires the png HID.  The problem is,
926 # what if someone wants to use --enable-m4lib-png but the tarball was built
927 # without the previews.  Or, what if someone does not want the PNG previews
928 # but the person building the tarball included them.  Ugh!  So what the following
929 # code attempts to do is detect that mismatch situation.  Note that we only
930 # want to kick this code in when *not* building from git or cvs sources.
931 build_pcblib_newlib=no
932 if test "$pcb_sources" = "tarball" ; then
933         AC_MSG_CHECKING([If pcblib-newlib was built with png previews])
934         stamp=$srcdir/lib/pcblib-newlib.stamp
935         if test ! -f ${stamp} ; then
936                 AC_MSG_RESULT([unknown, missing ${stamp}])
937                 build_pcblib_newlib=yes
938         else
939                 if test "`cat ${stamp}`" = "png-preview=yes" ; then
940                         AC_MSG_RESULT([yes])
941                         # lib exists and built with preview.
942                         # if we don't want the preview, than rebuild
943                         if test x$enable_m4lib_png != xyes ; then
944                                 build_pcblib_newlib=yes
945                         fi
946                 else
947                         AC_MSG_RESULT([no])
948                         # lib exists and built without preview.
949                         # if we want the preview, than rebuild
950                         if test x$enable_m4lib_png = xyes ; then
951                                 build_pcblib_newlib=yes
952                         fi
953                 fi
954         fi
955 else
956         build_pcblib_newlib=yes
958 AC_MSG_CHECKING([If pcblib-newlib needs to be rebuilt])
959 AC_MSG_RESULT([$build_pcblib_newlib])
960 AM_CONDITIONAL(BUILD_PCBLIB_NEWLIB, test x$build_pcblib_newlib = xyes)
962 if test "X$cross_compiling" = "Xyes" ; then
963         # we are cross compiling so we will need a build host binary for pcb
964         AC_PATH_PROG(PCB, [pcb], [notfound])
965 else
966         PCB="\${top_builddir}/src/pcb"
968 AC_SUBST(PCB)
970 # now make see how essential it was that we have a pcb executable for the build
971 # host
972 if test "X$pcb_git_version" = "Xyes" ; then
973         if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then
974                 if test "$PCB" = "notfound" ; then
975                         AC_MSG_ERROR([You have selected a build with m4lib png
976 previews enabled and/or with building the documentation enabled but you also
977 appear to be cross-compiling.  For this to work, you must have a pcb installed that
978 can run on this machine (the build machine) because it is needed for generating
979 library footprint png previews as well as some of the figures in the documentation.
980 If you wish to skip building the documentation and the footprint previews then add
981 --disable-doc --disable-m4lib-png
982 This will allow your cross build to work.])
983                 fi
984         fi
987 # ------------- Xrender -------------------
988 have_xrender=no
989 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
991 AC_ARG_ENABLE([xrender],
992 [  --disable-xrender       Compile and link with Xrender [default=yes]])
993 case "$have_xrender:$enable_xrender" in
994    no:* ) ;;
995    *:no ) ;;
996    * )
997      X_LIBS="-lXrender $X_LIBS"
998      AC_DEFINE([HAVE_XRENDER], 1,
999                 [Define to 1 if Xrender is available])
1000      ;;
1001 esac
1003 # ------------- Xinerama -------------------
1004 have_xinerama=no
1005 AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS)
1007 AC_ARG_ENABLE([xinerama],
1008 [  --disable-xinerama       Compile and link with Xinerama [default=yes]])
1009 case "$have_xinerama:$enable_xinerama" in
1010    no:* ) ;;
1011    *:no ) ;;
1012    * )
1013      X_LIBS="-lXinerama $X_LIBS"
1014      AC_DEFINE([HAVE_XINERAMA], 1,
1015                 [Define to 1 if Xinerama is available])
1016      ;;
1017 esac
1019 # ------------- dmalloc -------------------
1020 dnl dmalloc checks
1021 with_dmalloc=no
1022 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
1023 AC_ARG_ENABLE([dmalloc],
1024 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
1026 if test "X$enable_dmalloc" != "Xno" ; then
1027         AC_MSG_RESULT([yes])
1028         AC_CHECK_HEADER(dmalloc.h,,
1029                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
1030         AC_CHECK_LIB(dmalloc,main,,
1031                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
1032         DMALLOC_LIBS="-ldmalloc"
1033         with_dmalloc=yes
1034 else
1035         AC_MSG_RESULT([no])
1036         DMALLOC_LIBS=""
1040         AC_MSG_RESULT([no])
1041         DMALLOC_LIBS=""
1044 # ------------- ElectricFence -------------------
1045 dnl ElectricFence checks
1046 with_efence=no
1047 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
1048 AC_ARG_ENABLE([efence],
1049 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
1051 if test "X$enable_efence" != "Xno" ; then
1052         AC_MSG_RESULT([yes])
1053         AC_CHECK_LIB(efence,main,,
1054                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
1055         with_efence=yes
1056 else
1057         AC_MSG_RESULT([no])
1061 AC_MSG_RESULT([no])
1064 # ------------- Enable Debug code -------------------
1065 AC_MSG_CHECKING([for whether to enable debugging code])
1066 AC_ARG_ENABLE([debug],
1067 [  --enable-debug          Enable debugging code],
1068 [],[enable_debug=no])
1070 AC_MSG_RESULT([$enable_debug])
1071 AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
1073 # ------------- mkdir required for win32 compatibility ------------
1074 # WIN32 mkdir takes only one argument, POSIX takes two.
1075 # #include "misc.h" where mkdir is required.
1076 m4_include([m4/m4_ax_func_mkdir.m4])
1077 AX_FUNC_MKDIR
1079 # ------------- Type used for "Coord" type -------------------
1081 AC_CHECK_HEADERS(stdint.h)
1082 AC_ARG_ENABLE([coord64],
1083 [  --enable-coord64        Force 64-bit coordinate types],
1084 [],[enable_coord64=no])
1085 AC_ARG_ENABLE([coord32],
1086 [  --enable-coord32        Force 32-bit coordinate types],
1087 [],[enable_coord32=no])
1089 COORDTYPE="long"
1091 echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h"
1092 case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in
1093   yes:no:yes )
1094     COORD_TYPE="int32_t"
1095     COORD_MAX="INT32_MAX"
1096     ;;
1097   no:yes:yes )
1098     COORD_TYPE="int64_t"
1099     COORD_MAX="INT64_MAX"
1100     ;;
1101   yes:no:no  )
1102     COORD_TYPE="int"
1103     COORD_MAX="INT_MAX"
1104     ;;
1105   no:yes:no  )
1106     COORD_TYPE="long long"
1107     COORD_MAX="LLONG_MAX"
1108     ;;
1109   yes:yes:*  )
1110     AC_MSG_ERROR("*** cannot require both 32 and 64 bit coordinates")
1111     ;;
1112   *:*:*    )
1113     COORD_TYPE="long"
1114     COORD_MAX="LONG_MAX"
1115     ;;
1116 esac
1117 AC_DEFINE_UNQUOTED([COORD_TYPE],[$COORD_TYPE],
1118   [C type for Coordinates])
1119 AC_DEFINE_UNQUOTED([COORD_MAX],[$COORD_MAX],
1120   [Maximum value of coordinate type])
1122 # ------------- Complete set of CFLAGS and LIBS -------------------
1124 CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS"
1125 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GLIB_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS $CAIRO_LIBS $GTKGLEXT_LIBS $GLU_LIBS"
1128 # if we have gcc then add -Wall
1129 if test "x$GCC" = "xyes"; then
1130         # see about adding some extra checks if the compiler takes them
1131         for flag in -Wall ; do
1132                 case " ${CFLAGS} " in
1133                         *\ ${flag}\ *)
1134                                 # flag is already present
1135                                 ;;
1136                         *)
1137                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1138                                 ac_save_CFLAGS="$CFLAGS"
1139                                 CFLAGS="$CFLAGS ${flag}"
1140                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1141                                         [AC_MSG_RESULT([yes])],
1142                                         [AC_MSG_RESULT([no])
1143                                          CFLAGS="$ac_save_CFLAGS"
1144                                         ]
1145                                 )
1146                                 ;;
1147                 esac
1148         done
1151 CXXFLAGS="$CFLAGS"
1153 # Now add C-specific flags
1154 if test "x$GCC" = "xyes"; then
1155         # see about adding some extra checks if the compiler takes them
1156         for flag in -Wdeclaration-after-statement ; do
1157                 case " ${CFLAGS} " in
1158                         *\ ${flag}\ *)
1159                                 # flag is already present
1160                                 ;;
1161                         *)
1162                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1163                                 ac_save_CFLAGS="$CFLAGS"
1164                                 CFLAGS="$CFLAGS ${flag}"
1165                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1166                                         [AC_MSG_RESULT([yes])],
1167                                         [AC_MSG_RESULT([no])
1168                                          CFLAGS="$ac_save_CFLAGS"
1169                                         ]
1170                                 )
1171                                 ;;
1172                 esac
1173         done
1176 # See if we are building gcc with C++.
1177 AC_ARG_ENABLE(build-with-cxx,
1178 [  --enable-build-with-cxx build with C++ compiler instead of C compiler],
1179 ENABLE_BUILD_WITH_CXX=$enableval,
1180 ENABLE_BUILD_WITH_CXX=no)
1182 case "$ENABLE_BUILD_WITH_CXX" in
1183   yes)
1184     CC_OR_CXX="$CXX"
1185     CC_OR_CXX_FLAGS="$CXXFLAGS"
1186     ;;
1187   no)
1188     CC_OR_CXX="$CC"
1189     CC_OR_CXX_FLAGS="$CFLAGS"
1190     ;;
1191 esac
1192 AC_SUBST(CC_OR_CXX)
1193 AC_SUBST(CC_OR_CXX_FLAGS)
1195 # font filename
1196 FONTFILENAME=${FONTFILENAME:-"default_font"}
1197 AC_SUBST(FONTFILENAME)
1198 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
1200 # standard autoconf variables
1201 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
1202 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
1203 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
1205 # directory for old-style library and for fonts
1206 PCBLIBDIR=${datadir}/pcb
1207 AC_SUBST(PCBLIBDIR)
1208 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
1209 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
1211 # name for old-style library
1212 LIBRARYFILENAME=pcblib
1213 AC_SUBST(LIBRARYFILENAME)
1214 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
1217 # directory for new library
1218 PCBTREEDIR=${datadir}/pcb/newlib
1219 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
1220 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
1221 AC_SUBST(PCBTREEDIR)
1222 AC_SUBST(PCBTREEPATH)
1223 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
1224 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
1225 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
1227 # Figure out relative paths
1228 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
1229 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
1230 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
1231 AC_MSG_RESULT([$bindir_to_pcblibdir])
1232 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
1234 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
1235 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
1236 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
1237 AC_MSG_RESULT([$bindir_to_pcbtreedir])
1238 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
1241 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
1242 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
1243 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
1244 AC_MSG_RESULT([$bindir_to_execprefix])
1245 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
1248 BTNMOD=${BTNMOD:-"Mod1"}
1249 AC_SUBST(BTNMOD)
1251 TOPDIRS=
1252 for dir in src lib newlib doc example tools tutorial README_FILES
1254    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
1255 done
1256 AC_SUBST(TOPDIRS)
1258 AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in)
1260 if test -d $srcdir/README_FILES; then
1261    AC_CONFIG_FILES(README_FILES/Makefile)
1263 if test -d $srcdir/doc; then
1264    AC_CONFIG_FILES(doc/Makefile)
1266 if test -d $srcdir/doc/gs; then
1267    AC_CONFIG_FILES(doc/gs/Makefile)
1268    AC_CONFIG_FILES(doc/gs/gafrc)
1269    AC_CONFIG_FILES(doc/gs/gschemrc)
1271 if test -d $srcdir/example; then
1272    AC_CONFIG_FILES(example/Makefile)
1273    AC_CONFIG_FILES(example/libraries/Makefile)
1275 if test -d $srcdir/lib; then
1276    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
1277    AC_CONFIG_FILES(lib/CreateLibrary.sh)
1278    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
1279    AC_CONFIG_FILES(lib/Makefile)
1280    AC_CONFIG_FILES(lib/QueryLibrary.sh)
1281    AC_CONFIG_FILES(lib/qfp-ui)
1283 if test -d $srcdir/newlib; then
1284    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
1285    AC_CONFIG_FILES(newlib/Makefile)
1286    AC_CONFIG_FILES(newlib/connectors/Makefile)
1287    AC_CONFIG_FILES(newlib/crystal/Makefile)
1288    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
1289    AC_CONFIG_FILES(newlib/headers/Makefile)
1290    AC_CONFIG_FILES(newlib/keystone/Makefile)
1291    AC_CONFIG_FILES(newlib/msp430/Makefile)
1292    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
1293    AC_CONFIG_FILES(newlib/sockets/Makefile)
1294    AC_CONFIG_FILES(newlib/tests/Makefile)
1296 AC_CONFIG_FILES(src/Makefile)
1297 AC_CONFIG_FILES(src/icons/Makefile)
1298 if test -d $srcdir/tools; then
1299    AC_CONFIG_FILES(tools/Makefile)
1301 if test -d $srcdir/tutorial; then
1302    AC_CONFIG_FILES(tutorial/Makefile)
1305 dnl testsuite
1306 AC_CONFIG_FILES(tests/inputs/Makefile)
1307 AC_CONFIG_FILES(tests/golden/Makefile)
1308 AC_CONFIG_FILES(tests/golden/hid_bom1/Makefile)
1309 AC_CONFIG_FILES(tests/golden/hid_bom2/Makefile)
1310 AC_CONFIG_FILES(tests/golden/hid_bom3/Makefile)
1311 AC_CONFIG_FILES(tests/golden/hid_bom4/Makefile)
1312 AC_CONFIG_FILES(tests/golden/hid_gcode1/Makefile)
1313 AC_CONFIG_FILES(tests/golden/hid_gcode2/Makefile)
1314 AC_CONFIG_FILES(tests/golden/hid_gcode3/Makefile)
1315 AC_CONFIG_FILES(tests/golden/hid_gcode4/Makefile)
1316 AC_CONFIG_FILES(tests/golden/hid_gcode5/Makefile)
1317 AC_CONFIG_FILES(tests/golden/hid_gcode6/Makefile)
1318 AC_CONFIG_FILES(tests/golden/hid_gcode7/Makefile)
1319 AC_CONFIG_FILES(tests/golden/hid_gcode8/Makefile)
1320 AC_CONFIG_FILES(tests/golden/hid_gcode9/Makefile)
1321 AC_CONFIG_FILES(tests/golden/hid_gcode10/Makefile)
1322 AC_CONFIG_FILES(tests/golden/hid_gcode11/Makefile)
1323 AC_CONFIG_FILES(tests/golden/hid_gerber1/Makefile)
1324 AC_CONFIG_FILES(tests/golden/hid_gerber2/Makefile)
1325 AC_CONFIG_FILES(tests/golden/hid_gerber3/Makefile)
1326 AC_CONFIG_FILES(tests/golden/hid_png1/Makefile)
1327 AC_CONFIG_FILES(tests/golden/hid_png2/Makefile)
1328 AC_CONFIG_FILES(tests/golden/hid_png3/Makefile)
1329 AC_CONFIG_FILES(tests/Makefile)
1331 dnl GTS 0.7.6 - http://gts.sourceforge.net/
1332 AC_CONFIG_FILES(gts/Makefile)
1334 dnl win32 build scripts
1335 AC_CONFIG_FILES(w32/Makefile)
1337 AC_OUTPUT
1339 with_gui=`echo $with_gui`
1340 with_printer=`echo $with_printer`
1341 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
1343 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
1344 expandedKDEDATADIR=`eval "echo $KDEDATADIR"`
1346 AC_MSG_RESULT([
1347 ** Configuration summary for $PACKAGE $VERSION:
1349    GUI:                      $with_gui
1350    Printer:                  $with_printer
1351    Exporters:                $with_exporters
1352    Coordinate type:          $COORD_TYPE
1353    Source tree distribution: $pcb_sources
1354    Build documentation:      $docs_yesno
1355    Build toporouter:         $enable_toporouter
1356    Enable toporouter output: $enable_toporouter_output
1357    xdg data directory:       $expandedXDGDATADIR
1358    KDE data directory:       $expandedKDEDATADIR
1359    dmalloc debugging:        $with_dmalloc
1360    ElectricFence debugging:  $with_efence
1362    Cross Compiling:          $cross_compiling
1363    CC:                       $CC
1364    CXX:                      $CXX
1365    CPPFLAGS:                 $CPPFLAGS
1366    CFLAGS:                   $CFLAGS
1367    CXXFLAGS:                 $CXXFLAGS
1368    LIBS:                     $LIBS
1369    PCB:                      $PCB