1 AC_DEFUN([LCD_DRIVERS_SELECT], [
2 AC_CHECKING(for which drivers to compile)
5 [ --enable-drivers=<list> compile drivers for LCDs in <list>,]
6 [ which is a comma-separated list of drivers.]
7 [ Possible drivers are:]
8 [ bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65,]
9 [ EyeboxOne,g15,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,]
10 [ irman,joy,lb216,lcdm001,lcterm,lirc,MD8800,ms6931,]
11 [ mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,sed1330]
12 [ sed1520,serialPOS,serialVFD,sli,stv5730,svga,t6963,text,]
14 [ 'all' compiles all drivers;]
15 [ 'all,!xxx,!yyy' de-selects previously selected drivers],
17 drivers=[bayrad,CFontz,CFontz633,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pyramid,text])
19 allDrivers=[bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,joy,lb216,lcdm001,lcterm,lirc,MD8800,ms6931,mtc_s16209x,MtxOrb,NoritakeVFD,picolcd,pyramid,sed1330,sed1520,serialPOS,serialVFD,sli,stv5730,svga,t6963,text,tyan,ula200,xosd]
21 drivers=`echo $drivers | sed -e 's/,/ /g'`
23 dnl replace special keyword "all" in a secure manner
24 drivers=[" $drivers "]
25 drivers=`echo " $drivers " | sed -e "s/ all,/ ${allDrivers} /"`
26 drivers=`echo " $drivers " | sed -e "s/ all / ${allDrivers} /"`
27 drivers=`echo $drivers | sed -e 's/,/ /g'`
29 dnl ignore unwanted drivers
31 for driver in $drivers ; do
34 driver=`echo "$driver" | sed -e 's/^.//'`
35 selectdrivers=[`echo " $selectdrivers " | sed -r -e "s/ $driver / /g"`]
38 selectdrivers=["$selectdrivers $driver "]
43 dnl check for wanted drivers and their dependencies
44 for driver in $selectdrivers ; do
47 DRIVERS="$DRIVERS bayrad${SO}"
48 actdrivers=["$actdrivers bayrad"]
51 DRIVERS="$DRIVERS CFontz${SO}"
52 actdrivers=["$actdrivers CFontz"]
55 DRIVERS="$DRIVERS CFontz633${SO}"
56 actdrivers=["$actdrivers CFontz633"]
57 AC_CHECK_FUNCS(select, [
58 AC_CHECK_HEADERS(sys/select.h)
60 AC_MSG_WARN([The CFontz633 driver needs the select() function])
64 DRIVERS="$DRIVERS CFontzPacket${SO}"
65 actdrivers=["$actdrivers CFontzPacket"]
66 AC_CHECK_FUNCS(select, [
67 AC_CHECK_HEADERS(sys/select.h)
69 AC_MSG_WARN([The CFontzPacket driver needs the select() function])
73 AC_CHECK_HEADERS(ncurses.h curses.h)
74 AC_CHECK_LIB(ncurses, main, [
75 AC_CHECK_HEADER(ncurses.h, [
76 dnl We have ncurses.h and libncurses, add driver.
78 DRIVERS="$DRIVERS curses${SO}"
79 actdrivers=["$actdrivers curses"]
82 AC_MSG_WARN([Could not find ncurses.h])],
86 AC_CHECK_LIB(curses, main, [
87 AC_CHECK_HEADER(curses.h, [
88 dnl We have curses.h and libcurses, add driver.
90 DRIVERS="$DRIVERS curses${SO}"
91 actdrivers=["$actdrivers curses"]
94 AC_MSG_WARN([Could not find curses.h])],
98 AC_MSG_WARN([The curses driver needs the curses (or ncurses) library.])],
104 AC_CACHE_CHECK([for redrawwin() in curses], ac_cv_curses_redrawwin,
106 LIBS="$LIBS $LIBCURSES"
107 AC_TRY_LINK_FUNC(redrawwin, ac_cv_curses_redrawwin=yes, ac_cv_curses_redrawwin=no)
110 if test "$ac_cv_curses_redrawwin" = yes; then
111 AC_DEFINE(CURSES_HAS_REDRAWWIN,[1],[Define to 1 if you have the redrawwin function in the curses library])
114 AC_CACHE_CHECK([for wcolor_set() in curses], ac_cv_curses_wcolor_set,
116 LIBS="$LIBS $LIBCURSES"
117 AC_TRY_LINK_FUNC(wcolor_set, ac_cv_curses_wcolor_set=yes, ac_cv_curses_wcolor_set=no)
120 if test "$ac_cv_curses_wcolor_set" = yes; then
121 AC_DEFINE(CURSES_HAS_WCOLOR_SET,[1],[Define to 1 if you have the wcolor_set function in the curses library])
125 DRIVERS="$DRIVERS CwLnx${SO}"
126 actdrivers=["$actdrivers CwLnx"]
129 DRIVERS="$DRIVERS ea65${SO}"
130 actdrivers=["$actdrivers ea65"]
133 DRIVERS="$DRIVERS EyeboxOne${SO}"
134 actdrivers=["$actdrivers EyeboxOne"]
137 AC_CHECK_HEADERS([g15daemon_client.h],[
138 AC_CHECK_LIB(g15daemon_client, new_g15_screen,[
139 LIBG15="-lg15daemon_client"
142 AC_MSG_WARN([The g15 driver needs libg15daemon_client-1.2 or better])
148 AC_MSG_WARN([The g15 driver needs g15daemon_client.h])
150 AC_CHECK_HEADERS([libg15render.h],[
151 AC_CHECK_LIB(g15render, g15r_initCanvas,[
152 LIBG15="$LIBG15 -lg15render"
153 DRIVERS="$DRIVERS g15${SO}"
154 actdrivers=["$actdrivers g15"]
157 AC_MSG_WARN([the g15 driver needs libg15render])
163 AC_MSG_WARN([The g15driver needs libg15render.h])
167 AC_CHECK_HEADERS([glcdproclib/glcdprocdriver.h],[
168 AC_CHECK_LIB(glcdprocdriver, main,[
169 LIBGLCD="-lglcddrivers -lglcdgraphics -lglcdprocdriver"
170 DRIVERS="$DRIVERS glcdlib${SO}"
171 actdrivers=["$actdrivers glcdlib"]
174 AC_MSG_WARN([The glcdlib driver needs the glcdprocdriver library])
176 [-lglcddrivers -lglcdgraphics -lglcdprocdriver]
180 AC_MSG_WARN([The glcdlib driver needs glcdproclib/glcdprocdriver.h])
184 DRIVERS="$DRIVERS glk${SO}"
185 actdrivers=["$actdrivers glk"]
188 HD44780_DRIVERS="hd44780-hd44780-serial.o hd44780-hd44780-lis2.o"
189 if test "$ac_cv_port_have_lpt" = yes ; then
190 HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-4bit.o hd44780-hd44780-ext8bit.o hd44780-lcd_sem.o hd44780-hd44780-winamp.o hd44780-hd44780-serialLpt.o"
192 if test "$enable_libusb" = yes ; then
193 HD44780_DRIVERS="$HD44780_DRIVERS hd44780-hd44780-bwct-usb.o hd44780-hd44780-lcd2usb.o"
195 AC_CHECK_HEADER(linux/i2c-dev.h,
196 HD44780_DRIVERS="$HD44780_DRIVERS hd44780-i2c.o"
197 AC_DEFINE(HAVE_I2C,[1],[Define to 1 if you have the i2c headers])
199 DRIVERS="$DRIVERS hd44780${SO}"
200 actdrivers=["$actdrivers hd44780"]
203 DRIVERS="$DRIVERS icp_a106${SO}"
204 actdrivers=["$actdrivers icp_a106"]
207 DRIVERS="$DRIVERS imon${SO}"
208 actdrivers=["$actdrivers imon"]
211 if test "$enable_libusb" = yes ; then
212 DRIVERS="$DRIVERS IOWarrior${SO}"
213 actdrivers=["$actdrivers IOWarrior"]
215 AC_MSG_WARN([The IOWarrior driver needs the libusb library.])
219 AC_CHECK_LIB(irman, main,[
221 DRIVERS="$DRIVERS irman${SO}"
222 actdrivers=["$actdrivers irman"]
225 AC_MSG_WARN([The irman driver needs the irman library.])
229 AC_CHECK_HEADER(linux/joystick.h, [
230 DRIVERS="$DRIVERS joy${SO}"
231 actdrivers=["$actdrivers joy"]
234 AC_MSG_WARN([The joy driver needs header file linux/joystick.h.])
238 DRIVERS="$DRIVERS lb216${SO}"
239 actdrivers=["$actdrivers lb216"]
242 DRIVERS="$DRIVERS lcdm001${SO}"
243 actdrivers=["$actdrivers lcdm001"]
246 DRIVERS="$DRIVERS lcterm${SO}"
247 actdrivers=["$actdrivers lcterm"]
250 AC_CHECK_LIB(lirc_client, main,[
251 LIBLIRC_CLIENT="-llirc_client"
252 DRIVERS="$DRIVERS lirc${SO}"
253 actdrivers=["$actdrivers lirc"]
256 AC_MSG_WARN([The lirc driver needs the lirc client library])
260 DRIVERS="$DRIVERS MD8800${SO}"
261 actdrivers=["$actdrivers MD8800"]
264 DRIVERS="$DRIVERS ms6931${SO}"
265 actdrivers=["$actdrivers ms6931"]
268 DRIVERS="$DRIVERS mtc_s16209x${SO}"
269 actdrivers=["$actdrivers mtc_s16209x"]
272 DRIVERS="$DRIVERS MtxOrb${SO}"
273 actdrivers=["$actdrivers MtxOrb"]
276 DRIVERS="$DRIVERS NoritakeVFD${SO}"
277 actdrivers=["$actdrivers NoritakeVFD"]
280 AC_CHECK_HEADERS([usblcd.h],[
281 AC_CHECK_LIB(usblcd, main,[
283 DRIVERS="$DRIVERS picolcd${SO}"
284 actdrivers=["$actdrivers picolcd"]
287 AC_MSG_WARN([The picolcd driver needs the usblcd library])
293 AC_MSG_WARN([The picolcd driver needs widgets.h, usblcd.h and usblcd_util.h from the usblcd package])
297 DRIVERS="$DRIVERS pyramid${SO}"
298 actdrivers=["$actdrivers pyramid"]
301 if test "$ac_cv_port_have_lpt" = yes
303 DRIVERS="$DRIVERS sed1330${SO}"
304 actdrivers=["$actdrivers sed1330"]
306 AC_MSG_WARN([The sed1330 driver needs a parallel port.])
310 if test "$ac_cv_port_have_lpt" = yes
312 DRIVERS="$DRIVERS sed1520${SO}"
313 actdrivers=["$actdrivers sed1520"]
315 AC_MSG_WARN([The sed1520 driver needs a parallel port.])
319 DRIVERS="$DRIVERS serialPOS${SO}"
320 actdrivers=["$actdrivers serialPOS"]
323 DRIVERS="$DRIVERS serialVFD${SO}"
324 actdrivers=["$actdrivers serialVFD"]
327 DRIVERS="$DRIVERS sli${SO}"
328 actdrivers=["$actdrivers sli"]
331 if test "$ac_cv_port_have_lpt" = yes
333 DRIVERS="$DRIVERS stv5730${SO}"
334 actdrivers=["$actdrivers stv5730"]
336 AC_MSG_WARN([The stv5730 driver needs a parallel port.])
340 AC_CHECK_HEADERS([vga.h vgagl.h],[
341 AC_CHECK_LIB(vga, main,[
342 LIBSVGA="-lvga -lvgagl"
343 DRIVERS="$DRIVERS svga${SO}"
344 actdrivers=["$actdrivers svga"]
347 AC_MSG_WARN([The svga driver needs the vga library])
351 AC_MSG_WARN([The svga driver needs vga.h and vgagl.h])
355 if test "$ac_cv_port_have_lpt" = yes
357 DRIVERS="$DRIVERS t6963${SO}"
358 actdrivers=["$actdrivers t6963"]
360 AC_MSG_WARN([The sed1330 driver needs a parallel port.])
364 DRIVERS="$DRIVERS text${SO}"
365 actdrivers=["$actdrivers text"]
368 DRIVERS="$DRIVERS tyan${SO}"
369 actdrivers=["$actdrivers tyan"]
372 AC_CHECK_HEADERS([usb.h ftdi.h],[
373 AC_CHECK_LIB(ftdi, ftdi_set_line_property,[
374 LIBFTDI="-lusb -lftdi"
375 DRIVERS="$DRIVERS ula200${SO}"
376 actdrivers=["$actdrivers ula200"]
379 AC_MSG_WARN([The ula200 driver needs the ftdi library in version 0.7])
383 AC_MSG_WARN([The ula200 driver needs ftdi.h and usb.h])
387 AC_CHECK_HEADERS([xosd.h],[
388 AC_CHECK_LIB(xosd, main,[
389 LIBXOSD=`xosd-config --libs`
390 DRIVERS="$DRIVERS xosd${SO}"
391 actdrivers=["$actdrivers xosd"]
394 AC_MSG_WARN([The xosd driver needs the xosd library])
398 AC_MSG_WARN([The xosd driver needs xosd.h])
402 AC_MSG_ERROR([Unknown driver $driver])
407 actdrivers=`echo $actdrivers | sed -e 's/ /,/g'`
408 AC_MSG_RESULT([Will compile drivers: $actdrivers])
412 AC_SUBST(LIBLIRC_CLIENT)
415 AC_SUBST(HD44780_DRIVERS)
425 dnl Curses test to check if we use _acs_char* or acs_map*
427 AC_DEFUN([AC_CURSES_ACS_ARRAY], [
428 AC_CACHE_CHECK([for acs_map in curses.h], ac_cv_curses_acs_map,
429 [AC_TRY_COMPILE([#include <curses.h>], [ char map = acs_map['p'] ], ac_cv_curses_acs_map=yes, ac_cv_curses_acs_map=no)])
431 if test "$ac_cv_curses_acs_map" = yes
433 AC_DEFINE(CURSES_HAS_ACS_MAP,[1],[Define to 1 if <curses.h> defines the acs_map array])
436 AC_CACHE_CHECK([for _acs_char in curses.h], ac_cv_curses__acs_char,
437 [AC_TRY_COMPILE([#include <curses.h>], [ char map = _acs_char['p'] ], ac_cv_curses__acs_char=yes, ac_cv_curses__acs_char=no)])
439 if test "$ac_cv_curses__acs_char" = yes
441 AC_DEFINE(CURSES_HAS__ACS_CHAR,[1],[Define to 1 if <curses.h> defines the _acs_char array])
448 dnl Find out where is the mounted filesystem table
451 AC_DEFUN([AC_FIND_MTAB_FILE], [
452 AC_CACHE_CHECK([for your mounted filesystem table], ac_cv_mtab_file, [
454 if test -f "/etc/mtab"; then
455 ac_cv_mtab_file=/etc/mtab
458 if test -f "/etc/mnttab"; then
459 ac_cv_mtab_file=/etc/mnttab
462 if test -f "/etc/fstab"; then
463 ac_cv_mtab_file=/etc/fstab
468 if test ! -z "$ac_cv_mtab_file"; then
469 AC_DEFINE_UNQUOTED([MTAB_FILE], ["$ac_cv_mtab_file"], [Location of your mounted filesystem table file])
474 dnl Filesystem information detection
476 dnl To get information about the disk, mount points, etc.
478 dnl This code is stolen from mc-4.5.41, which in turn has stolen it
479 dnl from GNU fileutils-3.12.
482 AC_DEFUN([AC_GET_FS_INFO], [
483 AC_CHECK_HEADERS(fcntl.h sys/dustat.h sys/param.h sys/statfs.h sys/fstyp.h)
484 AC_CHECK_HEADERS(mnttab.h mntent.h utime.h sys/statvfs.h sys/vfs.h)
485 AC_CHECK_HEADERS(sys/filsys.h sys/fs_types.h)
486 AC_CHECK_HEADERS(sys/mount.h, [], [],
487 [#if HAVE_SYS_PARAM_H
488 #include <sys/param.h>
491 AC_CHECK_FUNCS(getmntinfo)
493 AC_CHECKING(how to get filesystem space usage)
496 # Here we'll compromise a little (and perform only the link test)
497 # since it seems there are no variants of the statvfs function.
498 if test $space = no; then
500 AC_CHECK_FUNCS(statvfs)
501 if test $ac_cv_func_statvfs = yes; then
503 AC_DEFINE(STAT_STATVFS,[1],[Define to 1 if you have the statvfs function])
507 if test $space = no; then
508 # DEC Alpha running OSF/1
509 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
510 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
512 #include <sys/param.h>
513 #include <sys/types.h>
514 #include <sys/mount.h>
519 exit (statfs (".", &fsd, sizeof (struct statfs)));
521 fu_cv_sys_stat_statfs3_osf1=yes,
522 fu_cv_sys_stat_statfs3_osf1=no,
523 fu_cv_sys_stat_statfs3_osf1=no)])
524 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
525 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
527 AC_DEFINE(STAT_STATFS3_OSF1,[1],[Define to 1 if you have the 3-argument statfs function (DEC OSF/1)])
531 if test $space = no; then
533 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)])
534 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
536 #ifdef HAVE_SYS_PARAM_H
537 #include <sys/param.h>
539 #ifdef HAVE_SYS_MOUNT_H
540 #include <sys/mount.h>
542 #ifdef HAVE_SYS_VFS_H
549 exit (statfs (".", &fsd));
551 fu_cv_sys_stat_statfs2_bsize=yes,
552 fu_cv_sys_stat_statfs2_bsize=no,
553 fu_cv_sys_stat_statfs2_bsize=no)])
554 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
555 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
557 AC_DEFINE(STAT_STATFS2_BSIZE,[1],[Define to 1 if you have the two-argument statfs function with statfs.bsize member (AIX, 4.3BSD)])
561 if test $space = no; then
563 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
564 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
565 [AC_TRY_RUN([#include <sys/types.h>
566 #include <sys/statfs.h>
570 exit (statfs (".", &fsd, sizeof fsd, 0));
572 fu_cv_sys_stat_statfs4=yes,
573 fu_cv_sys_stat_statfs4=no,
574 fu_cv_sys_stat_statfs4=no)])
575 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
576 if test $fu_cv_sys_stat_statfs4 = yes; then
578 AC_DEFINE(STAT_STATFS4,[1],[Define to 1 if you have the four-argument statfs function (AIX-3.2.5, SVR3)])
581 if test $space = no; then
583 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
584 member (4.4BSD and NetBSD)])
585 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
586 [AC_TRY_RUN([#include <sys/types.h>
587 #ifdef HAVE_SYS_PARAM_H
588 #include <sys/param.h>
590 #ifdef HAVE_SYS_MOUNT_H
591 #include <sys/mount.h>
597 exit (statfs (".", &fsd));
599 fu_cv_sys_stat_statfs2_fsize=yes,
600 fu_cv_sys_stat_statfs2_fsize=no,
601 fu_cv_sys_stat_statfs2_fsize=no)])
602 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
603 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
605 AC_DEFINE(STAT_STATFS2_FSIZE,[1],[Define to 1 if you have the two-argument statfs function with statfs.fsize member (4.4BSD and NetBSD)])
609 if test $space = no; then
611 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
612 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
614 #include <sys/types.h>
615 #ifdef HAVE_SYS_PARAM_H
616 #include <sys/param.h>
618 #ifdef HAVE_SYS_MOUNT_H
619 #include <sys/mount.h>
621 #ifdef HAVE_SYS_FS_TYPES_H
622 #include <sys/fs_types.h>
627 /* Ultrix's statfs returns 1 for success,
628 0 for not mounted, -1 for failure. */
629 exit (statfs (".", &fsd) != 1);
631 fu_cv_sys_stat_fs_data=yes,
632 fu_cv_sys_stat_fs_data=no,
633 fu_cv_sys_stat_fs_data=no)])
634 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
635 if test $fu_cv_sys_stat_fs_data = yes; then
637 AC_DEFINE(STAT_STATFS2_FS_DATA,[1],[Define to 1 if you have the two-argument statfs function with struct fs_data (Ultrix)])
642 dnl if test $space = no; then
644 dnl AC_TRY_CPP([#include <sys/filsys.h>],
645 dnl AC_DEFINE(STAT_READ_FILSYS) space=yes)
649 dnl 1.1 (2001/07/26) -- Miscellaneous @ ac-archive-0.5.32
650 dnl Warren Young <warren@etr-usa.com>
651 dnl This macro checks for the SysV IPC header files. It only checks
652 dnl that you can compile a program with them, not whether the system
653 dnl actually implements working SysV IPC.
654 dnl http://ac-archive.sourceforge.net/Miscellaneous/etr_sysv_ipc.html
655 AC_DEFUN([ETR_SYSV_IPC],
657 AC_CACHE_CHECK([for System V IPC headers], ac_cv_sysv_ipc, [
660 #include <sys/types.h>
665 ],, ac_cv_sysv_ipc=yes, ac_cv_sysv_ipc=no)
668 if test x"$ac_cv_sysv_ipc" = "xyes"
670 AC_DEFINE(HAVE_SYSV_IPC, 1, [ Define if you have System V IPC ])
674 dnl 1.1 (2001/07/26) -- Miscellaneous @ ac-archive-0.5.32
675 dnl Warren Young <warren@etr-usa.com>
676 dnl This macro checks to see if sys/sem.h defines union semun. Some
677 dnl systems do, some systems don't. Your code must be able to deal with
678 dnl this possibility; if HAVE_STRUCT_SEMUM isn't defined for a given system,
679 dnl you have to define this structure before you can call functions
681 dnl You should call ETR_SYSV_IPC before this macro, to separate the check
682 dnl for System V IPC headers from the check for struct semun.
683 dnl http://ac-archive.sourceforge.net/Miscellaneous/etr_struct_semun.html
684 AC_DEFUN([ETR_UNION_SEMUN],
686 AC_CACHE_CHECK([for union semun], ac_cv_union_semun, [
689 #include <sys/types.h>
694 ac_cv_union_semun=yes,
695 ac_cv_union_semun=no)
698 if test x"$ac_cv_union_semun" = "xyes"
700 AC_DEFINE(HAVE_UNION_SEMUN, 1,
701 [ Define if your system's sys/sem.h file defines union semun ])
703 ]) dnl ETR_UNION_SEMUN
705 dnl Loadable modules determination.
706 dnl Joris Robijn, 2002
707 dnl I choose not to use libtool.
708 dnl If your platform does not compile or link the modules correctly, add
709 dnl appropriate flags here.
710 AC_DEFUN([AC_MODULES_INFO],
712 dnl $SO is the extension of shared libraries (including the dot!)
713 dnl It is available in the program code as MODULE_EXTENSION
714 AC_MSG_CHECKING(module extension)
723 AC_DEFINE_UNQUOTED(MODULE_EXTENSION,"$SO",[Set to the extension for dynamically loaded modules])
726 dnl CCSHARED are the flags used to compile the sources for the shared library
727 dnl LDSHARED are the flags used to create shared library.
729 dnl By default assume a GNU compatible build system
732 dnl Now override flags that should be different
738 if test ! "$GCC" = "yes" ; then
743 if test ! "$GCC" = "yes"; then
749 CCSHARED="-DUSE_DL_IMPORT"
750 LDSHARED="-shared -Wl,--enable-auto-image-base"
756 LDSHARED="-bundle -flat_namespace -undefined suppress"
760 dnl checks for libraries
761 AC_CHECK_LIB(dl, dlopen) # Dynamic linking for Linux, *BSD, SunOS/Solaris and SYSV
762 AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
767 dnl End of loadable modules determination
768 ]) dnl AC_MODULES_INFO
770 dnl stolen from cppunit project (http://cppunit.sourceforge.net/)
771 AC_DEFUN([BB_ENABLE_DOXYGEN],
773 AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)])
774 AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
775 AC_ARG_ENABLE(html-dox, [ --enable-html-dox enable HTML generation with doxygen (yes)], [], [ enable_html_dox=yes])
776 AC_ARG_ENABLE(latex-dox, [ --enable-latex-dox enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_dox=no])
777 if test "x$enable_doxygen" = xno; then
780 AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
781 if test "x$DOXYGEN" = x; then
782 if test "x$enable_doxygen" = xyes; then
783 AC_MSG_ERROR([could not find doxygen])
788 AC_PATH_PROG(DOT, dot, , $PATH)
791 AM_CONDITIONAL(DOX, test x$enable_dox = xyes)
793 if test x$DOT = x; then
794 if test "x$enable_dot" = xyes; then
795 AC_MSG_ERROR([could not find dot])
802 AC_SUBST(enable_html_dox)
803 AC_SUBST(enable_latex_dox)
806 dnl From: http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
807 dnl Author: Guido Draheim <guidod@gmx.de>
808 dnl Last Modified: 2003-11-04
809 AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
810 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
811 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl
812 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
813 VAR,[VAR="no, unknown"
816 ac_save_[]FLAGS="$[]FLAGS"
818 in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
820 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
821 AC_TRY_COMPILE([],[return 0;],
822 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
824 FLAGS="$ac_save_[]FLAGS"
828 .ok|.ok,*) m4_ifvaln($3,$3) ;;
829 .|.no|.no,*) m4_ifvaln($4,$4) ;;
831 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
832 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
833 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
834 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
837 AS_VAR_POPDEF([VAR])dnl
838 AS_VAR_POPDEF([FLAGS])dnl
842 dnl the only difference - the LANG selection... and the default FLAGS
844 AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl
845 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
846 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
847 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
848 VAR,[VAR="no, unknown"
851 ac_save_[]FLAGS="$[]FLAGS"
853 in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
855 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
856 AC_TRY_COMPILE([],[return 0;],
857 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
859 FLAGS="$ac_save_[]FLAGS"
863 .ok|.ok,*) m4_ifvaln($3,$3) ;;
864 .|.no|.no,*) m4_ifvaln($4,$4) ;;
866 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
867 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
868 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
869 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
872 AS_VAR_POPDEF([VAR])dnl
873 AS_VAR_POPDEF([FLAGS])dnl
876 dnl -------------------------------------------------------------------------
878 AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl
879 AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
880 AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl
881 AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
882 VAR,[VAR="no, unknown"
885 ac_save_[]FLAGS="$[]FLAGS"
887 in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
889 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
890 AC_TRY_COMPILE([],[return 0;],
891 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
893 FLAGS="$ac_save_[]FLAGS"
897 .ok|.ok,*) m4_ifvaln($3,$3) ;;
898 .|.no|.no,*) m4_ifvaln($4,$4) ;;
900 if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
901 then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
902 else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
903 m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
906 AS_VAR_POPDEF([VAR])dnl
907 AS_VAR_POPDEF([FLAGS])dnl
911 dnl the only difference - the LANG selection... and the default FLAGS
913 AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl
914 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
915 AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
916 AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
917 VAR,[VAR="no, unknown"
920 ac_save_[]FLAGS="$[]FLAGS"
922 in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
924 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
925 AC_TRY_COMPILE([],[return 0;],
926 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
928 FLAGS="$ac_save_[]FLAGS"
932 .ok|.ok,*) m4_ifvaln($3,$3) ;;
933 .|.no|.no,*) m4_ifvaln($4,$4) ;;
935 if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
936 then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR])
937 else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"])
938 m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"
941 AS_VAR_POPDEF([VAR])dnl
942 AS_VAR_POPDEF([FLAGS])dnl
945 AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
946 [AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])])
948 AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1,
949 [AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])])