Fixup draw.c not to special case based on HID name, use flags instead
[geda-pcb/pcjc2.git] / configure.ac
blobf98192b8d9e0d412bfc00c119e99f30986851f4c
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 AC_CONFIG_HEADERS([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])
82 dnl determine host type
83 AC_CANONICAL_HOST
84 AC_MSG_CHECKING(for windows)
85 PCB_PATH_DELIMETER=":"
86 PCB_DIR_SEPARATOR_S="/"
87 PCB_DIR_SEPARATOR_C='/'
88 case $host in
89         *-*-mingw* )
90                 WIN32=yes
91                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
92                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS}"
93                 ;;
95         * )
96                 WIN32=no
97                 ;;
98 esac
100 AC_MSG_RESULT($WIN32)
101 AC_SUBST(WIN32)
102 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
103 if test "x$WIN32" = "xyes" ; then
104         PCB_PATH_DELIMETER=";"
105         PCB_DIR_SEPARATOR_S="\\\\"
106         PCB_DIR_SEPARATOR_C='\\'
109 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
110 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
111 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
114 dnl Checks for programs.
115 AC_PROG_CC
116 AC_PROG_CXX
118 if test "x$WIN32" = "xyes" ; then
119         AC_CHECK_TOOL(WINDRES, windres, [no])
120         if test "$WINDRES" = "no" ; then
121                 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
122         fi
125 # i18n
126 GETTEXT_PACKAGE=$PACKAGE
127 AH_TEMPLATE([GETTEXT_PACKAGE], [Name of this program's gettext domain])
128 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"])
129 AC_SUBST(GETTEXT_PACKAGE)
131 AM_GNU_GETTEXT_VERSION([0.14])
132 AM_GNU_GETTEXT
133 IT_PROG_INTLTOOL([0.35.0])
135 AC_C_INLINE
136 AC_PROG_CC_STDC
137 AM_PROG_CC_C_O
138 AC_PROG_CPP
139 AC_PROG_AWK
140 AC_PROG_MKDIR_P
142 AM_PROG_LEX
143 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
144 if test "$LEX_PATH" = "notfound" ; then
145         AC_MSG_ERROR([Couldn't find a usable lex program.
146 Please install flex which is available from
147 ftp://ftp.gnu.org/pub/non-gnu/flex/
152 AC_PROG_YACC
153 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
154 if test "$YACC_PATH" = "notfound" ; then
155         AC_MSG_ERROR([Couldn't find a usable yacc program.
156 Please install bison which is available from
157 ftp://ftp.gnu.org/pub/gnu/bison/
161 AC_PROG_INSTALL
162 AC_PROG_RANLIB
165 # Used for building the icons
167 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
168 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
169 AC_PATH_PROG(CONVERT, convert, notfound)
171 ##########################################################################
174 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
175    AC_PATH_PROG(MKINFO, makeinfo, no)
176    if test "X$MKINFO" != "Xno"; then
177       AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
178       v=`$MKINFO --version | grep "GNU texinfo"`
179       if test $? -ne 0; then
180          AC_MSG_RESULT([non-GNU])
181          MKINFO="no"
182       fi
183    fi
184    if test "X$MKINFO" != "Xno"; then
185       vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
186       vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
187       AC_MSG_RESULT([$vmajor.$vminor])
188       if test "$vmajor" -lt 4 \
189               || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
190          MKINFO=no
191       fi
192    fi
193    if test "X$MKINFO" = "Xno"; then
194       AC_MSG_ERROR([You have requested a build
195 of the documentation.  For this to work, you must have version 4.6 or newer of
196 the GNU texinfo package.  You seem to have
200 Please update to a newer version of texinfo or disable building of
201 the documentation with --disable-doc
203    fi
205    AC_PATH_PROG(TEXI2DVI, texi2dvi, no)
206    if test "X$TEXI2DVI" = "Xno"; then
207       AC_MSG_ERROR([You have requested a build
208 of the documentation.  For this to work, you must have the texi2dvi program
209 installed.  Alternatively, you can disable building the documentation with
210 --disable-doc.])
211    fi
214         AC_PATH_PROG(PERL, perl, notfound)
215         if test "X$PERL" = "Xnotfound"; then
216                         AC_MSG_ERROR([You have requested a build
217 of the documentation.  For this to work, you must have perl installed.
218 Alternatively, you can disable building the documentation with
219 --disable-doc.
221         fi
224    AC_PATH_PROG([KPSEWHICH], [kpsewhich], [no])
225    if test "X$KPSEWHICH" = "Xno"; then
226       AC_MSG_ERROR([You have requested a build
227 of the documentation.  For this to work, you must have a functional install of
228 TeX and LaTeX.  kpsewhich is part of TeX.
229 Alternatively, you can disable building the documentation with
230 --disable-doc.])
231    fi
233    AC_MSG_CHECKING([If your TeX installation contains epsf.tex])
234    f=`$KPSEWHICH epsf.tex`
235    if test $? -eq 0 ; then
236         AC_MSG_RESULT([yes ($f)])
237    else
238         AC_MSG_RESULT([no])
239         AC_MSG_ERROR([You have requested a build
240 of the documentation.  For this to work, you must have a functional install of
241 TeX and LaTeX that includes epsf.tex.  On some linux distributions this is
242 part of the texlive-generic-recommended package.
243 Alternatively, you can disable building the documentation with
244 --disable-doc.])
245    fi
249 ##########################################################################
253 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
254 # need to figure out what the correct test is here.  In the mean time, this
255 # should let things build with SunPRO again.
256 if test "x$GCC" = "xyes"; then
257 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
258 old_LDFLAGS="$LDFLAGS"
259 LDFLAGS="$LDFLAGS -rdynamic"
260 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
261         [AC_MSG_RESULT([yes])],
262         [LDFLAGS="$old_LDFLAGS"
263         AC_MSG_RESULT([no])
264         ])
267 # ------------- HID config -------------------
269 hid_guis=""
270 hid_printers=""
271 hid_exporters=""
272 hid_always=""
274 for hid in `cd $srcdir/src/hid; echo *`; do
275     F=$srcdir/src/hid/$hid/hid.conf
276     if test -f $F 
277     then
278     echo checking $F
279         . $F
280         case $type in
281           gui ) hid_guis="$hid_guis $hid" ;;
282           printer ) hid_printers="$hid_printers $hid" ;;
283           export ) hid_exporters="$hid_exporters $hid" ;;
284           always ) hid_always="$hid_always $hid" ;;
285         esac
286     fi
287 done
289 AC_MSG_CHECKING([for which gui to use])
290 AC_ARG_WITH([gui],
291 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
293 [with_gui=gtk]
295 AC_MSG_RESULT([$with_gui])
296 case " $hid_guis no none " in
297      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
298      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
299 esac
301 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
302 then
303     HIDLIST=
306 AC_MSG_CHECKING([whether to enable toporouter])
307 AC_ARG_ENABLE([toporouter],
308  [AS_HELP_STRING([--enable-toporouter], [build toporouter [default=yes]]) ]
310 AS_CASE(["x$enable_toporouter"],[xyes | xno],,
311  [enable_toporouter=yes
314 AC_MSG_RESULT([$enable_toporouter])
315 AM_CONDITIONAL([WITH_TOPOROUTER], test $enable_toporouter != no)
317 AC_MSG_CHECKING([whether to enable toporouter output])
318 AC_ARG_ENABLE([toporouter-output],
319  [AS_HELP_STRING([--enable-toporouter-output], [enable toporouter graphical output [default=no]]) ]
321 AS_CASE(["z$enable_toporouter_output"],[zyes | zno],,
322  [enable_toporouter_output=no]
324 AC_MSG_RESULT([$enable_toporouter_output])
325 AS_CASE([$enable_toporouter_output],[yes],
327   topo_output_enabled=1
328  ],
330   topo_output_enabled=0
333 AC_DEFINE_UNQUOTED([TOPO_OUTPUT_ENABLED], [$topo_output_enabled],
334  [Define to 1 to enable toporouter graphical output]
337 PKG_PROG_PKG_CONFIG()
339 if test "x$enable_toporouter_output" = "xyes"; then
340    PKG_CHECK_MODULES(CAIRO, cairo,,
341                      [AC_MSG_ERROR([Cannot find cairo, needed by the toporouter
342 Please review the following errors:
343 $CAIRO_PKG_ERRORS])]
344    )
347 AC_MSG_CHECKING([for whether to use DBUS])
348 AC_ARG_ENABLE([dbus],
349 [  --enable-dbus           Enable DBUS IPC],
350 [],[
351         case " $with_gui " in
352                 *\ gtk\ *)     enable_dbus=yes ;;
353                 *\ lesstif\ *) enable_dbus=yes ;;
354                 * )            enable_dbus=no ;;
355         esac
358 AC_MSG_RESULT([$enable_dbus])
359 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
361 if test "x$enable_dbus" = "xyes"; then
362         case " $with_gui " in
363                 *\ gtk\ *) ;;
364                 *\ lesstif\ *) ;;
365                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
366 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
367         esac
368         
369         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61,
370                 [saved_LIBS="$LIBS"
371                  LIBS="$LIBS $DBUS_LIBS"
372                  AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
373                  LIBS="$saved_LIBS" ],
374                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
375 Please review the following errors:
376 $DBUS_PKG_ERRORS])]
377         )
378         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
379         
380         AC_DEFINE([HAVE_DBUS], 1,
381                 [Define to 1 if DBUS IPC is to be compiled in])
386 AC_MSG_CHECKING([for whether to use GL drawing])
387 AC_ARG_ENABLE([gl],
388 [  --enable-gl           Enable GL drawing (with GTK HID)],
389 [],[
390         case " $with_gui " in
391                 *\ gtk\ *) enable_gl=yes;;
392                 * ) enable_gl=no;;
393         esac
395 AC_MSG_RESULT([$enable_gl])
396 AM_CONDITIONAL(USE_GL, test x$enable_gl = xyes)
398 if test "x$enable_gl" = "xyes"; then
399         case " $with_gui " in
400                 *\ gtk\ *) ;;
401                 * ) AC_MSG_ERROR([GL drawing enabled but only works with the GTK HID.
402 Either do not use --enable-gl or enable the gtk HID.])
403         ;;
404         esac
406         AX_CHECK_GL
407         AS_IF([test X$no_gl = Xyes],
408               [AC_MSG_FAILURE([OpenGL is required.])])
410         AX_CHECK_GLU
411         AS_IF([test X$no_glu = Xyes],
412               [AC_MSG_FAILURE([The OpenGL GLU library is required.])])
414         AC_DEFINE([ENABLE_GL], 1,
415                 [Define to 1 if GL support is to be compiled in])
418 AC_MSG_CHECKING([for which printer to use])
419 AC_ARG_WITH([printer],
420 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
421 [],[with_printer=lpr])
422 AC_MSG_RESULT([$with_printer])
423 case " $hid_printers " in
424      *\ $with_printer\ * )
425          HIDLIST="$HIDLIST $with_printer"
426          ;;
427      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
428 esac
430 AC_MSG_CHECKING([for which exporters to use])
431 AC_ARG_WITH([exporters],
432 [  --with-exporters=       Enable export devices: bom gerber gcode nelma png ps [[default=bom gerber gcode nelma png ps]]],
433 [],[with_exporters=$hid_exporters])
434 AC_MSG_RESULT([$with_exporters])
435 for e in `echo $with_exporters | sed 's/,/ /g'`; do
436     case " $hid_exporters " in
437       *\ $e\ * )
438          HIDLIST="$HIDLIST $e"
439          ;;
440       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
441     esac
442 done
444 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
445         case " ${HIDLIST} " in
446                 *\ png\ *)
447                         AC_MSG_ERROR([you have requested the png HID but turned off all output
448 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
449 which exporters you want and do not list png there.])
450                         ;;
452                 *)
453                         ;;
454         esac
457 for hid in $HIDLIST; do
458     F=$srcdir/src/hid/$hid/hid.conf
459     if test -f $F ; then
460         echo checking $hid dependencies
461         deps=
462         . $F
463         for dep in $deps; do
464             if test "X`echo $HIDLIST | grep $dep`" = "X"; then
465                 AC_MSG_ERROR([you have requested the $hid HID but not the $dep HID, which it depends on])
466             fi
467         done
468    fi
469 done
471 for e in $HIDLIST; do
472     HIDLIBS="$HIDLIBS lib$e.a"
473 done
475 AC_SUBST(HIDLIST)
476 AC_SUBST(HIDLIBS)
478 # ------------- end HID config -------------------
480 ######################################################################
482 # desktop integration
485 AC_PATH_PROG(SETENV, env, [])
486 AC_PATH_PROG(GTK_UPDATE_ICON_CACHE_BIN, gtk-update-icon-path, [true])
488 # Change default location for XDG files (MIME and Icons)
489 AC_ARG_WITH(xdgdatadir, [  --with-xdgdatadir=path  Change where the theme icons 
490 and mime registrations are installed [[DATADIR]]], [opt_xdgdatadir=$withval])
492 # Change default location for KDE data files (KDE MIME registrations)
493 AC_ARG_WITH(kdedatadir, [  --with-kdedatadir=path  Change where the KDE mime reg
494 istrations are installed [[DATADIR]]], [opt_kdedatadir=$withval])
496 if test x$opt_xdgdatadir = x; then
497         # path was not specified with --with-xdgdatadir
498         XDGDATADIR='${datadir}'
499 else
500         # path WAS specified with --with-xdgdatadir
501         XDGDATADIR="$opt_xdgdatadir"
503 AC_SUBST(XDGDATADIR)
505 if test x$opt_kdedatadir = x; then
506         # path was not specified with --with-kdedatadir
507         KDEDATADIR='${datadir}'
508 else
509         # path WAS specified with --with-kdedatadir
510         KDEDATADIR="$opt_kdedatadir"
512 AC_SUBST(KDEDATADIR)
514 AC_ARG_ENABLE(update-desktop-database,
515         AC_HELP_STRING([--disable-update-desktop-database],
516         [do not update desktop database after installation]),,
517         enable_update_desktop_database=yes)
519 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
521 if test x$enable_update_desktop_database = xyes ; then
522         AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, [update-desktop-database], no)
523         if test $UPDATE_DESKTOP_DATABASE = no; then
524         AC_MSG_ERROR([Cannot find update-desktop-database, make sure it is installed and in your PATH, or configure with --disable-update-desktop-database])
525         fi
528 AC_ARG_ENABLE(update-mime-database,
529         AC_HELP_STRING([--disable-update-mime-database],
530         [do not update mime database after installation]),,
531         enable_update_mime_database=yes)
533 AM_CONDITIONAL(ENABLE_UPDATE_MIME_DATABASE, test x$enable_update_mime_database = xyes)
535 if test x$enable_update_mime_database = xyes ; then
536         AC_PATH_PROG(UPDATE_MIME_DATABASE, [update-mime-database], no)
537         if test $UPDATE_MIME_DATABASE = no; then
538         AC_MSG_ERROR([Cannot find update-mime-database, make sure it is installed and in your PATH, or configure with --disable-update-mime-database])
539         fi
543 ######################################################################
545 AC_PATH_PROGS(M4, gm4 m4, [none])
546 if test "X$M4" = "Xnone" ; then
547         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
548         that m4 is installed on your system and that m4 is in your path])
550 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
551 pcb_m4_r=`echo "eval(-2/2)" | $M4`
552 if test "$pcb_m4_r" != "-1" ; then
553         AC_MSG_RESULT([yes])
554         AC_MSG_ERROR([It appears that $M4 has a bug involving division
555 with negative numbers.  In particular it just returned the result that
556 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
557 install a non-broken m4.])
558 else
559         AC_MSG_RESULT([no])
563 AC_PATH_PROGS(WISH, wish wish85 wish8.5 wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
564 if test "X$WISH" = "Xnone" ; then
565         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
566         that tcl is installed on your system and that wish is in your path])
569 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
570 GNUM4=$M4
571 AC_SUBST(GNUM4)
572 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
574 AC_PATH_PROG(PDFLATEX, pdflatex, notfound)
575 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
577 AC_PATH_PROG(TEXI2DVI, texi2dvi, notfound)
578 AM_CONDITIONAL(MISSING_TEXI2DVI, test x$TEXI2DVI = xnotfound)
580 AC_PATH_PROG(PS2PDF, ps2pdf, notfound)
581 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
583 # used to build some of the getting started guide
584 AC_PATH_PROG(GSCHEM, gschem, notfound)
585 AM_CONDITIONAL(MISSING_GSCHEM, test x$GSCHEM = xnotfound)
587 if test "X$docs_yesno" = "Xyes" -a "X$pcb_git_version" = "Xyes" ; then
588         if test "$PDFLATEX" = "notfound" -o "$TEXI2DVI" = "notfound" -o "$PS2PDF" = "notfound" ; then
589                 AC_MSG_ERROR([It appears that you are building from a source tree obtained
590 via git but you do not have the required tools installed to build the documentation.  Here
591 is a list of tools and the detected values:
592 PDFLATEX:  $PDFLATEX
593 TEXI2DVI:  $TEXI2DVI
594 PS2PDF:    $PS2PDF
595 GSCHEM:    $GSCHEM
597 Either make sure these tools are installed or disable building and installing the documentation
598 by using the --disable-doc configure option.
600         fi
603 ############################################################################
605 # These checks are for tools used by the testsuite.  It will not be fatal
606 # if these are missing because this is primarily for developer use.  It is
607 # possible that we might add some --enable flag in the future that forces
608 # full tools for development work.
610 # Check for ImageMagick tools used by the testsuite
611 AC_PATH_PROG(IM_ANIMATE, animate, notfound)
612 AC_PATH_PROG(IM_COMPARE, compare, notfound)
613 AC_PATH_PROG(IM_COMPOSITE, composite, notfound)
614 AC_PATH_PROG(IM_CONVERT, convert, notfound)
615 AC_PATH_PROG(IM_DISPLAY, display, notfound)
616 AC_PATH_PROG(IM_MONTAGE, montage, notfound)
617 missing_magick=""
618 test "${IM_ANIMATE}" != "notfound" || missing_magick="${missing_magick} animate"
619 test "${IM_COMPARE}" != "notfound" || missing_magick="${missing_magick} compare"
620 test "${IM_COMPOSITE}" != "notfound" || missing_magick="${missing_magick} composite"
621 test "${IM_CONVERT}" != "notfound" || missing_magick="${missing_magick} convert"
622 test "${IM_DISPLAY}" != "notfound" || missing_magick="${missing_magick} display"
623 test "${IM_MONTAGE}" != "notfound" || missing_magick="${missing_magick} montage"
625 AC_MSG_CHECKING([if all ImageMagick tools needed for the testsuite were found])
626 if test "X${missing_magick}" != "X" ; then
627     AC_MSG_RESULT([no.  The testsuite will be disabled because the following
628 tools from the ImageMagick suite were not found:
629 ${missing_magick}
630 No loss in pcb functionality should be experienced, you just will not
631 be able to run the full regression testsuite.
633     have_magick=no
634 else
635     AC_MSG_RESULT([yes])
636     have_magick=yes
639 have_test_tools=yes
641 test $have_magick = yes || have_test_tools=no
643 # the RS274-X export HID is partially checked by looking at the result with
644 # gerbv
645 AC_PATH_PROG(GERBV, gerbv, notfound)
646 test $GERBV != notfound || have_test_tools=no
649 AM_CONDITIONAL(HAVE_TEST_TOOLS, test x$have_test_tools = xyes)
650 AC_MSG_CHECKING([if all the requried testsuite tools were found])
651 if test x$have_test_tools = xyes ; then
652         AC_MSG_RESULT([yes])
653 else
654         AC_MSG_RESULT([no -- the testsuite will be disabled])
659 ############################################################################
662 dnl Checks for libraries.
663 AC_CHECK_LIB(m, sqrt)
664 AC_CHECK_LIB(dl, dlopen)
665 AC_CHECK_LIB(xnet, gethostbyname)
666 AC_CHECK_LIB(fl, yywrap)
667 AC_CHECK_FUNCS(strerror)
668 AC_CHECK_FUNCS(regcomp re_comp)
669 AC_CHECK_FUNCS(logf expf rint)
670 AC_CHECK_FUNCS(vsnprintf)
671 AC_CHECK_FUNCS(getpwuid getcwd)
672 AC_CHECK_FUNCS(rand random)
673 AC_CHECK_FUNCS(stat)
675 AC_CHECK_FUNCS(mkdtemp)
677 # normally used for all file i/o
678 AC_CHECK_FUNCS(popen)
680 # for lrealpath.c
681 AC_CHECK_FUNCS(realpath canonicalize_file_name)
682 libiberty_NEED_DECLARATION(canonicalize_file_name)
684 # for pcb_spawnvp in action.c on Windows
685 AC_CHECK_FUNCS(_spawnvp)
687 AC_HEADER_STDC
688 AC_CHECK_HEADERS(limits.h locale.h string.h sys/types.h regex.h pwd.h)
689 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h sys/wait.h)
690 AC_CHECK_HEADERS(dlfcn.h)
692 if test "x${WIN32}" = "xyes" ; then
693         AC_CHECK_HEADERS(windows.h)
695 # Search for glib
696 PKG_CHECK_MODULES(GLIB, glib-2.0, ,
697                 [AC_MSG_RESULT([Note: cannot find glib-2.0.
698 You may want to review the following errors:
699 $GLIB_PKG_ERRORS])]
702 need_gdlib=no
703 with_gif=no
704 with_png=no
705 with_jpeg=no
707 for e in $HIDLIST; do
708     case $e in
709       lesstif )
710         AC_PATH_XTRA
711         save_CPPFLAGS="$CPPFLAGS"
712         CPPFLAGS="$X_CFLAGS"
713         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
714         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
715         AC_CHECK_LIB(SM, main, , , $X_LIBS)
716         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
717         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
718         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
719         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
720         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
721         CPPFLAGS="$save_CPPFLAGS"
722         case $ac_cv_lib_Xm_XmCreateMainWindow in
723           no )
724             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
725             ;;
726           * ) ;;
727         esac
728         AC_CHECK_HEADERS(Xm/Xm.h)
729         case $ac_cv_header_Xm_Xm_h in
730           no )
731             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
732             ;;
733           * ) ;;
734         esac
735         ;;
737       gtk )
738         # Check for pkg-config
739         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
740         if test "$PKG_CONFIG" = "no"; then
741                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
742         fi
744         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0, ,
745                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.18.0, install it and rerun ./configure
746 Please review the following errors:
747 $GTK_PKG_ERRORS])]
748         )
749         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
750         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
752         if test "x$enable_gl" = "xyes"; then
753                 # Check for GtkGLExt
754                 PKG_CHECK_MODULES(GTKGLEXT, gtkglext-1.0 >= 1.0.0, , [AC_MSG_ERROR([
755 *** Required version of gtkglext is not installed - please install first ***
756 Please review the following errors:
757 $GTKGLEXT_PKG_ERRORS])]
758                 )
759         GTKGLEXT_VER=`$PKG_CONFIG gtkglext-1.0 --modversion`
760         fi
762         ;;
764       png)
765         need_gdlib=yes
766         AC_MSG_CHECKING([if GIF output from the png HID is desired])
767         AC_ARG_ENABLE([gif],
768                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
769                 [
770                 if test "X$enable_gif" != "Xno" ; then
771                         AC_MSG_RESULT([yes])
772                         with_gif=yes
773                 else
774                         AC_MSG_RESULT([no])
775                 fi
776                 ],
777                 [
778                 AC_MSG_RESULT([yes])
779                 with_gif=yes
780                 ])
782         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
783         AC_ARG_ENABLE([jpeg],
784                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
785                 [
786                 if test "X$enable_jpeg" != "Xno" ; then
787                         AC_MSG_RESULT([yes])
788                         with_jpeg=yes
789                 else
790                         AC_MSG_RESULT([no])
791                 fi
792                 ],
793                 [
794                 AC_MSG_RESULT([yes])
795                 with_jpeg=yes
796                 ])
798         AC_MSG_CHECKING([if PNG output from the png HID is desired])
799         AC_ARG_ENABLE([png],
800                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
801                 [
802                 if test "X$enable_png" != "Xno" ; then
803                         AC_MSG_RESULT([yes])
804                         with_png=yes
805                 else
806                         AC_MSG_RESULT([no])
807                 fi
808                 ],
809                 [
810                 AC_MSG_RESULT([yes])
811                 with_png=yes
812                 ])
813         ;;
815       gcode|nelma)
816         need_gdlib=yes
817         with_png=yes
818         ;;
820     esac
821 done
823 if test "$need_gdlib" = "yes"; then
824         # Check for gdlib-config for gd (www.boutell.com/gd)
825         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
826         if test "$GDLIB_CONFIG" = "no"; then
827                 AC_MSG_RESULT([Cannot find gdlib-config.
828 Make sure it is installed and in your PATH.
829 gdlib-config is part of the GD library available from www.boutell.com/gd.
830 This is needed for the png HID.  I will look for libgd anyway and maybe
831 you will get lucky.
833                 if test "$WIN32" != "yes" ; then
834                         AC_CHECK_LIB(gd,main,,
835                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lgd could not be found]]))
836                 else 
837                         AC_CHECK_LIB(bgd,main,,
838                         AC_MSG_ERROR([[You have requested gcode, nelma, or png HIDs  but -lbgd could not be found]]))
839                 fi
840         else
841                 if test "$WIN32" = "yes" ; then
842                         GD=bgd
843                 else
844                         GD=gd
845                 fi
846                 AC_MSG_CHECKING([for libgd cflags])
847                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
848                 AC_MSG_RESULT([$GD_CFLAGS])
849                 AC_MSG_CHECKING([for libgd libs])
850                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
851                 AC_MSG_RESULT([$GD_LIBS])
852         fi
853    
854         # since some linux systems evidently install gdlib-config but fail to
855         # install the headers (nice), check for the header too and fail if it
856         # is not there.
857         save_CPPFLAGS="$CPPFLAGS"
858         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
859         AC_CHECK_HEADERS(gd.h)
860         CPPFLASS="$save_CPPFLAGS"
861         case $ac_cv_header_gd_h in
862              no )
863                 AC_MSG_ERROR([
864 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
865 This is needed for the nelma and/or png HID.
867                 ;;
868              * ) ;;
869         esac
870         
871         # Some versions of gd (prior to the expiration of the
872         # patent related to gif compression) do not support
873         # gif output.  Check for that here.
874         save_LIBS="$LIBS"
875         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
877         if test "X$with_gif" = "Xyes" ; then
878                 AC_CHECK_FUNCS(gdImageGif)
879                 if test "$ac_cv_func_gdImageGif" != "yes"; then
880                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
881 You may need to update your installation of gd or disable
882 gif export with --disable-gif])
883                 fi
884         fi
886         if test "X$with_jpeg" = "Xyes" ; then
887                 AC_CHECK_FUNCS(gdImageJpeg)
888                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
889                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
890 You may need to update your installation of gd or disable
891 JPEG export with --disable-jpeg])
892                 fi
893         fi
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"
906 AM_CONDITIONAL(PNG, test x$with_png = xyes)
907 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
909 # ------------- check if png previews should be built for pcblib-newlib
910 AC_MSG_CHECKING([if the m4lib to newlib export should create png previews])
911 AC_ARG_ENABLE(
912         [m4lib-png],
913         [  --enable-m4lib-png      Enable creating png previews for the m4 library],
914         [],[enable_m4lib_png=no])
915 AC_MSG_RESULT([$enable_m4lib_png])
916 AM_CONDITIONAL(PNG_PREVIEW, test x$enable_m4lib_png = xyes)
919 # Run away.... more ugly stuff here.  By default we don't actually build
920 # pcblib-newlib from pcblib unless we are building from cvs or git sources.
921 # The reason is it takes a while and requires the png HID.  The problem is,
922 # what if someone wants to use --enable-m4lib-png but the tarball was built
923 # without the previews.  Or, what if someone does not want the PNG previews
924 # but the person building the tarball included them.  Ugh!  So what the following
925 # code attempts to do is detect that mismatch situation.  Note that we only
926 # want to kick this code in when *not* building from git or cvs sources.
927 build_pcblib_newlib=no
928 if test "$pcb_sources" = "tarball" ; then
929         AC_MSG_CHECKING([If pcblib-newlib was built with png previews])
930         stamp=$srcdir/lib/pcblib-newlib.stamp
931         if test ! -f ${stamp} ; then
932                 AC_MSG_RESULT([unknown, missing ${stamp}])
933                 build_pcblib_newlib=yes
934         else
935                 if test "`cat ${stamp}`" = "png-preview=yes" ; then
936                         AC_MSG_RESULT([yes])
937                         # lib exists and built with preview.
938                         # if we don't want the preview, than rebuild
939                         if test x$enable_m4lib_png != xyes ; then
940                                 build_pcblib_newlib=yes
941                         fi
942                 else
943                         AC_MSG_RESULT([no])
944                         # lib exists and built without preview.
945                         # if we want the preview, than rebuild
946                         if test x$enable_m4lib_png = xyes ; then
947                                 build_pcblib_newlib=yes
948                         fi
949                 fi
950         fi
951 else
952         build_pcblib_newlib=yes
954 AC_MSG_CHECKING([If pcblib-newlib needs to be rebuilt])
955 AC_MSG_RESULT([$build_pcblib_newlib])
956 AM_CONDITIONAL(BUILD_PCBLIB_NEWLIB, test x$build_pcblib_newlib = xyes)
958 if test "X$cross_compiling" = "Xyes" ; then
959         # we are cross compiling so we will need a build host binary for pcb
960         AC_PATH_PROG(PCB, [pcb], [notfound])
961 else
962         PCB="\${top_builddir}/src/pcb"
964 AC_SUBST(PCB)
966 # now make see how essential it was that we have a pcb executable for the build
967 # host
968 if test "X$pcb_git_version" = "Xyes" ; then
969         if test "X$docs_yesno" = "Xyes" -o "X$enable_m4lib_png" = "Xyes" ; then
970                 if test "$PCB" = "notfound" ; then
971                         AC_MSG_ERROR([You have selected a build with m4lib png
972 previews enabled and/or with building the documentation enabled but you also
973 appear to be cross-compiling.  For this to work, you must have a pcb installed that
974 can run on this machine (the build machine) because it is needed for generating
975 library footprint png previews as well as some of the figures in the documentation.
976 If you wish to skip building the documentation and the footprint previews then add
977 --disable-doc --disable-m4lib-png
978 This will allow your cross build to work.])
979                 fi
980         fi
983 # ------------- Xrender -------------------
984 have_xrender=no
985 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
987 AC_ARG_ENABLE([xrender],
988 [  --disable-xrender       Compile and link with Xrender [default=yes]])
989 case "$have_xrender:$enable_xrender" in
990    no:* ) ;;
991    *:no ) ;;
992    * )
993      X_LIBS="-lXrender $X_LIBS"
994      AC_DEFINE([HAVE_XRENDER], 1,
995                 [Define to 1 if Xrender is available])
996      ;;
997 esac
999 # ------------- Xinerama -------------------
1000 have_xinerama=no
1001 AC_CHECK_LIB(Xinerama,XineramaQueryExtension,have_xinerama=yes,have_xinerama=no,$X_LIBS)
1003 AC_ARG_ENABLE([xinerama],
1004 [  --disable-xinerama       Compile and link with Xinerama [default=yes]])
1005 case "$have_xinerama:$enable_xinerama" in
1006    no:* ) ;;
1007    *:no ) ;;
1008    * )
1009      X_LIBS="-lXinerama $X_LIBS"
1010      AC_DEFINE([HAVE_XINERAMA], 1,
1011                 [Define to 1 if Xinerama is available])
1012      ;;
1013 esac
1015 # ------------- dmalloc -------------------
1016 dnl dmalloc checks
1017 with_dmalloc=no
1018 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
1019 AC_ARG_ENABLE([dmalloc],
1020 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
1022 if test "X$enable_dmalloc" != "Xno" ; then
1023         AC_MSG_RESULT([yes])
1024         AC_CHECK_HEADER(dmalloc.h,,
1025                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
1026         AC_CHECK_LIB(dmalloc,main,,
1027                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
1028         DMALLOC_LIBS="-ldmalloc"
1029         with_dmalloc=yes
1030 else
1031         AC_MSG_RESULT([no])
1032         DMALLOC_LIBS=""
1036         AC_MSG_RESULT([no])
1037         DMALLOC_LIBS=""
1040 # ------------- ElectricFence -------------------
1041 dnl ElectricFence checks
1042 with_efence=no
1043 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
1044 AC_ARG_ENABLE([efence],
1045 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
1047 if test "X$enable_efence" != "Xno" ; then
1048         AC_MSG_RESULT([yes])
1049         AC_CHECK_LIB(efence,main,,
1050                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
1051         with_efence=yes
1052 else
1053         AC_MSG_RESULT([no])
1057 AC_MSG_RESULT([no])
1060 # ------------- Enable Debug code -------------------
1061 AC_MSG_CHECKING([for whether to enable debugging code])
1062 AC_ARG_ENABLE([debug],
1063 [  --enable-debug          Enable debugging code],
1064 [],[enable_debug=no])
1066 AC_MSG_RESULT([$enable_debug])
1067 AM_CONDITIONAL(DEBUG_BUILD, test x$enable_debug = xyes)
1069 # ------------- mkdir required for win32 compatibility ------------
1070 # WIN32 mkdir takes only one argument, POSIX takes two.
1071 # #include "misc.h" where mkdir is required.
1072 m4_include([m4/m4_ax_func_mkdir.m4])
1073 AX_FUNC_MKDIR
1075 # ------------- Type used for "Coord" type -------------------
1077 AC_CHECK_HEADERS(stdint.h)
1078 AC_ARG_ENABLE([coord64],
1079 [  --enable-coord64        Force 64-bit coordinate types],
1080 [],[enable_coord64=no])
1081 AC_ARG_ENABLE([coord32],
1082 [  --enable-coord32        Force 32-bit coordinate types],
1083 [],[enable_coord32=no])
1085 COORDTYPE="long"
1087 echo "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h"
1088 case "$enable_coord32:$enable_coord64:$ac_cv_header_stdint_h" in
1089   yes:no:yes )
1090     COORD_TYPE="int32_t"
1091     COORD_MAX="INT32_MAX"
1092     ;;
1093   no:yes:yes )
1094     COORD_TYPE="int64_t"
1095     COORD_MAX="INT64_MAX"
1096     ;;
1097   yes:no:no  )
1098     COORD_TYPE="int"
1099     COORD_MAX="INT_MAX"
1100     ;;
1101   no:yes:no  )
1102     COORD_TYPE="long long"
1103     COORD_MAX="LLONG_MAX"
1104     ;;
1105   yes:yes:*  )
1106     AC_MSG_ERROR("*** cannot require both 32 and 64 bit coordinates")
1107     ;;
1108   *:*:*    )
1109     COORD_TYPE="long"
1110     COORD_MAX="LONG_MAX"
1111     ;;
1112 esac
1113 AC_DEFINE_UNQUOTED([COORD_TYPE],[$COORD_TYPE],
1114   [C type for Coordinates])
1115 AC_DEFINE_UNQUOTED([COORD_MAX],[$COORD_MAX],
1116   [Maximum value of coordinate type])
1118 # ------------- Complete set of CPPFLAGS and LIBS -------------------
1120 CPPFLAGS="$CPPFLAGS $X_CFLAGS $DBUS_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS $GD_CFLAGS $CAIRO_CFLAGS $GTKGLEXT_CFLAGS $GLU_CFLAGS $GL_CFLAGS"
1121 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GLIB_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS $INTLLIBS $CAIRO_LIBS $GTKGLEXT_LIBS $GLU_LIBS $GL_LIBS"
1124 # if we have gcc then add -Wall
1125 if test "x$GCC" = "xyes"; then
1126         # see about adding some extra checks if the compiler takes them
1127         for flag in -Wall ; do
1128                 case " ${CFLAGS} " in
1129                         *\ ${flag}\ *)
1130                                 # flag is already present
1131                                 ;;
1132                         *)
1133                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1134                                 ac_save_CFLAGS="$CFLAGS"
1135                                 CFLAGS="$CFLAGS ${flag}"
1136                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1137                                         [AC_MSG_RESULT([yes])],
1138                                         [AC_MSG_RESULT([no])
1139                                          CFLAGS="$ac_save_CFLAGS"
1140                                         ]
1141                                 )
1142                                 ;;
1143                 esac
1144         done
1147 CXXFLAGS="$CFLAGS"
1149 # Now add C-specific flags
1150 if test "x$GCC" = "xyes"; then
1151         # see about adding some extra checks if the compiler takes them
1152         for flag in -Wdeclaration-after-statement ; do
1153                 case " ${CFLAGS} " in
1154                         *\ ${flag}\ *)
1155                                 # flag is already present
1156                                 ;;
1157                         *)
1158                                 AC_MSG_CHECKING([if the compiler accepts ${flag}])
1159                                 ac_save_CFLAGS="$CFLAGS"
1160                                 CFLAGS="$CFLAGS ${flag}"
1161                                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
1162                                         [AC_MSG_RESULT([yes])],
1163                                         [AC_MSG_RESULT([no])
1164                                          CFLAGS="$ac_save_CFLAGS"
1165                                         ]
1166                                 )
1167                                 ;;
1168                 esac
1169         done
1172 # See if we are building gcc with C++.
1173 AC_ARG_ENABLE(build-with-cxx,
1174 [  --enable-build-with-cxx build with C++ compiler instead of C compiler],
1175 ENABLE_BUILD_WITH_CXX=$enableval,
1176 ENABLE_BUILD_WITH_CXX=no)
1178 case "$ENABLE_BUILD_WITH_CXX" in
1179   yes)
1180     CC_OR_CXX="$CXX"
1181     ;;
1182   no)
1183     CC_OR_CXX="$CC"
1184     ;;
1185 esac
1186 AC_SUBST(CC_OR_CXX)
1188 # font filename
1189 FONTFILENAME=${FONTFILENAME:-"default_font"}
1190 AC_SUBST(FONTFILENAME)
1191 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
1193 # standard autoconf variables
1194 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
1195 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
1196 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
1198 # directory for old-style library and for fonts
1199 PCBLIBDIR=${datadir}/pcb
1200 AC_SUBST(PCBLIBDIR)
1201 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
1202 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
1204 # name for old-style library
1205 LIBRARYFILENAME=pcblib
1206 AC_SUBST(LIBRARYFILENAME)
1207 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
1210 # directory for new library
1211 PCBTREEDIR=${datadir}/pcb/newlib
1212 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
1213 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
1214 AC_SUBST(PCBTREEDIR)
1215 AC_SUBST(PCBTREEPATH)
1216 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
1217 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
1218 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
1220 # Figure out relative paths
1221 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
1222 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
1223 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
1224 AC_MSG_RESULT([$bindir_to_pcblibdir])
1225 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
1227 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
1228 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
1229 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
1230 AC_MSG_RESULT([$bindir_to_pcbtreedir])
1231 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
1234 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
1235 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
1236 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
1237 AC_MSG_RESULT([$bindir_to_execprefix])
1238 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
1241 BTNMOD=${BTNMOD:-"Mod1"}
1242 AC_SUBST(BTNMOD)
1244 TOPDIRS=
1245 for dir in src lib newlib doc example tools tutorial README_FILES
1247    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
1248 done
1249 AC_SUBST(TOPDIRS)
1251 AC_CONFIG_FILES(Makefile data/Makefile intl/Makefile po/Makefile.in)
1253 if test -d $srcdir/README_FILES; then
1254    AC_CONFIG_FILES(README_FILES/Makefile)
1256 if test -d $srcdir/doc; then
1257    AC_CONFIG_FILES(doc/Makefile)
1259 if test -d $srcdir/doc/gs; then
1260    AC_CONFIG_FILES(doc/gs/Makefile)
1261    AC_CONFIG_FILES(doc/gs/gafrc)
1262    AC_CONFIG_FILES(doc/gs/gschemrc)
1264 if test -d $srcdir/example; then
1265    AC_CONFIG_FILES(example/Makefile)
1266    AC_CONFIG_FILES(example/libraries/Makefile)
1268 if test -d $srcdir/lib; then
1269    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
1270    AC_CONFIG_FILES(lib/CreateLibrary.sh)
1271    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
1272    AC_CONFIG_FILES(lib/Makefile)
1273    AC_CONFIG_FILES(lib/QueryLibrary.sh)
1274    AC_CONFIG_FILES(lib/qfp-ui)
1276 if test -d $srcdir/newlib; then
1277    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
1278    AC_CONFIG_FILES(newlib/Makefile)
1279    AC_CONFIG_FILES(newlib/connectors/Makefile)
1280    AC_CONFIG_FILES(newlib/crystal/Makefile)
1281    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
1282    AC_CONFIG_FILES(newlib/headers/Makefile)
1283    AC_CONFIG_FILES(newlib/keystone/Makefile)
1284    AC_CONFIG_FILES(newlib/msp430/Makefile)
1285    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
1286    AC_CONFIG_FILES(newlib/sockets/Makefile)
1287    AC_CONFIG_FILES(newlib/tests/Makefile)
1289 AC_CONFIG_FILES(src/Makefile)
1290 AC_CONFIG_FILES(src/icons/Makefile)
1291 if test -d $srcdir/tools; then
1292    AC_CONFIG_FILES(tools/Makefile)
1294 if test -d $srcdir/tutorial; then
1295    AC_CONFIG_FILES(tutorial/Makefile)
1298 dnl testsuite
1299 AC_CONFIG_FILES(tests/inputs/Makefile)
1300 AC_CONFIG_FILES(tests/golden/Makefile)
1301 AC_CONFIG_FILES(tests/golden/hid_bom1/Makefile)
1302 AC_CONFIG_FILES(tests/golden/hid_bom2/Makefile)
1303 AC_CONFIG_FILES(tests/golden/hid_bom3/Makefile)
1304 AC_CONFIG_FILES(tests/golden/hid_bom4/Makefile)
1305 AC_CONFIG_FILES(tests/golden/hid_gcode1/Makefile)
1306 AC_CONFIG_FILES(tests/golden/hid_gcode2/Makefile)
1307 AC_CONFIG_FILES(tests/golden/hid_gcode3/Makefile)
1308 AC_CONFIG_FILES(tests/golden/hid_gcode4/Makefile)
1309 AC_CONFIG_FILES(tests/golden/hid_gcode5/Makefile)
1310 AC_CONFIG_FILES(tests/golden/hid_gcode6/Makefile)
1311 AC_CONFIG_FILES(tests/golden/hid_gcode7/Makefile)
1312 AC_CONFIG_FILES(tests/golden/hid_gcode8/Makefile)
1313 AC_CONFIG_FILES(tests/golden/hid_gcode9/Makefile)
1314 AC_CONFIG_FILES(tests/golden/hid_gcode10/Makefile)
1315 AC_CONFIG_FILES(tests/golden/hid_gcode11/Makefile)
1316 AC_CONFIG_FILES(tests/golden/hid_gerber1/Makefile)
1317 AC_CONFIG_FILES(tests/golden/hid_gerber2/Makefile)
1318 AC_CONFIG_FILES(tests/golden/hid_gerber3/Makefile)
1319 AC_CONFIG_FILES(tests/golden/hid_png1/Makefile)
1320 AC_CONFIG_FILES(tests/golden/hid_png2/Makefile)
1321 AC_CONFIG_FILES(tests/golden/hid_png3/Makefile)
1322 AC_CONFIG_FILES(tests/Makefile)
1324 dnl GTS 0.7.6 - http://gts.sourceforge.net/
1325 AC_CONFIG_FILES(gts/Makefile)
1327 dnl win32 build scripts
1328 AC_CONFIG_FILES(w32/Makefile)
1330 AC_OUTPUT
1332 with_gui=`echo $with_gui`
1333 with_printer=`echo $with_printer`
1334 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
1336 expandedXDGDATADIR=`eval "echo $XDGDATADIR"`
1337 expandedKDEDATADIR=`eval "echo $KDEDATADIR"`
1339 AC_MSG_RESULT([
1340 ** Configuration summary for $PACKAGE $VERSION:
1342    GUI:                      $with_gui
1343    Printer:                  $with_printer
1344    Exporters:                $with_exporters
1345    Coordinate type:          $COORD_TYPE
1346    Source tree distribution: $pcb_sources
1347    Build documentation:      $docs_yesno
1348    Build toporouter:         $enable_toporouter
1349    Enable toporouter output: $enable_toporouter_output
1350    xdg data directory:       $expandedXDGDATADIR
1351    KDE data directory:       $expandedKDEDATADIR
1352    dmalloc debugging:        $with_dmalloc
1353    ElectricFence debugging:  $with_efence
1355    Cross Compiling:          $cross_compiling
1356    CC:                       $CC
1357    CXX:                      $CXX
1358    CPPFLAGS:                 $CPPFLAGS
1359    CFLAGS:                   $CFLAGS
1360    CXXFLAGS:                 $CXXFLAGS
1361    LIBS:                     $LIBS
1362    PCB:                      $PCB