Cleaned up unused return values from gdk_window_get_pointer().
[geda-pcb/gde.git] / configure.ac
blob3e8c24dca0fafd3438706f78437c8557265093b8
1 dnl $Id$
2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(src/draw.c)
5 AM_INIT_AUTOMAKE(pcb, 1.99w)
6 AM_CONFIG_HEADER(config.h)
8 AM_MAINTAINER_MODE
10 dnl determine host type
11 AC_CANONICAL_HOST
12 AC_MSG_CHECKING(for windows)
13 PCB_PATH_DELIMETER=":"
14 PCB_DIR_SEPARATOR_S="/"
15 PCB_DIR_SEPARATOR_C='/'
16 case $host in
17         *-*-cygwin* )
18                 CFLAGS="$CFLAGS ${CYGWIN_CFLAGS}"
19                 CPPFLAGS="$CPPFLAGS ${CYGWIN_CPPFLAGS}"
20                 ;;
22         *-*-mingw* )
23                 WIN32=yes
24                 CFLAGS="$CFLAGS ${MINGW_CFLAGS:--mms-bitfields -mwindows}"
25                 CPPFLAGS="$CPPFLAGS ${MINGW_CPPFLAGS:--mms-bitfields -mwindows}"
26                 ;;
28         * )
29                 WIN32=no
30                 ;;
31 esac
33 AC_MSG_RESULT($WIN32)
34 AC_SUBST(WIN32)
35 AM_CONDITIONAL(WIN32, test x$WIN32 = xyes)
36 if test "x$WIN32" = "xyes" ; then
37         PCB_PATH_DELIMETER=";"
38         PCB_DIR_SEPARATOR_S="\\\\"
39         PCB_DIR_SEPARATOR_C='\\'
42 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_C,'$PCB_DIR_SEPARATOR_C',[Directory separator char])
43 AC_DEFINE_UNQUOTED(PCB_DIR_SEPARATOR_S,"$PCB_DIR_SEPARATOR_S",[Directory separator string])
44 AC_DEFINE_UNQUOTED(PCB_PATH_DELIMETER,"$PCB_PATH_DELIMETER",[Search path separator string])
47 dnl Checks for programs.
48 AC_PROG_CC
49 AC_C_INLINE
50 AC_PROG_CC_STDC
51 AM_PROG_CC_C_O
52 AC_PROG_CPP
53 AC_PROG_AWK
55 AM_PROG_LEX
56 AC_PATH_PROG(LEX_PATH, $LEX, [notfound])
57 if test "$LEX_PATH" = "notfound" ; then
58         AC_MSG_ERROR([Couldn't find a usable lex program.
59 Please install flex which is available from
60 ftp://ftp.gnu.org/pub/non-gnu/flex/
65 AC_PROG_YACC
66 AC_PATH_PROG(YACC_PATH, $YACC, [notfound])
67 if test "$YACC_PATH" = "notfound" ; then
68         AC_MSG_ERROR([Couldn't find a usable yacc program.
69 Please install bison which is available from
70 ftp://ftp.gnu.org/pub/gnu/bison/
74 AC_PROG_INSTALL
75 AC_PROG_RANLIB
78 # Used for building the win32 icons.
80 AC_PATH_PROG(TGIF, tgif, notfound)
81 AM_CONDITIONAL(MISSING_TGIF, test x$TGIF = xnotfound)
82 AC_PATH_PROG(XPMTOPPM, xpmtoppm, notfound)
83 AC_PATH_PROG(PPMTOWINICON, ppmtowinicon, notfound)
84 AM_CONDITIONAL(MISSING_XPMTOPPM, test x$PPMTOWINICON = xnotfound -o x$XPMTOPPM = xnotfound)
85 AC_PATH_PROG(CONVERT, convert, notfound)
86 AM_CONDITIONAL(MISSING_CONVERT, test x$CONVERT = xnotfound)
88 docs_yesno=yes
90 AC_MSG_CHECKING([if the documentation should be built])
91 AC_ARG_ENABLE([doc],
92 [  --enable-doc            Build and install the documentation [[default=yes]]],
94 if test "X$enable_doc" = "Xno" ; then
95         DOC=""
96         AC_MSG_RESULT([no])
97         docs_yesno=no
98 else
99         DOC=doc
100         AC_MSG_RESULT([yes])
101         docs_yesno=yes
105 DOC=doc
106 AC_MSG_RESULT([yes])
107 docs_yesno=yes
109 AC_SUBST(DOC)
111 if test "X$docs_yesno" = "Xyes" -a "X$USE_MAINTAINER_MODE" = "Xyes" ; then
112    AC_CHECK_PROGS(MKINFO, makeinfo, no)
113    if test "X$MKINFO" != "Xno"; then
114       AC_MSG_CHECKING([for GNU makeinfo version >= 4.6])
115       v=`$MKINFO --version | grep "GNU texinfo"`
116       if test $? -ne 0; then
117          AC_MSG_RESULT([non-GNU])
118          MKINFO="no"
119       fi
120    fi
121    if test "X$MKINFO" != "Xno"; then
122       vmajor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
123       vminor=`echo "$v" | sed 's/.* \([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
124       AC_MSG_RESULT([$vmajor.$vminor])
125       if test "$vmajor" -lt 4 \
126               || (test "$vmajor" -eq 4 && test "$vminor" -lt 6); then
127          MKINFO=no
128       fi
129    fi
130    if test "X$MKINFO" = "Xno"; then
131       AC_MSG_ERROR([You have requested a maintainer-mode build and a build
132 of the documentation.  For this to work, you must have version 4.6 or newer of
133 the GNU texinfo package.  You seem to have
138    fi
140         AC_PATH_PROG(PERL, perl, notfound)
141         if test "X$PERL" = "Xnotfound"; then
142                         AC_MSG_ERROR([You have requested a maintainer-mode build and a build
143 of the documentation.  For this to work, you must have perl installed.
145         fi
148 # FIXME:  for now, only try to add -rdynamic if we're using gcc.  We really
149 # need to figure out what the correct test is here.  In the mean time, this
150 # should let things build with SunPRO again.
151 if test "x$GCC" = "xyes"; then
152 AC_MSG_CHECKING([If the compiler accepts -rdynamic])
153 old_LDFLAGS="$LDFLAGS"
154 LDFLAGS="$LDFLAGS -rdynamic"
155 AC_LINK_IFELSE([int main(){}],
156         [AC_MSG_RESULT([yes])],
157         [LDFLAGS="$old_LDFLAGS"
158         AC_MSG_RESULT([no])
159         ])
162 # ------------- HID config -------------------
164 hid_guis=""
165 hid_printers=""
166 hid_exporters=""
167 hid_always=""
169 for hid in `cd $srcdir/src/hid; echo *`; do
170     F=$srcdir/src/hid/$hid/hid.conf
171     if test -f $F 
172     then
173     echo checking $F
174         . $F
175         case $type in
176           gui ) hid_guis="$hid_guis $hid" ;;
177           printer ) hid_printers="$hid_printers $hid" ;;
178           export ) hid_exporters="$hid_exporters $hid" ;;
179           always ) hid_always="$hid_always $hid" ;;
180         esac
181     fi
182 done
184 AC_MSG_CHECKING([for which gui to use])
185 AC_ARG_WITH([gui],
186 [  --with-gui=            Specify the GUI to use: batch gtk lesstif [[default=gtk]]],
188 [with_gui=gtk]
190 AC_MSG_RESULT([$with_gui])
191 case " $hid_guis no none " in
192      *\ $with_gui\ * ) HIDLIST="$with_gui" ;;
193      * ) AC_MSG_ERROR([$with_gui is not a valid gui]) ;;
194 esac
196 if test x"$with_gui" = x"none" -o x"$with_gui" = x"no"
197 then
198     HIDLIST=
201 AC_MSG_CHECKING([for whether to use DBUS])
202 AC_ARG_ENABLE([dbus],
203 [  --enable-dbus           Enable DBUS IPC],
204 [],[enable_dbus=no])
206 AC_MSG_RESULT([$enable_dbus])
207 AM_CONDITIONAL(WITH_DBUS, test x$enable_dbus = xyes)
209 if test "x$enable_dbus" = "xyes"; then
210         case " $with_gui " in
211                 *\ gtk\ *) ;;
212                 *\ lesstif\ *) ;;
213                 * ) AC_MSG_ERROR([DBUS enabled but only works with a mainloop capable GUI HID.
214 Either do not use --enable-dbus or enable the gtk or lesstif GUI HID.])
215         esac
216         
217         # Check for pkg-config
218         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
219         if test "$PKG_CONFIG" = "no"; then
220                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
221         fi
223         PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.61, , 
224                 [AC_MSG_ERROR([Cannot find dbus-1 >= 0.61, install it and rerun ./configure
225 Please review the following errors:
226 $DBUS_PKG_ERRORS])]
227         )
228         DBUS_VERSION=`$PKG_CONFIG dbus-1 --modversion`
229         
230         AC_DEFINE([HAVE_DBUS], 1,
231                 [Define to 1 if DBUS IPC is to be compiled in])
235 AC_MSG_CHECKING([for which printer to use])
236 AC_ARG_WITH([printer],
237 [  --with-printer=        Specify the printer: lpr [[default=lpr]]],
238 [],[with_printer=lpr])
239 AC_MSG_RESULT([$with_printer])
240 case " $hid_printers " in
241      *\ $with_printer\ * )
242          HIDLIST="$HIDLIST $with_printer"
243          ;;
244      * ) AC_MSG_ERROR([$with_printer is not a valid printer]) ;;
245 esac
247 AC_MSG_CHECKING([for which exporters to use])
248 AC_ARG_WITH([exporters],
249 [  --with-exporters=       Enable export devices: bom gerber nelma png ps [[default=bom gerber nelma png ps]]],
250 [],[with_exporters=$hid_exporters])
251 AC_MSG_RESULT([$with_exporters])
252 for e in `echo $with_exporters | sed 's/,/ /g'`; do
253     case " $hid_exporters " in
254       *\ $e\ * )
255          HIDLIST="$HIDLIST $e"
256          ;;
257       * ) AC_MSG_ERROR([$e is not a valid exporter]) ;;
258     esac
259 done
261 if test "X$enable_jpeg" = "Xno" -a "X$enable_gif" = "Xno" -a "X$enable_png" = "Xno" ; then
262         case " ${HIDLIST} " in
263                 *\ png\ *)
264                         AC_MSG_ERROR([you have requested the png HID but turned off all output
265 formats!  If you do not want gif/jpeg/png output, use --with-exporters to list
266 which exporters you want and do not list png there.])
267                         ;;
269                 *)
270                         ;;
271         esac
274 for e in $HIDLIST; do
275     HIDLIBS="$HIDLIBS lib$e.a"
276 done
278 AC_SUBST(HIDLIST)
279 AC_SUBST(HIDLIBS)
281 # ------------- end HID config -------------------
283 AC_PATH_PROGS(M4, gm4 m4, [none])
284 if test "X$M4" = "Xnone" ; then
285         AC_MSG_ERROR([Did not find a m4 executible.  You need to make sure
286         that m4 is installed on your system and that m4 is in your path])
288 AC_MSG_CHECKING([if $M4 has the division involving negative numbers bug])
289 pcb_m4_r=`echo "eval(-2/2)" | $M4`
290 if test "$pcb_m4_r" != "-1" ; then
291         AC_MSG_RESULT([yes])
292         AC_MSG_ERROR([It appears that $M4 has a bug involving division
293 with negative numbers.  In particular it just returned the result that
294 -2/2 = $pcb_m4_r instead of -1.  This is a known bug in GNU m4-1.4.9.  Please
295 install a non-broken m4.])
296 else
297         AC_MSG_RESULT([no])
301 AC_PATH_PROGS(WISH, wish wish83 wish8.3 wish80 wish8.0 cygwish83 cygwish80,[none])
302 if test "X$WISH" = "Xnone" ; then
303         AC_MSG_ERROR([Did not find the wish executible.  You need to make sure
304         that tcl is installed on your system and that wish is in your path])
307 AC_DEFINE_UNQUOTED(M4,$M4,[m4 executible])
308 GNUM4=$M4
309 AC_SUBST(GNUM4)
310 AC_DEFINE_UNQUOTED(GNUM4,"$M4",[m4 program used by pcb])
312 AC_CHECK_PROGS(LATEX, latex, notfound)
313 AM_CONDITIONAL(MISSING_LATEX, test x$LATEX = xnotfound)
315 AC_CHECK_PROGS(PDFLATEX, pdflatex, notfound)
316 AM_CONDITIONAL(MISSING_PDFLATEX, test x$PDFLATEX = xnotfound)
318 AC_CHECK_PROGS(DVIPS, dvips, notfound)
319 AM_CONDITIONAL(MISSING_DVIPS, test x$DVIPS = xnotfound)
321 AC_CHECK_PROGS(PS2PDF, ps2pdf, notfound)
322 AM_CONDITIONAL(MISSING_PS2PDF, test x$PS2PDF = xnotfound)
324 dnl Checks for libraries.
325 AC_CHECK_LIB(m, sqrt)
326 AC_CHECK_LIB(dl, dlopen)
327 AC_CHECK_LIB(xnet, gethostbyname)
328 AC_CHECK_LIB(fl, yywrap)
329 AC_CHECK_FUNCS(strerror)
330 AC_CHECK_FUNCS(regcomp re_comp)
331 AC_CHECK_FUNCS(logf expf rint)
332 AC_CHECK_FUNCS(vsnprintf)
333 AC_CHECK_FUNCS(getpwuid gethostname getcwd)
334 AC_CHECK_FUNCS(random)
335 AC_CHECK_FUNCS(stat)
337 # normally used for all file i/o
338 AC_CHECK_FUNCS(popen)
340 # for lrealpath.c
341 AC_CHECK_FUNCS(realpath canonicalize_file_name)
342 libiberty_NEED_DECLARATION(canonicalize_file_name)
344 AC_HEADER_STDC
345 AC_CHECK_HEADERS(limits.h string.h sys/types.h regex.h pwd.h)
346 AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h sys/param.h sys/times.h)
347 AC_CHECK_HEADERS(dlfcn.h)
349 if test "x${WIN32}" = "xyes" ; then
350         AC_CHECK_HEADERS(windows.h)
353 for e in $HIDLIST; do
354     case $e in
355       lesstif )
356         AC_PATH_XTRA
357         CPPFLAGS="$CFLAGS $X_CFLAGS"
358         AC_CHECK_LIB(X11, XOpenDisplay, , , $X_LIBS)
359         AC_CHECK_LIB(ICE, main, , , $X_LIBS)
360         AC_CHECK_LIB(SM, main, , , $X_LIBS)
361         AC_CHECK_LIB(Xext, main, , , $X_LIBS)
362         AC_CHECK_LIB(Xt, XtOpenDisplay, , , $X_LIBS)
363         AC_CHECK_LIB(Xmu, main, , , $X_LIBS)
364         AC_CHECK_LIB(Xpm, main, , , $X_LIBS)
365         AC_CHECK_LIB(Xm, XmCreateMainWindow, , , $X_LIBS)
366         case $ac_cv_lib_Xm_XmCreateMainWindow in
367           no )
368             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
369             ;;
370           * ) ;;
371         esac
372         AC_CHECK_HEADERS(Xm/Xm.h)
373         case $ac_cv_header_Xm_Xm_h in
374           no )
375             AC_MSG_ERROR([You don't seem to have the Lesstif development environment installed.])
376             ;;
377           * ) ;;
378         esac
379         ;;
381       gtk )
382         # Check for pkg-config
383         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
384         if test "$PKG_CONFIG" = "no"; then
385                 AC_MSG_ERROR([Cannot find pkg-config, make sure it is installed and in your PATH])
386         fi
388         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, , 
389                 [AC_MSG_ERROR([Cannot find gtk+ >= 2.4.0, install it and rerun ./configure
390 Please review the following errors:
391 $GTK_PKG_ERRORS])]
392         )
393         GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion`
394         
395         # if we are building for gtk >= 2.8.0, we can use gdk_display_warp_pointer()
396         # otherwise we need XWarpPointer and we'll pull in the required headers with
397         # gdk/gdkx.h and we'll need to link with X11
398         if ! $PKG_CONFIG gtk+-2.0 --atleast-version=2.8.0 ; then
399                 CPPFLAGS="$CFLAGS $GTK_CFLAGS"
400                 AC_CHECK_HEADERS([gdk/gdkx.h])
401         fi
403         # Search for glib
404         PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.4.0, , 
405                 [AC_MSG_ERROR([Cannot find glib >= 2.4.0, install it and rerun ./configure.
406 Please review the following errors:
407 $GLIB_PKG_ERRORS])]
408         )
409         GLIB_VERSION=`$PKG_CONFIG glib-2.0 --modversion`
410         ;;
412       nelma|png )
413         # Check for gdlib-config for gd (www.boutell.com/gd)
414         AC_PATH_PROG(GDLIB_CONFIG, gdlib-config, no)
415         if test "$GDLIB_CONFIG" = "no"; then
416                 AC_MSG_RESULT([Cannot find gdlib-config.
417 Make sure it is installed and in your PATH.
418 gdlib-config is part of the GD library available from www.boutell.com/gd.
419 This is needed for the png HID.  I will look for libgd anyway and maybe
420 you will get lucky.
422                 if test "$WIN32" != "yes" ; then
423                         AC_CHECK_LIB(gd,main,,
424                         AC_MSG_ERROR([You have requested the nelma and/or png HID  but -lgd could not be found]))
425                 else 
426                         AC_CHECK_LIB(bgd,main,,
427                         AC_MSG_ERROR([You have requested the nelma and/or png HID  but -lbgd could not be found]))
428                 fi
429         else
430                 if test "$WIN32" = "yes" ; then
431                         GD=bgd
432                 else
433                         GD=gd
434                 fi
435                 AC_MSG_CHECKING([for libgd cflags])
436                 GD_CFLAGS="`$GDLIB_CONFIG --cflags`"
437                 AC_MSG_RESULT([$GD_CFLAGS])
438                 AC_MSG_CHECKING([for libgd libs])
439                 GD_LIBS="`$GDLIB_CONFIG --ldflags` `$GDLIB_CONFIG --libs` -l${GD}"
440                 AC_MSG_RESULT([$GD_LIBS])
441         fi
442    
443         # since some linux systems evidently install gdlib-config but fail to
444         # install the headers (nice), check for the header too and fail if it
445         # is not there.
446         CFLAGS="$CFLAGS $GD_CFLAGS"
447         CPPFLAGS="$CPPFLAGS $GD_CFLAGS"
448         AC_CHECK_HEADERS(gd.h)
449         case $ac_cv_header_gd_h in
450              no )
451                 AC_MSG_ERROR([
452 You evidentally do not have a complete installation of the GD library available from www.boutell.com/gd.
453 This is needed for the nelma and/or png HID.
455                 ;;
456              * ) ;;
457         esac
458         
459         # Some versions of gd (prior to the expiration of the
460         # patent related to gif compression) do not support
461         # gif output.  Check for that here.
462         save_LIBS="$LIBS"
463         LIBS="$save_LIBS $GD_LIBS $X_LIBS"
465         AC_MSG_CHECKING([if GIF output from the png HID is desired])
466         AC_ARG_ENABLE([gif],
467                 [  --disable-gif           Disable support for gif output when the png HID is used [[default=include gif support]]],
468                 [
469                 if test "X$enable_gif" != "Xno" ; then
470                         AC_MSG_RESULT([yes])
471                         with_gif=yes
472                 else
473                         AC_MSG_RESULT([no])
474                         with_gif=no
475                 fi
476                 ],
477                 [
478                 AC_MSG_RESULT([yes])
479                 with_gif=yes
480                 ])
481         if test "X$with_gif" = "Xyes" ; then
482                 AC_CHECK_FUNCS(gdImageGif)
483                 if test "$ac_cv_func_gdImageGif" != "yes"; then
484                         AC_MSG_ERROR([Your gd installation does not appear to include gif support.
485 You may need to update your installation of gd or disable
486 gif export with --disable-gif])
487                 fi
488         fi
490         AC_MSG_CHECKING([if JPEG output from the png HID is desired])
491         AC_ARG_ENABLE([jpeg],
492                 [  --disable-jpeg          Disable support for JPEG output when the png HID is used [[default=include JPEG support]]],
493                 [
494                 if test "X$enable_jpeg" != "Xno" ; then
495                         AC_MSG_RESULT([yes])
496                         with_jpeg=yes
497                 else
498                         AC_MSG_RESULT([no])
499                         with_jpeg=no
500                 fi
501                 ],
502                 [
503                 AC_MSG_RESULT([yes])
504                 with_jpeg=yes
505                 ])
506         if test "X$with_jpeg" = "Xyes" ; then
507                 AC_CHECK_FUNCS(gdImageJpeg)
508                 if test "$ac_cv_func_gdImageJpeg" != "yes"; then
509                         AC_MSG_ERROR([Your gd installation does not appear to include JPEG support.
510 You may need to update your installation of gd or disable
511 JPEG export with --disable-jpeg])
512                 fi
513         fi
516         AC_MSG_CHECKING([if PNG output from the png HID is desired])
517         AC_ARG_ENABLE([png],
518                 [  --disable-png           Disable support for PNG output when the png HID is used [[default=include PNG support]]],
519                 [
520                 if test "X$enable_png" != "Xno" ; then
521                         AC_MSG_RESULT([yes])
522                         with_png=yes
523                 else
524                         AC_MSG_RESULT([no])
525                         with_png=no
526                 fi
527                 ],
528                 [
529                 AC_MSG_RESULT([yes])
530                 with_png=yes
531                 ])
532         if test "X$with_png" = "Xyes" ; then
533                 AC_CHECK_FUNCS(gdImagePng)
534                 if test "$ac_cv_func_gdImagePng" != "yes"; then
535                         AC_MSG_ERROR([Your gd installation does not appear to include PNG support.
536 You may need to update your installation of gd or disable
537 PNG export with --disable-png])
538                 fi
539         fi
540         LIBS="$save_LIBS"
541         ;;
543     esac
544 done
547 AM_CONDITIONAL(PNG, test x$with_png = xyes)
548 AM_CONDITIONAL(GIF, test x$with_gif = xyes)
551 # ------------- Xrender -------------------
552 have_xrender=no
553 AC_CHECK_LIB(Xrender,XRenderQueryExtension,have_xrender=yes,have_xrender=no,$X_LIBS)
555 AC_ARG_ENABLE([xrender],
556 [  --disable-xrender        Compile and link with Xrender [default=yes]])
557 case "$have_xrender:$enable_xrender" in
558    no:* ) ;;
559    *:no ) ;;
560    * )
561      X_LIBS="-lXrender $X_LIBS"
562      AC_DEFINE([HAVE_XRENDER], 1,
563                 [Define to 1 if Xrender is available])
564      ;;
565 esac
567 # ------------- dmalloc -------------------
568 dnl dmalloc checks
569 with_dmalloc=no
570 AC_MSG_CHECKING([if dmalloc debugging should be enabled])
571 AC_ARG_ENABLE([dmalloc],
572 [  --enable-dmalloc        Compile and link with dmalloc for malloc debugging [default=no]],
574 if test "X$enable_dmalloc" != "Xno" ; then
575         AC_MSG_RESULT([yes])
576         AC_CHECK_HEADER(dmalloc.h,,
577                 AC_MSG_ERROR([You have requested dmalloc debugging but dmalloc.h could not be found]))
578         AC_CHECK_LIB(dmalloc,main,,
579                 AC_MSG_ERROR([You have requested dmalloc debugging but -ldmalloc could not be found]))
580         DMALLOC_LIBS="-ldmalloc"
581         with_dmalloc=yes
582 else
583         AC_MSG_RESULT([no])
584         DMALLOC_LIBS=""
588         AC_MSG_RESULT([no])
589         DMALLOC_LIBS=""
592 # ------------- ElectricFence -------------------
593 dnl ElectricFence checks
594 with_efence=no
595 AC_MSG_CHECKING([if ElectricFence debugging should be enabled])
596 AC_ARG_ENABLE([efence],
597 [  --enable-efence         Link with ElectricFence for malloc debugging [default=no]],
599 if test "X$enable_efence" != "Xno" ; then
600         AC_MSG_RESULT([yes])
601         AC_CHECK_LIB(efence,main,,
602                 AC_MSG_ERROR([You have requested ElectricFence debugging but -lefence could not be found]))
603         with_efence=yes
604 else
605         AC_MSG_RESULT([no])
609 AC_MSG_RESULT([no])
612 CFLAGS="$CFLAGS $X_CFLAGS $DBUS_CFLAGS $GTK_CFLAGS"
613 LIBS="$LIBS $XM_LIBS $DBUS_LIBS $X_LIBS $GTK_LIBS $DMALLOC_LIBS $GD_LIBS"
616 # if we have gcc then add -Wall
617 if test "x$GCC" = "xyes"; then
618         if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
619                 CFLAGS="$CFLAGS -Wall"
620         fi
624 # font filename
625 FONTFILENAME=${FONTFILENAME:-"default_font"}
626 AC_SUBST(FONTFILENAME)
627 AC_DEFINE_UNQUOTED(FONTFILENAME,"$FONTFILENAME",[File for default font])
629 # standard autoconf variables
630 CPPFLAGS="$CPPFLAGS -DPREFIXDIR=\\\"\${prefix}\\\""
631 CPPFLAGS="$CPPFLAGS -DBINDIR=\\\"\${bindir}\\\""
632 CPPFLAGS="$CPPFLAGS -DHOST=\\\"\${host}\\\""
634 # directory for old-style library and for fonts
635 PCBLIBDIR=${datadir}/pcb
636 AC_SUBST(PCBLIBDIR)
637 #AC_DEFINE_UNQUOTED(PCBLIBDIR,"$PCBLIBDIR",[Library directory])
638 CPPFLAGS="$CPPFLAGS -DPCBLIBDIR=\\\"$PCBLIBDIR\\\""
640 # name for old-style library
641 LIBRARYFILENAME=pcblib
642 AC_SUBST(LIBRARYFILENAME)
643 AC_DEFINE_UNQUOTED(LIBRARYFILENAME,"$LIBRARYFILENAME",[library file name])
646 # directory for new library
647 PCBTREEDIR=${datadir}/pcb/newlib
648 PCBTREEPATH=${PCBTREEDIR}:${PCBLIBDIR}/pcblib-newlib
649 PCBTREEDIR=${PCBTREEDIR:-"$PCBTREEDIR"}
650 AC_SUBST(PCBTREEDIR)
651 AC_SUBST(PCBTREEPATH)
652 #AC_DEFINE_UNQUOTED(PCBTREEDIR,"$PCBLIB",[top directory for new style pcb library])
653 CPPFLAGS="$CPPFLAGS -DPCBTREEDIR=\\\"$PCBTREEDIR\\\""
654 CPPFLAGS="$CPPFLAGS -DPCBTREEPATH=\\\"$PCBTREEPATH\\\""
656 # Figure out relative paths
657 AC_MSG_CHECKING([for the bindir to pcblibdir relative path])
658 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBLIBDIR:bindir_to_pcblibdir])
659 adl_NORMALIZE_PATH([bindir_to_pcblibdir], [$PCB_DIR_SEPARATOR_S])
660 AC_MSG_RESULT([$bindir_to_pcblibdir])
661 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBLIBDIR, "$bindir_to_pcblibdir", [Relative path from bindir to pcblibdir])
663 AC_MSG_CHECKING([for the bindir to pcbtreedir relative path])
664 adl_COMPUTE_RELATIVE_PATHS([bindir:PCBTREEDIR:bindir_to_pcbtreedir])
665 adl_NORMALIZE_PATH([bindir_to_pcbtreedir], [$PCB_DIR_SEPARATOR_S])
666 AC_MSG_RESULT([$bindir_to_pcbtreedir])
667 AC_DEFINE_UNQUOTED(BINDIR_TO_PCBTREEDIR, "$bindir_to_pcbtreedir", [Relative path from bindir to pcbtreedir])
670 AC_MSG_CHECKING([for the bindir to exec_prefix relative path])
671 adl_COMPUTE_RELATIVE_PATHS([bindir:exec_prefix:bindir_to_execprefix])
672 adl_NORMALIZE_PATH([bindir_to_execprefix], [$PCB_DIR_SEPARATOR_S])
673 AC_MSG_RESULT([$bindir_to_execprefix])
674 AC_DEFINE_UNQUOTED(BINDIR_TO_EXECPREFIX, "$bindir_to_execprefix", [Relative path from bindir to exec_prefix])
677 BTNMOD=${BTNMOD:-"Mod1"}
678 AC_SUBST(BTNMOD)
680 TOPDIRS=
681 for dir in src lib newlib doc example tools tutorial README_FILES
683    test -d $dir/. && TOPDIRS="$TOPDIRS $dir"
684 done
685 AC_SUBST(TOPDIRS)
687 AC_CONFIG_FILES(Makefile)
688 if test -d $srcdir/README_FILES; then
689    AC_CONFIG_FILES(README_FILES/Makefile)
691 if test -d $srcdir/doc; then
692    AC_CONFIG_FILES(doc/Makefile)
694 if test -d $srcdir/example; then
695    AC_CONFIG_FILES(example/Makefile)
696    AC_CONFIG_FILES(example/libraries/Makefile)
698 if test -d $srcdir/lib; then
699    AC_CONFIG_FILES(lib/CreateLibraryContents.sh)
700    AC_CONFIG_FILES(lib/CreateLibrary.sh)
701    AC_CONFIG_FILES(lib/ListLibraryContents.sh)
702    AC_CONFIG_FILES(lib/Makefile)
703    AC_CONFIG_FILES(lib/QueryLibrary.sh)
704    AC_CONFIG_FILES(lib/m4lib_to_newlib.sh)
705    AC_CONFIG_FILES(lib/qfp-ui)
707 if test -d $srcdir/newlib; then
708    AC_CONFIG_FILES(newlib/2_pin_thru-hole_packages/Makefile)
709    AC_CONFIG_FILES(newlib/Makefile)
710    AC_CONFIG_FILES(newlib/analog-devices/Makefile)
711    AC_CONFIG_FILES(newlib/burr-brown/Makefile)
712    AC_CONFIG_FILES(newlib/connectors/Makefile)
713    AC_CONFIG_FILES(newlib/crystal/Makefile)
714    AC_CONFIG_FILES(newlib/electro-optics/Makefile)
715    AC_CONFIG_FILES(newlib/headers/Makefile)
716    AC_CONFIG_FILES(newlib/keystone/Makefile)
717    AC_CONFIG_FILES(newlib/msp430/Makefile)
718    AC_CONFIG_FILES(newlib/not_vetted_ingo/Makefile)
719    AC_CONFIG_FILES(newlib/sockets/Makefile)
720    AC_CONFIG_FILES(newlib/tests/Makefile)
722 AC_CONFIG_FILES(src/Makefile)
723 AC_CONFIG_FILES(src/icons/Makefile)
724 if test -d $srcdir/tools; then
725    AC_CONFIG_FILES(tools/Makefile)
727 if test -d $srcdir/tutorial; then
728    AC_CONFIG_FILES(tutorial/Makefile)
731 AC_CONFIG_FILES(win32/Makefile)
733 AC_OUTPUT
735 with_gui=`echo $with_gui`
736 with_printer=`echo $with_printer`
737 with_exporters=`echo $with_exporters | sed 's/,/ /g'`
739 AC_MSG_RESULT([
740 ** Configuration summary for $PACKAGE $VERSION:
742    GUI:                      $with_gui
743    Printer:                  $with_printer
744    Exporters:                $with_exporters
745    Build documentation:      $docs_yesno
746    dmalloc debugging:        $with_dmalloc
747    ElectricFence debugging:  $with_efence
748    CPPFLAGS:                 $CPPFLAGS
749    CFLAGS:                   $CFLAGS
750    LIBS:                     $LIBS