diff options
Diffstat (limited to '')
205 files changed, 40480 insertions, 4454 deletions
diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..b1ab72c --- /dev/null +++ b/.cvsignore @@ -0,0 +1,9 @@ +Makefile +.deps +autom4te.cache +config.h +config.log +config.status +lcd4linux +stamp-h1 +smoketest.log @@ -1,5 +1,5 @@ # $Id: AUTHORS 730 2007-01-14 13:50:28Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/AUTHORS $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/AUTHORS $ Sorry, there is no AUTHORS anymore. Go to http://lcd4linux.bulix.org for a list of developers an contributors. @@ -1,4 +1,4 @@ $Id: CREDITS 730 2007-01-14 13:50:28Z michael $ -$URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/CREDITS $ +$URL: https://ssl.bulix.org/svn/lcd4linux/trunk/CREDITS $ see http://lcd4linux.bulix.org for an up-to-date list of contributors! @@ -1,523 +1,954 @@ +2009-01-14 michael + + * [r964] + add support for Dell M1730 LCD to the G15 driver by + lcd4linux@hayward.uk.com + + * [r963] + initial brightness fixed + +2009-01-13 volker + + * [r962] + indentation, svn-version + + * [r961] + speedup X11 display + +2009-01-13 michael + + * [r960] + new example for X11 config + + * [r959] + heavy X11 reorganization to (hopefully) finally fix Tickets #141 + and #117 + + * [r958] + list sub-drivers for serdisplib without -v + + * [r957] + moved 'print list of drivers and plugins' to the end of configure + +2009-01-12 michux + + * [r956] + update copyright + +2009-01-12 volker + + * [r955] + additional verbose messages + +2009-01-12 michux + + * [r954] + fix some compiler warnings + +2009-01-11 michux + + * [r953] + plugin_fifo: fix compile warnings + + * [r952] + drv_st2205u: add verbose error message + +2009-01-09 volker + + * [r951] + version of linked serdisplib in long verbose output + +2009-01-08 michael + + * [r950] + hhdtemp plugin fixed + +2009-01-06 michael + + * [r949] + hddtemp autconf bug fixed + + * [r948] + compiler warnings fixed + + * [r947] + indentation + + * [r946] + unused array 'tokenNames' removed + + * [r945] + compiler warning removed + + * [r944] + initialize plugin on first use + + * [r943] + indentation + + * [r942] + initialize fifo on first use + + * [r941] + cosmetics + +2009-01-04 michael + + * [r940] + new string operators eq ne gt ge lt le + + * [r939] + indentation + + * [r938] + typo fixed + + * [r937] + disable unimplemented ioctls + +2009-01-01 michael + + * [r936] + distcheck bugs fixed + + * [r935] + button debugging changed + + * [r934] + widget_bar scale debugging changed + +2008-12-31 michux + + * [r933] + add buttons to X11 sample conf + +2008-12-31 michael + + * [r932] + clear pixel to BG_COL (Ticket #117) + + * [r931] + version bumped to 0.11.0 + + * [r930] + netinfo plugin added to smoketest + + * [r929] + ported r847 (new Display CW12832 128x32) from volker_dev + + * [r928] + ported r846 from volker_dev + + * [r927] + ported r839 from volker_dev + + * [r926] + ported r838 from volker_dev + + * [r925] + ported r837 from volker_dev + + * [r924] + ported r835 from volker_dev + + * [r923] + ported r834 from volker_dev + + * [r922] + r828: 'additional verbose and info messages' ported from + volker_dev + + * [r921] + includes for umask() ported from volker_dev (r827) + + * [r920] + handle config files with <CR><LF> (DOS line ending) ported from + volker_dev (r826) + + * [r919] + netinfo plugin ported from volker_dev (r823) + + * [r918] + format characters in qprintf() with optional length (r821) ported + from volker_dev + + * [r917] + short circuit evaluation ported from volker_dev (r820,r822,r824) + + * [r916] + Fixes a buffer underrun error and possible array index issues by + mcarey@... + +2008-12-27 michael + + * [r915] + ported r819 from volker_dev + + * [r914] + ported and modified r818 from volker_dev + + * [r913] + port r817 from volker_dev + + * [r912] + ported (modified) r815 from voker_dev + +2008-12-24 michael + + * [r911] + cleanup & cosmetics + + * [r910] + driver for the PHAnderson serial-to-HD44780 adapter boards by + Nicolas Weill + + * [r909] + w1retap plugin by Jonathan Hudson + + * [r908] + Enables/controls the backlight on the Pertelian LCD device by + Jonathan Hudson + +2008-12-23 michael + + * [r907] + hddtemp plugin from Scott Bronson + + * [r906] + keypad bug fixed + + * [r905] + patch from a.nielsen: inverted parport signals, support GPI on + HD44780 + + * [r904] + indent run + +2008-11-25 michux + + * [r903] + fix lcd4linux driver for multible onboard controllers + +2008-11-23 michux + + * [r902] + fix automake - check for libftdi + +2008-11-22 michux + + * [r901] + update button_exec plugin - fix segfault + + * [r900] + update fifo plugin - untested + +2008-10-07 bwalle + + * [r899] + Replace write to external variable usb_debug by calling + usb_set_debug(). + This fixes build on openSUSE Factory. + +2008-10-06 michael + + * [r898] + adding GPI to picoLCD for reading button events by Igor Mammedov + <niallain@gmail.com> + + * [r897] + properties fixed + +2008-10-05 bwalle + + * [r896] + Rebuild auto-generated autoconf stuff due to last change in + drivers.m4. + + * [r895] + Add 'ULA200' driver when --with-drivers=all is specified + +2008-09-14 michael + + * [r894] + strftime_tz patch from Bernhard Walle + +2008-09-08 michael + + * [r893] + strftime_tz() plugin by Bernhard Walle + +2008-09-03 michael + + * [r892] + ULA200 driver by Bernhard Walle + + * [r891] + indent + +2008-08-31 sonic74 + + * [r890] + Increased the maximum bps to 230400, if defined in <termios.h>. + +2008-08-27 sonic74 + + * [r889] + + +2008-08-27 michael + + * [r888] + D4D updates by Sven + +2008-08-03 michael + + * [r887] + driver for 4D Systems serial displays by Sven Killig + + * [r886] + signed/unsigned mismatch + +2008-07-26 michux + + * [r885] + added command functions + +2008-07-15 michael + + * [r884] + added IRLCD driver by Jean-Philippe Civade + + * [r883] + 'autoreconf -f -i' run & config.rpath added + + * [r882] + forgot to add drv_picoLCDGraphic.c :-( + + * [r881] + picoLCDGraphic driver by Nicu Pavel added + + * [r880] + widget_keypad.h added to drv_HD44780 + + * [r879] + indent run + + * [r878] + automake-1.10.1 + +2008-04-15 michux + + * [r877] + forgot include + + * [r876] + add signal handler, improve error check + +2008-04-14 michux + + * [r875] + minor update + +2008-04-12 michux + + * [r874] + Makefiles again, this time libiconv stuff is fixed + + * [r873] + fix error, introduced in r857 + + * [r872] + update Makefiles + + * [r871] + clean up + +2008-04-10 michux + + * [r870] + Add the year 2008 to the copyright + + * [r869] + Add basic FIFO plugin + +2008-04-04 michux + + * [r868] + fixed autoconf + + * [r867] + update autoconf + + * [r866] + Add asterisk plugin, thanks to mcarey@yostengineering.com + +2008-04-03 michux + + * [r865] + fix typo, close #114 + + * [r864] + update charset for Crystalfontz Model 632 and 634 + +2008-03-05 michux + + * [r863] + improve error messages + +2008-03-03 michux + + * [r862] + reformat plugin_mpd - use c style comments + + * [r861] + correct code format (indent) + + * [r860] + correct code format (indent) + + * [r859] + new plugin: button_exec by Wolfgang Henerbichler + + * [r858] + add new driver (st2205) by Jeroen/Sprite_tm + + * [r857] + new plugin: button_exec by Wolfgang Henerbichler + + * [r856] + add keypad support for module lcm162 + + * [r855] + add new driver (st2205) by Jeroen/Sprite_tm + +2008-02-27 michux + + * [r854] + add signal handler to plugin_mpd + + * [r853] + plugin_mpd, update to v0.81, fix connection issues + +2008-02-25 michux + + * [r852] + update mpd plugin to v0.8 - makefile needs some work now + +2008-01-28 michux + + * [r851] + disable default emulator code + + * [r850] + minor updates + + * [r849] + added pingpong scrolling + +2008-01-24 michux + + * [r848] + + +2007-10-17 volker + + * [r847] + added new display 128x32 (CW12832) + + * [r846] + info about property change + +2007-10-03 michael + + * [r845] + automatic marquee patch from Manuel Grot + +2007-10-01 michael + + * [r844] + RDTSC delay and inclusion of asm/msr.h removed + + * [r843] + driver for Pertelian display by Andy Powell + +2007-09-15 michael + + * [r842] + GPS plugin V0.3 by michu + + * [r841] + GPS plugin V0.2 by michu + +2007-09-09 michael + + * [r840] + email address changed + +2007-08-25 volker + + * [r839] + additional information about decision which plugin and drivers + are included via configure + +2007-08-23 volker + + * [r838] + existence of netdevice corrected (less cpu load) + + * [r837] + logging info clarified + + * [r836] + Indentation + +2007-08-13 volker + + * [r835] + Absicherung gegen Abfragen nicht vorhandener Daten + + * [r834] + erweiterte Ausgabe bei Daten ueber unterstuetzte Hardware + +2007-07-27 michael + + * [r833] + Fix compilation with kernel 2.6.22 by Guillaume LECERF + + * [r832] + MPD plugin patch from michu + + * [r831] + GPS plugin update by michu + + * [r830] + indentation + +2007-07-12 volker + + * [r829] + svn version updated + + * [r828] + additional verbose and info messages + +2007-07-08 volker + + * [r827] + includes for umask(); svnversion updated + +2007-06-27 volker + + * [r826] + handle config files with <CR><LF> (DOS line ending) + + * [r825] + added plugin_netdev + + * [r824] + copy&paste error corrected + + * [r823] + new plugin: netinfo + + * [r822] + indentation with ./indent.sh; short circuit evaluation modified + +2007-06-25 volker + + * [r821] + format characters in qprintf() with optional length + + * [r820] + calculate only necessary elements of operands + +2007-06-24 volker + + * [r819] + optimization on changing brightness of backlight + +2007-06-22 volker + + * [r818] + list plugins + + * [r817] + disable plugins where preconditions not given: compiles mostly + under MacOS X + + * [r816] + keypad support added for X11 driver + +2007-06-21 volker + + * [r815] + optimized layer drawing (no drawing under opaque pixel) + + * [r814] + LCD::brightness, keypad + + * [r813] + default for Brightness is 255 + +2007-06-20 volker + + * [r812] + LCD::brightness in drv_X11 corrected + + * [r811] + development of new experimental features + + * [r810] + global variable for backlight color + + * [r809] + keypad support completed; new property brightness implemented + + * [r808] + maximum value for brightness is 8 + +2007-06-17 michael + + * [r807] + buttons for X11 driver (thanks to Volker Gering) + + * [r806] + Apple has no utsbuf.domainname (thanks to Volker Gering) + + * [r805] + strndup() replacement + + * [r804] + better usage output by Volker Gering + +2007-06-08 michael + + * [r803] + Image driver libgd dependancy fix + +2007-06-04 michael + + * [r802] + big MPD patch from Robert Buchholz + +2007-05-19 michael + + * [r801] + gps plugin, code by michu / www.neophob.com + +2007-05-17 michael + + * [r800] + backported r799 from trunk + + * [r799] + compile error on m68k fixed (debian bug 405898) + +2007-05-04 michael + + * [r798] + typo in LUIse driver fixed + +2007-05-02 michael + + * [r797] + some compiler warnings fixed + 2007-04-30 michael - * [r794] svn2cl.sh, trunk/svn2cl.sh: + * [r796] + LCD4Linux-0.10.1-RC2 + + * [r795] + ChangeLog updated + + * [r794] svn2cl moved and optimized - * [r793] trunk/svn2cl.sh: + * [r793] svn2cl.sh added - * [r792] branches/0.10.1/configure, branches/0.10.1/drivers.m4: + * [r792] port r791 from trunk - * [r791] trunk/configure, trunk/drivers.m4: + * [r791] link Cwlinux with keypad support - * [r790] branches/0.10.1/plugin_imon.c: + * [r790] ported r777 from trunk - * [r789] branches/0.10.1/drv_Cwlinux.c, - branches/0.10.1/plugin_mpd.c, branches/0.10.1/plugin_proc_stat.c, - branches/0.10.1/udelay.c, branches/0.10.1/widget_bar.c: + * [r789] ported r784-r788 from trunk 2007-04-28 michael - * [r788] trunk/widget_bar.c: + * [r788] patch from Fox: Fix a typo that prevent Bar display to work - * [r787] trunk/udelay.c: + * [r787] patch from FoX that fixes compilation with kernel 2.6.21 2007-04-23 michael - * [r786] trunk/plugin_mpd.c: + * [r786] MPD plugin patch from michu 2007-04-20 michael - * [r785] trunk/drv_Cwlinux.c: + * [r785] keypad and firmware support for Cwlinux (patch from Volker Gering) - * [r784] trunk/plugin_proc_stat.c: + * [r784] iowait,irq and softirq added (patch from Roman Jozsef) 2007-03-22 michael - * [r783] branches/0.10.1/lcd4linux.c, - branches/0.10.1/plugin_file.c, branches/0.10.1/plugin_imon.c: + * [r783] backport r782 from trunk 2007-03-21 michael - * [r782] trunk/lcd4linux.c, trunk/plugin_file.c, - trunk/plugin_imon.c: + * [r782] plugin_file patch from Mark Richards 2007-03-13 michael - * [r781] branches/0.10.1/drv_Crystalfontz.c: + * [r781] backport r780 from trunk - * [r780] trunk/drv_Crystalfontz.c: + * [r780] Crystalfontz keypad patch from kenson 2007-03-05 michael - * [r779] trunk/configure, trunk/drivers.m4, trunk/smoketest.sh: + * [r779] ported changeset 778 from branches/0.10.1 - * [r778] branches/0.10.1/configure, branches/0.10.1/drivers.m4, - branches/0.10.1/smoketest.sh: + * [r778] picoLCD linker error fixed (libusb was missing) 2007-02-28 michael - * [r777] trunk/plugin_imon.c: + * [r777] imon::quantity and imon::status patch from Stefan Gmeiner / Christian Brueggemann 2007-02-26 michael - * [r776] branches/0.10.1/ChangeLog, - branches/0.10.1/drv_BeckmannEgle.c, - branches/0.10.1/drv_LEDMatrix.c, - branches/0.10.1/drv_WincorNixdorf.c: + * [r776] backported 774:775 from trunk - * [r775] trunk/ChangeLog: + * [r775] ChangeLog refresh - * [r774] trunk/drv_BeckmannEgle.c, trunk/drv_LEDMatrix.c, - trunk/drv_WincorNixdorf.c: + * [r774] compiler warnings on x86_64 fixed 2007-02-25 michael - * [r773] branches/0.10.1/ChangeLog, branches/0.10.1/Makefile.am, - branches/0.10.1/Makefile.in, branches/0.10.1/configure, - branches/0.10.1/configure.in, branches/0.10.1/debug.h, - branches/0.10.1/drv_BWCT.c, branches/0.10.1/drv_BeckmannEgle.c, - branches/0.10.1/drv_Crystalfontz.c, branches/0.10.1/drv_Curses.c, - branches/0.10.1/drv_Cwlinux.c, - branches/0.10.1/drv_EA232graphic.c, branches/0.10.1/drv_G15.c, - branches/0.10.1/drv_HD44780.c, branches/0.10.1/drv_Image.c, - branches/0.10.1/drv_LCD2USB.c, branches/0.10.1/drv_LCDLinux.c, - branches/0.10.1/drv_LCDTerm.c, branches/0.10.1/drv_LEDMatrix.c, - branches/0.10.1/drv_LPH7508.c, branches/0.10.1/drv_LUIse.c, - branches/0.10.1/drv_M50530.c, - branches/0.10.1/drv_MatrixOrbital.c, - branches/0.10.1/drv_MilfordInstruments.c, - branches/0.10.1/drv_NULL.c, branches/0.10.1/drv_Noritake.c, - branches/0.10.1/drv_RouterBoard.c, branches/0.10.1/drv_Sample.c, - branches/0.10.1/drv_SimpleLCD.c, branches/0.10.1/drv_T6963.c, - branches/0.10.1/drv_Trefon.c, branches/0.10.1/drv_USBHUB.c, - branches/0.10.1/drv_USBLCD.c, - branches/0.10.1/drv_WincorNixdorf.c, branches/0.10.1/drv_X11.c, - branches/0.10.1/drv_generic_graphic.c, - branches/0.10.1/drv_generic_i2c.c, - branches/0.10.1/drv_generic_i2c.h, - branches/0.10.1/drv_generic_text.c, - branches/0.10.1/drv_picoLCD.c, branches/0.10.1/drv_serdisplib.c, - branches/0.10.1/font_6x8.h, branches/0.10.1/font_6x8_bold.h, - branches/0.10.1/plugin_i2c_sensors.c, - branches/0.10.1/plugin_kvv.c, branches/0.10.1/plugin_mysql.c, - branches/0.10.1/plugin_string.c, branches/0.10.1/svn_version.h, - branches/0.10.1/widget_bar.c, branches/0.10.1/widget_gpo.c, - branches/0.10.1/widget_icon.c, branches/0.10.1/widget_image.c, - branches/0.10.1/widget_keypad.c, branches/0.10.1/widget_text.c, - branches/0.10.1/widget_timer.c: + * [r773] backport 768:771 from trunk, version changed to 0.10.1-RC2 - * [r772] trunk/ChangeLog, trunk/svn_version.h: + * [r772] ChangeLog refreshed - * [r771] trunk/Makefile.am, trunk/Makefile.in, trunk/debug.h, - trunk/drv_BWCT.c, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_EA232graphic.c, trunk/drv_G15.c, - trunk/drv_HD44780.c, trunk/drv_Image.c, trunk/drv_LCD2USB.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDTerm.c, trunk/drv_LEDMatrix.c, - trunk/drv_LPH7508.c, trunk/drv_LUIse.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_NULL.c, trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_Sample.c, trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, - trunk/drv_Trefon.c, trunk/drv_USBHUB.c, trunk/drv_USBLCD.c, - trunk/drv_WincorNixdorf.c, trunk/drv_X11.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_text.c, - trunk/drv_picoLCD.c, trunk/drv_serdisplib.c, trunk/font_6x8.h, - trunk/font_6x8_bold.h, trunk/plugin_i2c_sensors.c, - trunk/plugin_kvv.c, trunk/plugin_mysql.c, trunk/svn_version.h, - trunk/widget_bar.c, trunk/widget_gpo.c, trunk/widget_icon.c, - trunk/widget_image.c, trunk/widget_keypad.c, trunk/widget_text.c, - trunk/widget_timer.c: + * [r771] lots of compiler warnings removed, C++-style comments removed, changed struc initialisation from 'field:value' to '.field=value' 2007-02-24 michael - * [r770] trunk/plugin_string.c: + * [r770] strstr() and substr() added to string plugin - * [r769] trunk/ChangeLog: + * [r769] ChangeLog processed with svn2cl - * [r768] branches/0.10.1/svn_version.h: + * [r768] LCD4Linux-0.10.1-RC1 - * [r767] trunk/configure, trunk/configure.in, trunk/svn_version.h: + * [r767] trunk version incremented to 0.10.2-SVN - * [r766] branches/0.10.1: + * [r766] branch 0.10.1 created - * [r765] tags/0.10.0: + * [r765] tag 0.10.0 created - * [r764] trunk/configure, trunk/configure.in, trunk/svn_version.h: + * [r764] Version number changed to 0.10.1-RC1 2007-02-05 michael - * [r763] trunk/configure, trunk/drivers.m4: + * [r763] only use picoLCD if libusb is available 2007-02-04 michael - * [r762] trunk/svn_version.h: + * [r762] svn version bumped manually - * [r761] trunk/configure, trunk/drivers.m4: + * [r761] autoconf & smoketest bugs fixed - * [r760] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_EA232graphic.c, trunk/smoketest.sh: + * [r760] 'Electronic Assembly' driver by Stefan Gmeiner - * [r759] trunk/drv_picoLCD.c, trunk/lcd4linux.conf.sample: + * [r759] picoLCD driver bugs fixed 2007-01-23 michael - * [r758] trunk/Makefile.am, trunk/Makefile.in: + * [r758] drv_picoLCD was missing in distribution - * [r757] trunk/configure, trunk/svn_version.h: + * [r757] removed -SVN from version string - * [r756] trunk/Makefile.am, trunk/Makefile.in, trunk/configure.in, - trunk/lcd4linux.c, trunk/svn_version.h, trunk/svn_version.sh: + * [r756] try to add svn version 2007-01-21 michael - * [r755] trunk/plugin_math.c: + * [r755] indent - * [r754] trunk/evaluator.c, trunk/evaluator.h, trunk/plugin_math.c: + * [r754] new function 'decode()' - * [r753] trunk/widget_bar.c: + * [r753] removed unused variable 2007-01-20 michael - * [r752] trunk/widget_gpo.c, trunk/widget_keypad.c: + * [r752] keypad widget cleanup - * [r751] trunk/drv_generic_gpio.c, trunk/widget_gpo.c, - trunk/widget_gpo.h: + * [r751] GPO cleanup - * [r750] trunk/cfg.c, trunk/evaluator.c: + * [r750] minor fixes to evaluator - * [r749] trunk/Makefile.in, trunk/cfg.c, trunk/config.h.in, - trunk/configure, trunk/property.c, trunk/property.h, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_gpo.c, - trunk/widget_image.c, trunk/widget_keypad.c, trunk/widget_text.c, - trunk/widget_timer.c: + * [r749] dynamic properties for bars; new 'property_valid()' helper - * [r748] trunk/drv_picoLCD.c, trunk/widget_gpo.h, - trunk/widget_icon.h, trunk/widget_keypad.h, trunk/widget_text.h, - trunk/widget_timer.h: + * [r748] indent 2007-01-19 michael - * [r747] trunk/Makefile.am, trunk/drivers.m4, trunk/drv.c, - trunk/drv_picoLCD.c, trunk/lcd4linux.conf.sample: + * [r747] driver for picoLCD displays from mini-box.com by Nicu Pavel - * [r746] trunk/widget_keypad.c, trunk/widget_keypad.h: + * [r746] dynamic properties for keypad widget - * [r745] trunk/drv_generic_graphic.c, trunk/drv_generic_text.c: + * [r745] indent 2007-01-18 michael - * [r744] trunk/drv_generic_graphic.c, trunk/drv_generic_text.c, - trunk/widget_icon.c, trunk/widget_icon.h: + * [r744] dynamic properties for Icon widget 2007-01-17 michael - * [r743] trunk/widget_gpo.c, trunk/widget_gpo.h: + * [r743] dynamic properties for GPO's - * [r742] trunk/drv_generic_i2c.h: + * [r742] removed DOS newlines again :-( - * [r741] trunk/drv_HD44780.c, trunk/drv_generic_i2c.h: + * [r741] indent - * [r740] trunk/configure, trunk/configure.in: + * [r740] changed version number from 0.10.1-CVS to 0.10.1-SVN 2007-01-16 michael - * [r739] trunk/config.h.in, trunk/configure, trunk/drivers.m4, - trunk/drv_HD44780.c: + * [r739] new driver 'HD44780-I2C' - * [r738] trunk/plugin_wireless.c: + * [r738] Fix compilation of plugin_wireless.c with linux kernel 2.6.19 from Guillaume LECERF - * [r737] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drivers.m4: + * [r737] Patch from Robert Buchholz: NULL driver link error fixed, m4 files included in distribution - * [r736] trunk/drv_LCDLinux.c: + * [r736] patch from Mattia Jona-Lasinio for lcd-linux 0.12.0 - * [r735] trunk/Makefile.in: + * [r735] svn keywords - * [r734] trunk/drv_generic_i2c.h: + * [r734] removed some DOS newlines 2007-01-15 michael - * [r733] trunk/Makefile.am, trunk/Makefile.in, trunk/drv_Sample.c, - trunk/plugin_sample.c, trunk/smoketest.sh: + * [r733] minor cosmetic changes and fixes 2007-01-14 michael - * [r732] trunk, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in: + * [r732] re-bootstrapped - * [r731] trunk/mkinstalldirs: + * [r731] svn keywords corrected - * [r730] trunk/AUTHORS, trunk/CREDITS, trunk/CodingStyle, - trunk/INSTALL, trunk/Makefile.am, trunk/NEWS, trunk/README, - trunk/README.KDE, trunk/TODO, trunk/lcd4linux.conf.sample, - trunk/plugins.m4, trunk/smoketest.sh, trunk/usbhub.conf: + * [r730] svn keywords corrected - * [r729] trunk/AUTHORS, trunk/NEWS, trunk/Status, trunk/TODO, - trunk/ac_python_devel.m4, trunk/bootstrap, trunk/configure.in, - trunk/curses.m4, trunk/drivers.m4, trunk/indent.sh, - trunk/lcd4linux.conf.sample, trunk/plugins.m4, - trunk/smoketest.sh, trunk/usbhub.conf: + * [r729] added svn properties and keywords - * [r728] trunk/cfg.c, trunk/cfg.h, trunk/debug.c, trunk/debug.h, - trunk/drv.c, trunk/drv.h, trunk/drv_BWCT.c, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_G15.c, - trunk/drv_HD44780.c, trunk/drv_Image.c, trunk/drv_LCD2USB.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDTerm.c, trunk/drv_LEDMatrix.c, - trunk/drv_LPH7508.c, trunk/drv_LUIse.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_NULL.c, trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_Sample.c, trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, - trunk/drv_Trefon.c, trunk/drv_USBHUB.c, trunk/drv_USBLCD.c, - trunk/drv_WincorNixdorf.c, trunk/drv_X11.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_gpio.c, - trunk/drv_generic_gpio.h, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_keypad.c, - trunk/drv_generic_keypad.h, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/drv_generic_serial.c, - trunk/drv_generic_serial.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/drv_serdisplib.c, - trunk/evaluator.c, trunk/evaluator.h, trunk/font_6x8.h, - trunk/font_6x8_bold.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/layout.h, trunk/lcd4linux.c, - trunk/lcd4linux_i2c.h, trunk/pid.c, trunk/pid.h, trunk/plugin.c, - trunk/plugin.h, trunk/plugin_apm.c, trunk/plugin_cfg.c, - trunk/plugin_cpuinfo.c, trunk/plugin_diskstats.c, - trunk/plugin_dvb.c, trunk/plugin_exec.c, trunk/plugin_file.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_iconv.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_kvv.c, - trunk/plugin_loadavg.c, trunk/plugin_math.c, - trunk/plugin_meminfo.c, trunk/plugin_mpd.c, trunk/plugin_mysql.c, - trunk/plugin_netdev.c, trunk/plugin_pop3.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_python.c, - trunk/plugin_sample.c, trunk/plugin_seti.c, - trunk/plugin_statfs.c, trunk/plugin_string.c, - trunk/plugin_test.c, trunk/plugin_time.c, trunk/plugin_uname.c, - trunk/plugin_uptime.c, trunk/plugin_wireless.c, - trunk/plugin_xmms.c, trunk/property.c, trunk/property.h, - trunk/qprintf.c, trunk/qprintf.h, trunk/rgb.c, trunk/rgb.h, - trunk/thread.c, trunk/thread.h, trunk/timer.c, trunk/timer.h, - trunk/udelay.c, trunk/udelay.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_gpo.c, - trunk/widget_gpo.h, trunk/widget_icon.c, trunk/widget_icon.h, - trunk/widget_image.c, trunk/widget_image.h, - trunk/widget_keypad.c, trunk/widget_keypad.h, - trunk/widget_text.c, trunk/widget_text.h, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r728] changed $Revision to $Rev - * [r727] trunk/cfg.c, trunk/cfg.h, trunk/debug.c, trunk/debug.h, - trunk/drv.c, trunk/drv.h, trunk/drv_BWCT.c, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_G15.c, - trunk/drv_HD44780.c, trunk/drv_Image.c, trunk/drv_LCD2USB.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDTerm.c, trunk/drv_LEDMatrix.c, - trunk/drv_LPH7508.c, trunk/drv_LUIse.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_NULL.c, trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_Sample.c, trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, - trunk/drv_Trefon.c, trunk/drv_USBHUB.c, trunk/drv_USBLCD.c, - trunk/drv_WincorNixdorf.c, trunk/drv_X11.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_gpio.c, - trunk/drv_generic_gpio.h, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_keypad.c, - trunk/drv_generic_keypad.h, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/drv_generic_serial.c, - trunk/drv_generic_serial.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/drv_serdisplib.c, - trunk/evaluator.c, trunk/evaluator.h, trunk/font_6x8.h, - trunk/font_6x8_bold.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/layout.h, trunk/lcd4linux.c, - trunk/lcd4linux_i2c.h, trunk/pid.c, trunk/pid.h, trunk/plugin.c, - trunk/plugin.h, trunk/plugin_apm.c, trunk/plugin_cfg.c, - trunk/plugin_cpuinfo.c, trunk/plugin_diskstats.c, - trunk/plugin_dvb.c, trunk/plugin_exec.c, trunk/plugin_file.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_iconv.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_kvv.c, - trunk/plugin_loadavg.c, trunk/plugin_math.c, - trunk/plugin_meminfo.c, trunk/plugin_mpd.c, trunk/plugin_mysql.c, - trunk/plugin_netdev.c, trunk/plugin_pop3.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_python.c, - trunk/plugin_sample.c, trunk/plugin_seti.c, - trunk/plugin_statfs.c, trunk/plugin_string.c, - trunk/plugin_test.c, trunk/plugin_time.c, trunk/plugin_uname.c, - trunk/plugin_uptime.c, trunk/plugin_wireless.c, - trunk/plugin_xmms.c, trunk/property.c, trunk/property.h, - trunk/qprintf.c, trunk/qprintf.h, trunk/rgb.c, trunk/rgb.h, - trunk/thread.c, trunk/thread.h, trunk/timer.c, trunk/timer.h, - trunk/udelay.c, trunk/udelay.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_gpo.c, - trunk/widget_gpo.h, trunk/widget_icon.c, trunk/widget_icon.h, - trunk/widget_image.c, trunk/widget_image.h, - trunk/widget_keypad.c, trunk/widget_keypad.h, - trunk/widget_text.c, trunk/widget_text.h, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r727] removed all tags - * [r726] trunk/CREDITS, trunk/CodingStyle, trunk/FAQ, - trunk/INSTALL, trunk/Makefile.am, trunk/README, trunk/README.KDE, - trunk/cfg.c, trunk/cfg.h, trunk/debug.c, trunk/debug.h, - trunk/drv.c, trunk/drv.h, trunk/drv_BWCT.c, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_G15.c, - trunk/drv_HD44780.c, trunk/drv_Image.c, trunk/drv_LCD2USB.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDTerm.c, trunk/drv_LEDMatrix.c, - trunk/drv_LPH7508.c, trunk/drv_LUIse.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_NULL.c, trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_Sample.c, trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, - trunk/drv_Trefon.c, trunk/drv_USBHUB.c, trunk/drv_USBLCD.c, - trunk/drv_WincorNixdorf.c, trunk/drv_X11.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_gpio.c, - trunk/drv_generic_gpio.h, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_keypad.c, - trunk/drv_generic_keypad.h, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/drv_generic_serial.c, - trunk/drv_generic_serial.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/drv_serdisplib.c, - trunk/evaluator.c, trunk/evaluator.h, trunk/font_6x8.h, - trunk/font_6x8_bold.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/layout.h, trunk/lcd4linux.c, - trunk/lcd4linux_i2c.h, trunk/pid.c, trunk/pid.h, trunk/plugin.c, - trunk/plugin.h, trunk/plugin_apm.c, trunk/plugin_cfg.c, - trunk/plugin_cpuinfo.c, trunk/plugin_diskstats.c, - trunk/plugin_dvb.c, trunk/plugin_exec.c, trunk/plugin_file.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_iconv.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_kvv.c, - trunk/plugin_loadavg.c, trunk/plugin_math.c, - trunk/plugin_meminfo.c, trunk/plugin_mpd.c, trunk/plugin_mysql.c, - trunk/plugin_netdev.c, trunk/plugin_pop3.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_python.c, - trunk/plugin_sample.c, trunk/plugin_seti.c, - trunk/plugin_statfs.c, trunk/plugin_string.c, - trunk/plugin_test.c, trunk/plugin_time.c, trunk/plugin_uname.c, - trunk/plugin_uptime.c, trunk/plugin_wireless.c, - trunk/plugin_xmms.c, trunk/property.c, trunk/property.h, - trunk/qprintf.c, trunk/qprintf.h, trunk/rgb.c, trunk/rgb.h, - trunk/thread.c, trunk/thread.h, trunk/timer.c, trunk/timer.h, - trunk/udelay.c, trunk/udelay.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_gpo.c, - trunk/widget_gpo.h, trunk/widget_icon.c, trunk/widget_icon.h, - trunk/widget_image.c, trunk/widget_image.h, - trunk/widget_keypad.c, trunk/widget_keypad.h, - trunk/widget_text.c, trunk/widget_text.h, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r726] svn properties fixed - * [r725] trunk: + * [r725] svn:ignore ported from .cvsignore - * [r724] trunk/aclocal.m4, trunk/configure, trunk/debian, - trunk/documentation, trunk/plugin_imon.c, - trunk/plugin_wireless.c, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r724] switch from CVS to SVN 2006-10-01 reinelt - * [r723] trunk/widget_image.c, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r723] [lcd4linux @ 2006-10-01 11:54:38 by reinelt] timer widget uses properties 2006-09-29 reinelt - * [r722] trunk/aclocal.m4, trunk/configure, - trunk/drv_generic_graphic.c, trunk/evaluator.c, - trunk/plugin_iconv.c, trunk/widget_image.c, trunk/widget_image.h, - trunk/widget_text.c: + * [r722] [lcd4linux @ 2006-09-29 04:48:21 by reinelt] image widget uses properties now; new property 'reload' 2006-10-04 root - * [r721] trunk/widget_image.c: + * [r721] image widget memory leaks fixed (thanks to Magne Torresen) 2006-09-19 entropy - * [r720] trunk/plugin.c: + * [r720] [lcd4linux @ 2006-09-19 11:20:52 by entropy] Added missing prototypes 2006-09-15 siretart - * [r719] trunk/Makefile.in, trunk/aclocal.m4, trunk/configure: + * [r719] [lcd4linux @ 2006-09-15 20:30:03 by siretart] rerun bootstrap on request from Ernst Bachmann <e.bachmann@xebec.de> @@ -525,52 +956,50 @@ 2006-09-15 entropy - * [r718] trunk/plugin_iconv.c: + * [r718] [lcd4linux @ 2006-09-15 19:06:47 by entropy] debug spam reduced, comment typo fixed - * [r717] trunk/Makefile.am, trunk/config.h.in, trunk/plugin.c, - trunk/plugin_iconv.c, trunk/plugins.m4: + * [r717] [lcd4linux @ 2006-09-15 19:00:50 by entropy] iconv charset converter plugin 2006-09-14 entropy - * [r716] trunk/usbhub.conf: + * [r716] [lcd4linux @ 2006-09-14 20:36:39 by entropy] Improved example showing how to display network and hdd activity on an usb hub - * [r715] trunk/lcd4linux.c: + * [r715] [lcd4linux @ 2006-09-14 11:19:29 by entropy] New cmdline option -p to specify the pidfile location 2006-09-14 reinelt - * [r714] trunk/evaluator.c: + * [r714] [lcd4linux @ 2006-09-14 04:08:54 by reinelt] variables use a static list, no realloc, linear search - * [r713] trunk/drv_Crystalfontz.c, trunk/drv_generic_serial.c, - trunk/lcd4linux.c, trunk/thread.c, trunk/thread.h: + * [r713] [lcd4linux @ 2006-09-14 03:49:14 by reinelt] indent run 2006-09-13 entropy - * [r712] trunk/udelay.h: + * [r712] [lcd4linux @ 2006-09-13 20:07:59 by entropy] Fixing bug #1494773 (compiles only on i368/amd64 machines) by providing a dummy implementation for other archs - * [r711] trunk/lcd4linux.c, trunk/thread.c, trunk/thread.h: + * [r711] [lcd4linux @ 2006-09-13 20:04:57 by entropy] threads change argv[0] to their thread name, for a neat 'ps' output 2006-09-13 reinelt - * [r710] trunk/plugin_file.c, trunk/widget_text.c: + * [r710] [lcd4linux @ 2006-09-13 05:33:39 by reinelt] plugin_file: return empty string if file cannot be read; widget_text: load property as 'string', not as variable @@ -578,38 +1007,31 @@ 2006-09-08 reinelt - * [r709] trunk/drv_Trefon.c, trunk/drv_USBLCD.c, - trunk/drv_generic_serial.c: + * [r709] [lcd4linux @ 2006-09-08 19:00:46 by reinelt] give up after 10 write errors to serial device 2006-09-07 reinelt - * [r708] trunk/debug.h, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_LEDMatrix.c, trunk/drv_M50530.c, trunk/drv_NULL.c, - trunk/drv_USBHUB.c, trunk/drv_generic_i2c.c, - trunk/plugin_i2c_sensors.c, trunk/widget_image.c: + * [r708] [lcd4linux @ 2006-09-07 09:06:25 by reinelt] lots of wrong printf formats corrected (thanks to Ernst Bachmann) 2006-09-06 reinelt - * [r707] trunk/.cvsignore, trunk/configure, trunk/missing: + * [r707] [lcd4linux @ 2006-09-06 05:22:09 by reinelt] some autoconf updates 2006-09-04 siretart - * [r706] trunk/Makefile.in, trunk/aclocal.m4, trunk/config.h.in, - trunk/configure: + * [r706] [lcd4linux @ 2006-09-04 16:48:32 by siretart] rerun bootstrap on current debian/etch system using automake1.9 to make my previous commits active - * [r705] trunk/ac_python_devel.m4, trunk/configure.in, - trunk/python.m4: + * [r705] [lcd4linux @ 2006-09-04 16:47:39 by siretart] These changes were necessary to make lcd4linux build on current debian etch/unstable @@ -625,11 +1047,7 @@ Moreover, this actually works - * [r704] trunk/debian/changelog, trunk/debian/compat, - trunk/debian/config, trunk/debian/control, - trunk/debian/copyright, trunk/debian/dirs, trunk/debian/docs, - trunk/debian/init.d, trunk/debian/postinst, trunk/debian/rules, - trunk/debian/templates, trunk/debian/watch: + * [r704] [lcd4linux @ 2006-09-04 16:41:21 by siretart] removing debianisation from upstream source, as discussed with Michael on private mail. @@ -642,215 +1060,175 @@ depending on the state of the cvs). - * [r703] trunk/drivers.m4: + * [r703] [lcd4linux @ 2006-09-04 16:35:43 by siretart] fix linking with modular xorg. See http://bugs.debian.org/381606 for reference - * [r702] trunk/bootstrap: + * [r702] [lcd4linux @ 2006-09-04 16:33:21 by siretart] beautify bootstrap script 2006-08-23 harbaum - * [r701] trunk/plugin_kvv.c: + * [r701] [lcd4linux @ 2006-08-23 17:45:37 by harbaum] Umlaut translation bugfix 2006-08-23 reinelt - * [r700] trunk/lcd4linux.conf.sample: + * [r700] [lcd4linux @ 2006-08-23 05:05:40 by reinelt] CF635 added to lcd4linux.conf.sample 2006-08-17 harbaum - * [r699] trunk/Makefile.in, trunk/aclocal.m4, trunk/config.h.in, - trunk/configure, trunk/plugin_kvv.c: + * [r699] [lcd4linux @ 2006-08-17 19:11:40 by harbaum] Small plugin_kvv bugfixes and new abbreviate option 2006-08-17 reinelt - * [r698] trunk/configure, trunk/drivers.m4: + * [r698] [lcd4linux @ 2006-08-17 05:06:26 by reinelt] LCD2USB driver missing keypad symbols fixed 2006-08-16 reinelt - * [r697] trunk/Makefile.am, trunk/Makefile.in, trunk/drv_T6963.c, - trunk/lcd4linux.conf.sample, trunk/plugin_kvv.c: + * [r697] [lcd4linux @ 2006-08-16 14:18:14 by reinelt] T6963 enhancements: soft timing, DualScan, Cell size 2006-08-15 harbaum - * [r696] trunk/plugin_kvv.c: + * [r696] [lcd4linux @ 2006-08-15 17:28:27 by harbaum] Cleaned up thread and error handling 2006-08-14 harbaum - * [r695] trunk/drv_LEDMatrix.c, trunk/drv_USBHUB.c, - trunk/drv_generic_graphic.c, trunk/font_6x8.h, - trunk/font_6x8_bold.h, trunk/plugin_kvv.c: + * [r695] [lcd4linux @ 2006-08-14 19:24:22 by harbaum] Umlaut support, added KVV HTTP-User-Agent 2006-08-14 reinelt - * [r694] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_LEDMatrix.c, trunk/drv_USBHUB.c, - trunk/lcd4linux.conf.sample, trunk/property.h, trunk/widget.h: + * [r694] [lcd4linux @ 2006-08-14 05:54:03 by reinelt] minor warnings fixed, CFLAGS changed (no-strict-aliasing) 2006-08-13 harbaum - * [r693] trunk/drv_LEDMatrix.c, trunk/plugin_kvv.c: + * [r693] [lcd4linux @ 2006-08-13 18:45:25 by harbaum] Little cleanup ... - * [r692] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drv_LEDMatrix.c, trunk/font_6x8_bold.h, - trunk/lcd4linux.conf.sample, trunk/plugin.c, trunk/plugin_kvv.c, - trunk/plugins.m4, trunk/property.c, trunk/widget_text.c, - trunk/widget_text.h: + * [r692] [lcd4linux @ 2006-08-13 18:14:03 by harbaum] Added KVV plugin 2006-08-13 reinelt - * [r691] trunk/lcd4linux.conf.sample, trunk/property.c, - trunk/property.h, trunk/widget_text.c, trunk/widget_text.h: + * [r691] [lcd4linux @ 2006-08-13 11:38:20 by reinelt] text widget uses dynamic properties - * [r690] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/drv_LEDMatrix.c, - trunk/drv_T6963.c, trunk/drv_generic.c, trunk/drv_generic.h, - trunk/drv_generic_graphic.c, trunk/evaluator.h, - trunk/lcd4linux.conf.sample, trunk/property.c, trunk/property.h, - trunk/widget_text.c, trunk/widget_text.h: + * [r690] [lcd4linux @ 2006-08-13 09:53:10 by reinelt] dynamic properties added (used by 'style' of text widget) - * [r689] trunk/drv_G15.c, trunk/drv_Image.c, trunk/drv_LEDMatrix.c, - trunk/drv_M50530.c, trunk/drv_T6963.c, trunk/drv_USBHUB.c, - trunk/drv_X11.c, trunk/drv_generic.c, trunk/drv_generic.h, - trunk/drv_generic_graphic.c, trunk/drv_generic_i2c.h, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, trunk/udelay.c, - trunk/widget_bar.h: + * [r689] [lcd4linux @ 2006-08-13 06:46:51 by reinelt] T6963 soft-timing & enhancements; indent 2006-08-11 reinelt - * [r688] trunk/drv_M50530.c, trunk/lcd4linux.conf.sample: + * [r688] [lcd4linux @ 2006-08-11 11:59:29 by reinelt] M50530 minor fixes 2006-08-10 reinelt - * [r687] trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/lcd4linux.conf.sample: + * [r687] [lcd4linux @ 2006-08-10 20:40:46 by reinelt] M50530 enhancements: Timings, busy-flag checking - * [r686] trunk/lcd4linux.conf.sample, trunk/udelay.c: + * [r686] [lcd4linux @ 2006-08-10 19:06:52 by reinelt] new 'fuzz' parameter for timings 2006-08-09 harbaum - * [r685] trunk/Makefile.in, trunk/aclocal.m4, trunk/config.h.in, - trunk/configure, trunk/drv_LEDMatrix.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_graphic.c, - trunk/font_6x8_bold.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_bar.h: + * [r685] [lcd4linux @ 2006-08-09 17:25:34 by harbaum] Better bar color support and new bold font 2006-08-08 harbaum - * [r684] trunk/drv_LEDMatrix.c, trunk/drv_generic_graphic.c, - trunk/widget.c, trunk/widget.h: + * [r684] [lcd4linux @ 2006-08-08 20:16:28 by harbaum] Added "extracolor" (used for e.g. bar border) and RGB support for LEDMATRIX 2006-08-08 reinelt - * [r683] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_USBHUB.c, trunk/usbhub.conf: + * [r683] [lcd4linux @ 2006-08-08 19:35:21 by reinelt] USBHUB driver from Ernst Bachmann - * [r682] trunk/Makefile.in, trunk/aclocal.m4, trunk/config.h.in, - trunk/configure, trunk/widget.c: + * [r682] [lcd4linux @ 2006-08-08 19:28:18 by reinelt] widget type checking corrected 2006-08-05 harbaum - * [r681] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/drivers.m4, - trunk/drv.c, trunk/drv_LEDMatrix.c: + * [r681] [lcd4linux @ 2006-08-05 21:08:01 by harbaum] New LEDMATRIX driver (see http://www.harbaum.org/till/ledmatrix) 2006-07-31 reinelt - * [r680] trunk/Makefile.am, trunk/Makefile.in, trunk/configure.in, - trunk/drv.c, trunk/drv_generic.c, trunk/drv_generic.h, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_i2c.c, trunk/drv_generic_i2c.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_string.c, trunk/widget_timer.c: + * [r680] [lcd4linux @ 2006-07-31 03:48:09 by reinelt] preparations for scrolling 2006-07-30 lfcorreia - * [r679] trunk/plugin.c, trunk/plugin_string.c: + * [r679] [lcd4linux @ 2006-07-30 11:29:02 by lfcorreia] Make changes suggested by Michael, only one init function is needed - * [r678] trunk/drv_generic_i2c.c: + * [r678] [lcd4linux @ 2006-07-30 11:16:27 by lfcorreia] Add back drv_generic_i2c_close function 2006-07-29 lfcorreia - * [r677] trunk/plugin.c, trunk/plugin_string.c: + * [r677] [lcd4linux @ 2006-07-29 21:12:31 by lfcorreia] Add UPPERCASE string plugin function - * [r676] trunk/drv_generic_i2c.c: + * [r676] [lcd4linux @ 2006-07-29 21:04:43 by lfcorreia] Better error handling, add proper I2C SLAVE device detection (not 100% finished) - * [r675] trunk/drv_HD44780.c: + * [r675] [lcd4linux @ 2006-07-29 20:59:12 by lfcorreia] Fix wrong timing at I2C initialization 2006-07-19 cmay - * [r674] trunk/plugin_file.c: + * [r674] [lcd4linux @ 2006-07-19 01:57:01 by cmay] fixed double read of last line in file - * [r673] trunk/drv_Crystalfontz.c, trunk/drv_Curses.c: + * [r673] [lcd4linux @ 2006-07-19 01:48:11 by cmay] Ran indent.sh to make pretty code. - * [r672] trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_LCD2USB.c, trunk/widget_keypad.c, - trunk/widget_keypad.h: + * [r672] [lcd4linux @ 2006-07-19 01:35:31 by cmay] Renamed keypad direction names to avoid conflict with Curses library defs. @@ -858,584 +1236,482 @@ 2006-07-18 nicowallmeier - * [r671] trunk/configure, trunk/plugins.m4: + * [r671] [lcd4linux @ 2006-07-18 17:04:55 by nicowallmeier] Changed test for libmpd 2006-07-14 reinelt - * [r670] trunk/drv_Crystalfontz.c: + * [r670] [lcd4linux @ 2006-07-14 20:15:11 by reinelt] buffer too small (thanks to anonymous) 2006-07-12 reinelt - * [r669] trunk/configure, trunk/drv_G15.c, trunk/plugin_exec.c, - trunk/thread.c, trunk/thread.h: + * [r669] [lcd4linux @ 2006-07-12 21:01:41 by reinelt] thread_destroy, minor cleanups - * [r668] trunk/drv_G15.c, trunk/drv_LCDLinux.c, - trunk/plugin_exec.c: + * [r668] [lcd4linux @ 2006-07-12 20:47:51 by reinelt] indent - * [r667] trunk/drv_G15.c, trunk/lcd4linux.conf.sample, - trunk/plugin_exec.c: + * [r667] [lcd4linux @ 2006-07-12 20:45:30 by reinelt] G15 and thread patch by Anton 2006-06-25 reinelt - * [r666] trunk/.cvsignore, trunk/config.h.in, trunk/configure, - trunk/configure.in: + * [r666] [lcd4linux @ 2006-06-25 15:13:00 by reinelt] automake-1.9 cleanups - * [r665] trunk/.cvsignore, trunk/Makefile.in, trunk/aclocal.m4, - trunk/configure, trunk/depcomp, trunk/smoketest.sh: + * [r665] [lcd4linux @ 2006-06-25 14:58:38 by reinelt] switch to automake-1.9 2006-06-21 reinelt - * [r664] trunk/drv_Image.c, trunk/widget_image.c: + * [r664] [lcd4linux @ 2006-06-21 05:12:43 by reinelt] added checks for libgd version 2 (thanks to Sam) 2006-06-20 reinelt - * [r663] trunk/config.h.in, trunk/configure, trunk/drivers.m4, - trunk/drv_generic_graphic.c, trunk/widget_image.c: + * [r663] [lcd4linux @ 2006-06-20 08:50:58 by reinelt] widget_image linker error hopefully finally fixed 2006-06-19 reinelt - * [r662] trunk/config.h.in, trunk/configure: + * [r662] [lcd4linux @ 2006-06-19 15:12:54 by reinelt] bootstrapped - * [r661] trunk/drivers.m4: + * [r661] [lcd4linux @ 2006-06-19 12:02:17 by reinelt] linker error from widget_image fixed - * [r660] trunk/drv_Sample.c: + * [r660] [lcd4linux @ 2006-06-19 11:54:08 by reinelt] removed dependency to usb.h from sample driver 2006-04-17 reinelt - * [r659] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drivers.m4, trunk/drv_LCDLinux.c: + * [r659] [lcd4linux @ 2006-04-17 08:10:42 by reinelt] LCDLinux patch from Mattia; widget_image moved to EXTRA_SOURCE 2006-04-15 reinelt - * [r658] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/plugin.c, trunk/plugin_mpd.c, - trunk/plugins.m4, trunk/widget_image.c: + * [r658] [lcd4linux @ 2006-04-15 05:22:52 by reinelt] mpd plugin from Stefan Kuhne 2006-04-14 harbaum - * [r657] trunk/drv.c: + * [r657] [lcd4linux @ 2006-04-14 20:59:38 by harbaum] Disable inclusion of Image driver in drv.c if no gd was found. 2006-04-09 reinelt - * [r656] trunk/drv_generic_graphic.c: + * [r656] [lcd4linux @ 2006-04-09 17:46:14 by reinelt] vertical bar patch fro graphic displays by Ronald Hopfer - * [r655] trunk/configure, trunk/drivers.m4, trunk/drv_LCD2USB.c, - trunk/drv_LUIse.c, trunk/drv_generic_graphic.c, - trunk/lcd4linux.conf.sample, trunk/widget_image.c, - trunk/widget_image.h: + * [r655] [lcd4linux @ 2006-04-09 14:17:49 by reinelt] autoconf/library fixes, image and graphic display inversion 2006-03-29 reinelt - * [r654] trunk/drv_generic_text.c, trunk/lcd4linux.conf.sample: + * [r654] [lcd4linux @ 2006-03-29 08:57:58 by reinelt] vertical bar patch from Manuel Lausch 2006-03-18 harbaum - * [r653] trunk/drv_LCD2USB.c: + * [r653] [lcd4linux @ 2006-03-18 14:54:36 by harbaum] Improved USB error recovery 2006-03-10 tooly-bln - * [r652] trunk/drv_LUIse.c: + * [r652] [lcd4linux @ 2006-03-10 18:06:52 by tooly-bln] replace drv_generic_graphic_FB with drv_generic_graphic_black 2006-02-27 reinelt - * [r651] trunk/drv_Noritake.c, trunk/drv_generic_text.c, - trunk/drv_serdisplib.c, trunk/indent.sh: + * [r651] [lcd4linux @ 2006-02-27 08:12:34 by reinelt] use serdisplib's full color support - * [r650] trunk/drv_generic_graphic.c, trunk/layout.h, - trunk/lcd4linux.conf.sample: + * [r650] [lcd4linux @ 2006-02-27 07:53:52 by reinelt] some more graphic issues fixed - * [r649] trunk/drv_Noritake.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_text.c: + * [r649] [lcd4linux @ 2006-02-27 06:15:55 by reinelt] indent... - * [r648] trunk/drv_G15.c, trunk/drv_LPH7508.c, trunk/drv_Sample.c, - trunk/drv_T6963.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_serdisplib.c, - trunk/lcd4linux.conf.sample: + * [r648] [lcd4linux @ 2006-02-27 06:14:46 by reinelt] graphic bug resulting in all black pixels solved 2006-02-25 geronet - * [r647] trunk/drv_Cwlinux.c, trunk/drv_Noritake.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_parport.c, - trunk/drv_generic_text.c, trunk/evaluator.c, trunk/indent.sh, - trunk/lcd4linux_i2c.h, trunk/plugin_i2c_sensors.c, - trunk/plugin_mysql.c, trunk/plugin_pop3.c, trunk/widget_icon.c, - trunk/widget_image.c, trunk/widget_image.h, - trunk/widget_keypad.h, trunk/widget_timer.c, - trunk/widget_timer.h: + * [r647] [lcd4linux @ 2006-02-25 13:36:33 by geronet] updated indent.sh, applied coding style 2006-02-24 geronet - * [r646] trunk/drv_generic_graphic.c: + * [r646] [lcd4linux @ 2006-02-24 13:07:10 by geronet] hollow bars for graphic lcd's 2006-02-22 cmay - * [r645] trunk/drv_Crystalfontz.c, trunk/drv_LCD2USB.c, - trunk/drv_generic_keypad.c, trunk/drv_generic_keypad.h: + * [r645] [lcd4linux @ 2006-02-22 15:59:39 by cmay] removed KEYPADSIZE cruft per harbaum's suggestion 2006-02-21 harbaum - * [r644] trunk/drv_LCD2USB.c: + * [r644] [lcd4linux @ 2006-02-21 21:43:03 by harbaum] Keypad support for LCD2USB 2006-02-21 cmay - * [r643] trunk/drv_generic_keypad.c, trunk/drv_generic_keypad.h, - trunk/widget.h, trunk/widget_keypad.c: + * [r643] [lcd4linux @ 2006-02-21 15:55:59 by cmay] removed new update function for keypad, consolidated it with draw - * [r642] trunk/drv_Crystalfontz.c: + * [r642] [lcd4linux @ 2006-02-21 15:52:30 by cmay] added back CF635 GPO counts in model struct lost after last merge 2006-02-21 reinelt - * [r641] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drivers.m4, trunk/drv_Crystalfontz.c, - trunk/drv_generic_keypad.c, trunk/drv_generic_keypad.h, - trunk/layout.c, trunk/widget.c, trunk/widget.h, - trunk/widget_keypad.c, trunk/widget_keypad.h: + * [r641] [lcd4linux @ 2006-02-21 05:50:34 by reinelt] keypad support from Cris Maj 2006-02-19 reinelt - * [r640] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/plugin.c, trunk/plugin_file.c, - trunk/plugins.m4: + * [r640] [lcd4linux @ 2006-02-19 15:42:18 by reinelt] file plugin from Chris Maj - * [r639] trunk/drv_Crystalfontz.c: + * [r639] [lcd4linux @ 2006-02-19 15:37:38 by reinelt] CF635 GPO patch from cmaj - * [r638] trunk/drv_generic_graphic.c, trunk/lcd4linux.conf.sample, - trunk/widget_image.c: + * [r638] [lcd4linux @ 2006-02-19 07:20:53 by reinelt] image support nearly finished 2006-02-12 harbaum - * [r637] trunk/drv_LCD2USB.c: + * [r637] [lcd4linux @ 2006-02-12 14:32:24 by harbaum] Configurable bus/device id 2006-02-09 harbaum - * [r636] trunk/drv_LCD2USB.c: + * [r636] [lcd4linux @ 2006-02-09 20:32:49 by harbaum] LCD2USB bus testing, version verification ... 2006-02-08 reinelt - * [r635] trunk/drv_G15.c, trunk/drv_Image.c, trunk/drv_LPH7508.c, - trunk/drv_LUIse.c, trunk/drv_Sample.c, trunk/drv_T6963.c, - trunk/drv_X11.c, trunk/drv_generic_graphic.c, - trunk/drv_serdisplib.c, trunk/layout.c, - trunk/lcd4linux.conf.sample, trunk/widget_image.c, - trunk/widget_image.h: + * [r635] [lcd4linux @ 2006-02-08 04:55:03 by reinelt] moved widget registration to drv_generic_graphic 2006-02-07 reinelt - * [r634] trunk/cfg.c, trunk/drv_generic_graphic.c, trunk/layout.c, - trunk/layout.h, trunk/lcd4linux.conf.sample: + * [r634] [lcd4linux @ 2006-02-07 05:36:13 by reinelt] Layers added to Layout 2006-02-06 reinelt - * [r633] trunk/drv_Cwlinux.c, trunk/drv_Image.c, - trunk/lcd4linux.conf.sample: + * [r633] [lcd4linux @ 2006-02-06 06:29:30 by reinelt] Image driver uses RGBA 2006-01-30 harbaum - * [r632] trunk/drv_LCD2USB.c: + * [r632] [lcd4linux @ 2006-01-30 20:21:51 by harbaum] LCD2USB: Added support for displays with two controllers 2006-01-30 reinelt - * [r631] trunk/cfg.c, trunk/evaluator.c: + * [r631] [lcd4linux @ 2006-01-30 12:53:07 by reinelt] replaced strncpy with strcpy where possible - * [r630] trunk/ChangeLog: + * [r630] [lcd4linux @ 2006-01-30 06:31:25 by reinelt] ChangeLog - * [r629] trunk/drv_BWCT.c, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_G15.c, trunk/drv_HD44780.c, - trunk/drv_Image.c, trunk/drv_LCD2USB.c, trunk/drv_LCDLinux.c, - trunk/drv_LCDTerm.c, trunk/drv_LPH7508.c, trunk/drv_LUIse.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_Sample.c, trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, - trunk/drv_Trefon.c, trunk/drv_USBLCD.c, - trunk/drv_WincorNixdorf.c, trunk/drv_X11.c, - trunk/drv_serdisplib.c: + * [r629] [lcd4linux @ 2006-01-30 06:25:48 by reinelt] added CVS Revision - * [r628] trunk/drv_X11.c: + * [r628] [lcd4linux @ 2006-01-30 06:17:17 by reinelt] added CVS Revision - * [r627] trunk/evaluator.c, trunk/evaluator.h: + * [r627] [lcd4linux @ 2006-01-30 06:11:36 by reinelt] changed Result->length to Result->size - * [r626] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/configure, trunk/drv_G15.c, trunk/drv_Image.c, - trunk/drv_LPH7508.c, trunk/drv_Sample.c, trunk/drv_T6963.c, - trunk/drv_X11.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/drv_serdisplib.c, - trunk/evaluator.c, trunk/indent.sh, trunk/layout.c, - trunk/lcd4linux.conf.sample, trunk/rgb.c, trunk/rgb.h, - trunk/widget.c, trunk/widget.h: + * [r626] [lcd4linux @ 2006-01-30 05:47:34 by reinelt] graphic subsystem changed to full-color RGBA 2006-01-28 harbaum - * [r625] trunk/drv_LCD2USB.c, trunk/evaluator.c: + * [r625] [lcd4linux @ 2006-01-28 15:36:17 by harbaum] Fix: string termination bug in eval() 2006-01-26 harbaum - * [r624] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/drivers.m4, - trunk/drv.c, trunk/drv_LCD2USB.c: + * [r624] [lcd4linux @ 2006-01-26 19:26:26 by harbaum] Added LCD2USB support 2006-01-23 reinelt - * [r623] trunk/Makefile.am, trunk/Makefile.in, trunk/layout.c, - trunk/lcd4linux.c, trunk/widget.h, trunk/widget_bar.c, - trunk/widget_icon.c, trunk/widget_image.c, trunk/widget_text.c, - trunk/widget_timer.c, trunk/widget_timer.h: + * [r623] [lcd4linux @ 2006-01-23 06:17:18 by reinelt] timer widget added 2006-01-22 reinelt - * [r622] trunk/widget_icon.c: + * [r622] [lcd4linux @ 2006-01-22 10:01:09 by reinelt] allow 'static' icons with speed=0 - * [r621] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drv_X11.c, trunk/widget_image.c, trunk/widget_image.h: + * [r621] [lcd4linux @ 2006-01-22 09:16:05 by reinelt] Image Widget framework added 2006-01-21 reinelt - * [r620] trunk/drv_G15.c: + * [r620] [lcd4linux @ 2006-01-21 17:43:25 by reinelt] minor cosmetic fixes - * [r619] trunk/drivers.m4: + * [r619] [lcd4linux @ 2006-01-21 15:25:02 by reinelt] GPIO subsystem in drivers.m4 added - * [r618] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, trunk/drv_G15.c, - trunk/lcd4linux.conf.sample: + * [r618] [lcd4linux @ 2006-01-21 13:26:43 by reinelt] Logitech G-15 keyboard LCD driver from Dave Ingram - * [r617] trunk/evaluator.c: + * [r617] [lcd4linux @ 2006-01-21 09:40:20 by reinelt] Big Memory Leak in Evaluator fixed (thanks to Oliver Gehrke) 2006-01-20 reinelt - * [r616] trunk/lcd4linux.conf.sample, trunk/plugin_mysql.c: + * [r616] [lcd4linux @ 2006-01-20 15:58:05 by reinelt] MySQL::count() added again - * [r615] trunk/plugin_mysql.c: + * [r615] [lcd4linux @ 2006-01-20 15:43:25 by reinelt] MySQL::query() returns a value, not the number of rows 2006-01-18 reinelt - * [r614] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h: + * [r614] [lcd4linux @ 2006-01-18 11:49:48 by reinelt] adopted to lcd-linux-0.9.2 2006-01-16 reinelt - * [r613] trunk/plugin_mysql.c: + * [r613] [lcd4linux @ 2006-01-16 15:39:58 by reinelt] MySQL::queryvalue() extension from Harald Klemm 2006-01-06 tooly-bln - * [r612] trunk/drv_LUIse.c: + * [r612] [lcd4linux @ 2006-01-06 16:56:49 by tooly-bln] 2006-01-06 reinelt - * [r611] trunk/drv_Crystalfontz.c, trunk/lcd4linux.conf.sample: + * [r611] [lcd4linux @ 2006-01-06 08:12:19 by reinelt] GPO's for Crystalfontz - * [r610] trunk/drv_RouterBoard.c: + * [r610] [lcd4linux @ 2006-01-06 07:06:57 by reinelt] GPO's for RouterBoard 2006-01-05 reinelt - * [r609] trunk/drv_HD44780.c, trunk/lcd4linux.conf.sample: + * [r609] [lcd4linux @ 2006-01-05 19:27:26 by reinelt] HD44780 power supply from parport - * [r608] trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_LPH7508.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_Sample.c, - trunk/drv_generic_gpio.c: + * [r608] [lcd4linux @ 2006-01-05 18:56:57 by reinelt] more GPO stuff 2006-01-05 nicowallmeier - * [r607] trunk/drv_BWCT.c: + * [r607] [lcd4linux @ 2006-01-05 15:53:45 by nicowallmeier] fixed compatility with gcc 2.95 2006-01-03 reinelt - * [r606] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv.c, trunk/drv_LUIse.c: + * [r606] [lcd4linux @ 2006-01-03 13:20:05 by reinelt] LUIse driver added - * [r605] trunk/drv_HD44780.c, trunk/drv_LPH7508.c, - trunk/drv_MatrixOrbital.c, trunk/drv_generic_gpio.c, - trunk/drv_generic_gpio.h, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/lcd4linux.conf.sample: + * [r605] [lcd4linux @ 2006-01-03 06:13:44 by reinelt] GPIO's for MatrixOrbital 2005-12-20 reinelt - * [r604] trunk/configure, trunk/drivers.m4, trunk/drv_HD44780.c, - trunk/drv_LPH7508.c, trunk/drv_generic_gpio.c, - trunk/lcd4linux.conf.sample: + * [r604] [lcd4linux @ 2005-12-20 07:07:43 by reinelt] further work on GPO's, HD44780 GPO support 2005-12-19 reinelt - * [r603] trunk/configure, trunk/drivers.m4, trunk/drv_Sample.c, - trunk/lcd4linux.conf.sample: + * [r603] [lcd4linux @ 2005-12-19 05:08:27 by reinelt] GPO's added to the Sample driver 2005-12-18 reinelt - * [r602] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drivers.m4, trunk/drv_LPH7508.c, trunk/drv_generic_gpio.c, - trunk/drv_generic_gpio.h, trunk/layout.c, - trunk/lcd4linux.conf.sample, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_gpo.c, trunk/widget_gpo.h, - trunk/widget_icon.c, trunk/widget_text.c: + * [r602] [lcd4linux @ 2005-12-18 16:18:34 by reinelt] GPO's added again 2005-12-13 reinelt - * [r601] trunk/drv_LPH7508.c, trunk/drv_generic_graphic.c, - trunk/lcd4linux.conf.sample: + * [r601] [lcd4linux @ 2005-12-13 14:07:28 by reinelt] LPH7508 driver finished 2005-12-12 reinelt - * [r600] trunk/drv_HD44780.c, trunk/lcd4linux.conf.sample, - trunk/udelay.c, trunk/udelay.h: + * [r600] [lcd4linux @ 2005-12-12 09:08:08 by reinelt] finally removed old udelay code path; read timing values from config - * [r599] trunk/drv_HD44780.c, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/lcd4linux.conf.sample: + * [r599] [lcd4linux @ 2005-12-12 05:52:03 by reinelt] type of delays is 'unsigned long' 2005-12-11 reinelt - * [r598] trunk/drv_BWCT.c, trunk/lcd4linux.conf.sample: + * [r598] [lcd4linux @ 2005-12-11 14:55:28 by reinelt] contrast range for BWCT is 0..255, not 0..100 2005-11-06 reinelt - * [r597] trunk/drv_generic_text.c, trunk/widget_icon.c: + * [r597] [lcd4linux @ 2005-11-06 09:54:43 by reinelt] fixed icon size removed, uses XRES & YRES (I hope this doesn't lead to problemes...) - * [r596] trunk/widget.c, trunk/widget.h, trunk/widget_icon.c: + * [r596] [lcd4linux @ 2005-11-06 09:17:20 by reinelt] re-use icons (thanks to Jesus de Santos Garcia) 2005-11-05 reinelt - * [r595] trunk/README.Drivers: + * [r595] [lcd4linux @ 2005-11-05 06:34:09 by reinelt] README.Drivers removed - * [r594] trunk/drv.c: + * [r594] [lcd4linux @ 2005-11-05 06:26:51 by reinelt] littly typo corrected 2005-11-04 reinelt - * [r593] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_LPH7508.c, trunk/drv_Sample.c: + * [r593] [lcd4linux @ 2005-11-04 14:10:38 by reinelt] drv_Sample and drv_LPH7508 - * [r592] trunk/README.Plugins: + * [r592] [lcd4linux @ 2005-11-04 05:39:33 by reinelt] README.Plugins removed - * [r591] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/plugin.c, trunk/plugin_sample.c, - trunk/plugins.m4: + * [r591] [lcd4linux @ 2005-11-04 04:53:08 by reinelt] sample plugin activated - * [r590] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Image.c, trunk/lcd4linux.conf.sample: + * [r590] [lcd4linux @ 2005-11-04 04:44:52 by reinelt] LPH7508 driver (not yet finished) 2005-10-02 reinelt - * [r589] trunk/configure, trunk/drv_HD44780.c: + * [r589] [lcd4linux @ 2005-10-02 07:58:48 by reinelt] HD44780 address setup time increased 2005-09-14 reinelt - * [r588] trunk/configure, trunk/drivers.m4: + * [r588] [lcd4linux @ 2005-09-14 15:08:32 by reinelt] fixed drivers.m4 to link generic text driver for several displays (thanks to Ludovic Gomez for pointing this out) 2005-09-07 reinelt - * [r587] trunk/drv_Crystalfontz.c: + * [r587] [lcd4linux @ 2005-09-07 06:51:44 by reinelt] Support for CF635 added 2005-09-02 reinelt - * [r586] trunk/lcd4linux.c: + * [r586] [lcd4linux @ 2005-09-02 05:27:08 by reinelt] double-fork daemonize patch from Petri Damsten 2005-08-27 reinelt - * [r585] trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/drivers.m4, trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h, - trunk/lcd4linux.conf.sample: + * [r585] [lcd4linux @ 2005-08-27 07:02:25 by reinelt] LCD-Linux updated to 0.9.0 2005-08-22 reinelt - * [r584] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_SimpleLCD.c, trunk/drv_WincorNixdorf.c, - trunk/drv_generic_text.c, trunk/lcd4linux.conf.sample: + * [r584] [lcd4linux @ 2005-08-22 05:44:43 by reinelt] new driver 'WincorNixdorf' some fixes to the bar code 2005-08-21 reinelt - * [r583] trunk/drv_Crystalfontz.c, trunk/drv_Trefon.c, - trunk/lcd4linux.conf.sample: + * [r583] [lcd4linux @ 2005-08-21 08:18:56 by reinelt] CrystalFontz ACK processing 2005-08-20 reinelt - * [r582] trunk/drv_Trefon.c, trunk/lcd4linux.conf.sample: + * [r582] [lcd4linux @ 2005-08-20 10:10:13 by reinelt] TREFON patch from Stephan Trautvetter: drv_TF_init: CHAR0 set to 0 instead of 1 @@ -1447,137 +1723,129 @@ 2005-07-06 reinelt - * [r581] trunk/drv_SimpleLCD.c, trunk/lcd4linux.conf.sample, - trunk/lcd4linux_i2c.h: + * [r581] [lcd4linux @ 2005-07-06 04:40:18 by reinelt] GCC-4 fixes 2005-06-19 reinelt - * [r580] trunk/drv_generic_parport.c, trunk/lcd4linux.conf.sample: + * [r580] [lcd4linux @ 2005-06-19 17:57:06 by reinelt] cosmetics... 2005-06-15 reinelt - * [r579] trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h: + * [r579] [lcd4linux @ 2005-06-15 05:24:35 by reinelt] updated LCD-Linux driver to version 0.8.9 2005-06-13 reinelt - * [r578] trunk/drv_generic_parport.c: + * [r578] [lcd4linux @ 2005-06-13 03:43:46 by reinelt] undo PPEXCL activation... - * [r577] trunk/drv_generic_parport.c: + * [r577] [lcd4linux @ 2005-06-13 03:38:25 by reinelt] try PPEXCL again, but ignore result 2005-06-11 reinelt - * [r576] trunk/configure, trunk/configure.in: + * [r576] [lcd4linux @ 2005-06-11 10:57:45 by reinelt] changed version to 0.10.1-CVS - * [r575] trunk/ChangeLog: + * [r575] [lcd4linux @ 2005-06-11 04:14:05 by reinelt] final 0.10.0 release, Changelog updated 2005-06-10 reinelt - * [r574] trunk/config.h.in, trunk/configure, trunk/configure.in: + * [r574] [lcd4linux @ 2005-06-10 11:22:28 by reinelt] double-check for X11 headers (AC_PATH_XTRA is buggy) - * [r573] trunk/depcomp: + * [r573] [lcd4linux @ 2005-06-10 09:51:44 by reinelt] depcomp removed - * [r572] trunk/ChangeLog: + * [r572] [lcd4linux @ 2005-06-10 05:02:28 by reinelt] ChangeLog - * [r571] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in: + * [r571] [lcd4linux @ 2005-06-10 05:00:36 by reinelt] version number set to 0.10.0 - * [r570] trunk/ltmain.sh: + * [r570] [lcd4linux @ 2005-06-10 04:54:10 by reinelt] removed ltmain.sh - * [r569] trunk/libtool: + * [r569] [lcd4linux @ 2005-06-10 04:53:44 by reinelt] removed libtool and ltmain.sh 2005-06-09 reinelt - * [r568] trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/lcd4linux.conf.sample: + * [r568] [lcd4linux @ 2005-06-09 17:41:47 by reinelt] M50530 fixes (many thanks to Szymon Bieganski) 2005-06-06 reinelt - * [r567] trunk/lcd4linux.conf.sample, trunk/plugin_mysql.c: + * [r567] [lcd4linux @ 2005-06-06 09:24:07 by reinelt] two bugs in plugin_mysql.c fixed 2005-06-03 reinelt - * [r566] trunk/configure, trunk/configure.in, trunk/python.m4: + * [r566] [lcd4linux @ 2005-06-03 17:04:52 by reinelt] hopefully solved the AM_PYTHON_PATH issue finally - * [r565] trunk/configure, trunk/configure.in, trunk/python.m4: + * [r565] [lcd4linux @ 2005-06-03 04:45:57 by reinelt] renamed AM_PYTHON to MY_PYTHON... 2005-06-01 reinelt - * [r564] trunk/drv_generic_i2c.c: + * [r564] [lcd4linux @ 2005-06-01 12:50:25 by reinelt] ifdef'ed unused function to avoid compiler warning - * [r563] trunk/configure, trunk/configure.in, trunk/curses.m4, - trunk/plugins.m4: + * [r563] [lcd4linux @ 2005-06-01 12:46:31 by reinelt] --with-python added to configure - * [r562] trunk/aclocal.m4, trunk/config.h.in, trunk/configure, - trunk/lcd4linux.conf.sample, trunk/lcd4linux_i2c.h: + * [r562] [lcd4linux @ 2005-06-01 12:09:11 by reinelt] removed ^M from lcd4linux_i2c.h; indent.sh run 2005-06-01 pk_richman - * [r561] trunk/drv_HD44780.c: + * [r561] [lcd4linux @ 2005-06-01 11:17:54 by pk_richman] marked unused parameters 2005-05-31 lfcorreia - * [r560] trunk/AUTHORS, trunk/debian/copyright, - trunk/drv_generic_i2c.h: + * [r560] [lcd4linux @ 2005-05-31 21:30:56 by lfcorreia] fix my email address - * [r559] trunk/drv_HD44780.c: + * [r559] [lcd4linux @ 2005-05-31 21:28:42 by lfcorreia] fix typo - * [r558] trunk/drv_HD44780.c: + * [r558] [lcd4linux @ 2005-05-31 21:26:56 by lfcorreia] fix my email address - * [r557] trunk/configure.in: + * [r557] [lcd4linux @ 2005-05-31 21:06:36 by lfcorreia] replace the accidently deleted Python detection code - * [r556] trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/drivers.m4, trunk/drv_HD44780.c, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/lcd4linux_i2c.h: + * [r556] [lcd4linux @ 2005-05-31 20:42:54 by lfcorreia] new file: lcd4linux_i2c.h avoid the problems detecting the proper I2C kernel include files @@ -1588,143 +1856,79 @@ 2005-05-28 reinelt - * [r555] trunk/plugins.m4: + * [r555] [lcd4linux @ 2005-05-28 09:08:30 by reinelt] fixed plugins.m4 bug found by Martin - * [r554] trunk/drv_serdisplib.c, trunk/lcd4linux.conf.sample: + * [r554] [lcd4linux @ 2005-05-28 09:06:14 by reinelt] serdisplib cosmetics 2005-05-13 reinelt - * [r553] trunk/ChangeLog: + * [r553] [lcd4linux @ 2005-05-13 05:44:44 by reinelt] ChangeLog updated - * [r552] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in: + * [r552] [lcd4linux @ 2005-05-13 05:43:25 by reinelt] added drv_LCDLinux.h to extra_sources 2005-05-12 reinelt - * [r551] trunk/drv_serdisplib.c, trunk/indent.sh: + * [r551] [lcd4linux @ 2005-05-12 14:55:47 by reinelt] plugins for serdisplib driver - * [r550] trunk/drv_serdisplib.c: + * [r550] [lcd4linux @ 2005-05-12 05:52:43 by reinelt] serdisplib GET_VERSION_MAJOR macro 2005-05-11 reinelt - * [r549] trunk/drv_serdisplib.c: + * [r549] [lcd4linux @ 2005-05-11 04:27:49 by reinelt] small serdisplib bugs fixed 2005-05-10 reinelt - * [r548] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv.c, trunk/drv_serdisplib.c, trunk/lcd4linux.conf.sample: + * [r548] [lcd4linux @ 2005-05-10 13:20:10 by reinelt] added serdisplib driver 2005-05-08 reinelt - * [r547] trunk/CodingStyle, trunk/cfg.c, trunk/cfg.h, - trunk/configure, trunk/debug.c, trunk/debug.h, trunk/drv.c, - trunk/drv.h, trunk/drv_BWCT.c, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, trunk/drv_Image.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h, trunk/drv_LCDTerm.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_Noritake.c, trunk/drv_RouterBoard.c, - trunk/drv_SimpleLCD.c, trunk/drv_T6963.c, trunk/drv_Trefon.c, - trunk/drv_USBLCD.c, trunk/drv_X11.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/drv_generic_serial.c, - trunk/drv_generic_serial.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/evaluator.c, trunk/evaluator.h, - trunk/font_6x8.h, trunk/hash.c, trunk/hash.h, trunk/indent.sh, - trunk/layout.c, trunk/lcd4linux.c, trunk/pid.c, trunk/pid.h, - trunk/plugin.c, trunk/plugin.h, trunk/plugin_apm.c, - trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_diskstats.c, trunk/plugin_dvb.c, - trunk/plugin_exec.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_loadavg.c, - trunk/plugin_math.c, trunk/plugin_meminfo.c, - trunk/plugin_mysql.c, trunk/plugin_netdev.c, trunk/plugin_pop3.c, - trunk/plugin_ppp.c, trunk/plugin_proc_stat.c, - trunk/plugin_python.c, trunk/plugin_sample.c, - trunk/plugin_seti.c, trunk/plugin_statfs.c, - trunk/plugin_string.c, trunk/plugin_test.c, trunk/plugin_time.c, - trunk/plugin_uname.c, trunk/plugin_uptime.c, - trunk/plugin_wireless.c, trunk/plugin_xmms.c, trunk/qprintf.c, - trunk/thread.c, trunk/thread.h, trunk/timer.c, trunk/timer.h, - trunk/udelay.c, trunk/udelay.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_icon.c, - trunk/widget_icon.h, trunk/widget_text.c, trunk/widget_text.h: + * [r547] [lcd4linux @ 2005-05-08 04:32:43 by reinelt] CodingStyle added and applied 2005-05-06 reinelt - * [r546] trunk/python.m4: + * [r546] [lcd4linux @ 2005-05-06 06:41:53 by reinelt] python2.4 added to python.m4 - * [r545] trunk/drv_generic_text.c, trunk/widget_bar.c, - trunk/widget_bar.h: + * [r545] [lcd4linux @ 2005-05-06 06:37:34 by reinelt] hollow bar patch from geronet - * [r544] trunk/documentation/drivers/Makefile, - trunk/documentation/drivers/index.xml, - trunk/documentation/dtd/doc.dtd, - trunk/documentation/dtd/references.dtd, - trunk/documentation/dtd/xhtml-lat1.ent, - trunk/documentation/dtd/xhtml-special.ent, - trunk/documentation/dtd/xhtml-symbol.ent, - trunk/documentation/lcd4linux/Makefile, - trunk/documentation/lcd4linux/bug_report.xml, - trunk/documentation/lcd4linux/example.xml, - trunk/documentation/lcd4linux/index.xml, - trunk/documentation/lcd4linux/write_doc.xml, - trunk/documentation/plugins/Makefile, - trunk/documentation/plugins/index.xml, - trunk/documentation/xsl/body.xsl, - trunk/documentation/xsl/doc.xsl, - trunk/documentation/xsl/head.xsl, - trunk/documentation/xsl/helpers.xsl, - trunk/documentation/xsl/references.xsl, - trunk/documentation/xsl/xhtml.xsl: + * [r544] [lcd4linux @ 2005-05-06 05:40:02 by reinelt] remove documentation pass#2 - * [r543] trunk/documentation/Makefile, - trunk/documentation/Makefile.generic, - trunk/documentation/data/doc.css, - trunk/documentation/data/images/note-icon.png, - trunk/documentation/data/images/warn-icon.png, - trunk/documentation/data/references.xml: + * [r543] [lcd4linux @ 2005-05-06 05:36:58 by reinelt] removed documentation again :-( 2005-05-05 reinelt - * [r542] trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/drv_Noritake.c, trunk/drv_T6963.c, - trunk/drv_generic_parport.c, trunk/lcd4linux.conf.sample: + * [r542] [lcd4linux @ 2005-05-05 08:36:12 by reinelt] changed SELECT to SLCTIN 2005-05-04 obconseil - * [r541] trunk/drv_Noritake.c: + * [r541] [lcd4linux @ 2005-05-04 07:18:44 by obconseil] Driver modified according to Michels's recommendations : @@ -1740,17 +1944,15 @@ 2005-05-04 reinelt - * [r540] trunk/drv_generic_parport.c, trunk/drv_generic_parport.h: + * [r540] [lcd4linux @ 2005-05-04 06:13:05 by reinelt] parport_wire_status() added - * [r539] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Noritake.c: + * [r539] [lcd4linux @ 2005-05-04 05:42:37 by reinelt] Noritake driver added - * [r538] trunk/plugin_python.c: + * [r538] [lcd4linux @ 2005-05-04 05:22:12 by reinelt] * replaced fprintf(stderr,... with error() * corrected a "dangling reference" memory problem @@ -1762,8 +1964,7 @@ 2005-05-03 reinelt - * [r537] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/drivers.m4, trunk/plugin_python.c, trunk/plugins.m4: + * [r537] [lcd4linux @ 2005-05-03 11:13:23 by reinelt] rearranged autoconf a bit, libX11 will be linked only if really needed (i.e. when the X11 @@ -1772,44 +1973,37 @@ 2005-05-02 reinelt - * [r536] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/plugin.c, - trunk/plugin_python.c, trunk/plugins.m4, trunk/python.m4: + * [r536] [lcd4linux @ 2005-05-02 10:29:20 by reinelt] preparations for python bindings and python plugin - * [r535] trunk/cfg.c, trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h, - trunk/lcd4linux.conf.sample: + * [r535] [lcd4linux @ 2005-05-02 05:15:46 by reinelt] make busy-flag checking configurable for LCD-Linux driver 2005-04-30 reinelt - * [r534] trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h, - trunk/lcd4linux.conf.sample: + * [r534] [lcd4linux @ 2005-04-30 06:02:09 by reinelt] LCD-Linux display size set up from lcd4linux.conf 2005-04-24 reinelt - * [r533] trunk/drv_Trefon.c, trunk/lcd4linux.conf.sample: + * [r533] [lcd4linux @ 2005-04-24 05:27:09 by reinelt] Trefon Backlight added - * [r532] trunk/ChangeLog: + * [r532] [lcd4linux @ 2005-04-24 04:41:28 by reinelt] Changelog updated - * [r531] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Trefon.c, trunk/drv_USBLCD.c, - trunk/lcd4linux.conf.sample: + * [r531] [lcd4linux @ 2005-04-24 04:33:46 by reinelt] driver for TREFON USB LCD's added 2005-04-20 reinelt - * [r530] trunk/drv_SimpleLCD.c: + * [r530] [lcd4linux @ 2005-04-20 05:49:21 by reinelt] Changed the code to add some VT100-compatible control sequences (see the comments above). @@ -1819,407 +2013,283 @@ 2005-04-09 reinelt - * [r529] trunk/drv_LCDLinux.c, trunk/drv_LCDLinux.h: + * [r529] [lcd4linux @ 2005-04-09 07:36:42 by reinelt] updated LCD-Linux driver to version 0.8.8 2005-04-05 reinelt - * [r528] trunk/configure, trunk/configure.in, trunk/plugins.m4: + * [r528] [lcd4linux @ 2005-04-05 06:57:39 by reinelt] AC_CHECK_HEADERS corrected - * [r527] trunk/configure, trunk/configure.in, - trunk/drv_generic_i2c.c, trunk/lcd4linux.conf.sample: + * [r527] [lcd4linux @ 2005-04-05 05:12:48 by reinelt] i2c patch from Paul (still does not work here :-( - * [r526] trunk/plugin_math.c: + * [r526] [lcd4linux @ 2005-04-05 04:46:06 by reinelt] ceil/floor patch from Maxime 2005-04-04 nicowallmeier - * [r525] trunk/plugin_imon.c: + * [r525] [lcd4linux @ 2005-04-04 20:11:14 by nicowallmeier] to be compatible with gcc 2.95 2005-04-03 reinelt - * [r524] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/plugin.c, - trunk/plugin_statfs.c, trunk/plugins.m4: + * [r524] [lcd4linux @ 2005-04-03 07:07:43 by reinelt] added statfs plugin 2005-04-02 reinelt - * [r523] trunk/drv_Crystalfontz.c, trunk/drv_SimpleLCD.c, - trunk/drv_USBLCD.c: + * [r523] [lcd4linux @ 2005-04-02 05:28:58 by reinelt] fixed gcc4 warnings about signed/unsigned mismatches 2005-04-01 reinelt - * [r522] trunk/lcd4linux.conf.sample, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_mysql.c, trunk/plugin_pop3.c: + * [r522] [lcd4linux @ 2005-04-01 05:16:04 by reinelt] moved plugin init stuff to a seperate function called on first use 2005-03-30 reinelt - * [r521] trunk/evaluator.c, trunk/lcd4linux.c, trunk/plugin_cfg.c: + * [r521] [lcd4linux @ 2005-03-30 04:57:50 by reinelt] Evaluator speedup: use bsearch for finding functions and variables 2005-03-28 reinelt - * [r520] trunk/drv_HD44780.c: + * [r520] [lcd4linux @ 2005-03-28 22:29:23 by reinelt] HD44780 multiple displays patch from geronet - * [r519] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv_HD44780.c, trunk/drv_generic_i2c.c, - trunk/drv_generic_i2c.h: + * [r519] [lcd4linux @ 2005-03-28 19:39:14 by reinelt] HD44780/I2C patch from Luis merged (still does not work for me) 2005-03-25 reinelt - * [r518] trunk/drv_HD44780.c: + * [r518] [lcd4linux @ 2005-03-25 15:44:43 by reinelt] HD44780 Backlight fixed (thanks to geronet) 2005-03-23 reinelt - * [r517] trunk/drv_Crystalfontz.c: + * [r517] [lcd4linux @ 2005-03-23 12:23:35 by reinelt] fixed some signed/unsigned char mismatches in the Crystalfontz driver (ticket #12) 2005-02-24 reinelt - * [r516] trunk/ChangeLog: + * [r516] [lcd4linux @ 2005-02-24 07:07:55 by reinelt] ChangeLog - * [r515] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Crystalfontz.c, trunk/drv_LCDLinux.c, - trunk/drv_SimpleLCD.c, trunk/drv_generic_text.c, - trunk/lcd4linux.conf.sample: + * [r515] [lcd4linux @ 2005-02-24 07:06:45 by reinelt] SimpleLCD driver added - * [r514] trunk/drv_LCDLinux.c: + * [r514] [lcd4linux @ 2005-02-24 06:51:40 by reinelt] LCD-Linux driver GOTO_COST corrected 2005-01-30 reinelt - * [r513] trunk/drv.c, trunk/drv_LCDLinux.c, trunk/drv_USBLCD.c, - trunk/lcd4linux.conf.sample: + * [r513] [lcd4linux @ 2005-01-30 06:43:22 by reinelt] driver for LCD-Linux finished 2005-01-29 reinelt - * [r512] trunk/drv_HD44780.c: + * [r512] [lcd4linux @ 2005-01-29 09:30:56 by reinelt] minor HD44780 cleanups 2005-01-22 reinelt - * [r511] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_LCDLinux.c, trunk/drv_LCDTerm.c, - trunk/lcd4linux.conf.sample: + * [r511] [lcd4linux @ 2005-01-22 22:57:57 by reinelt] LCD-Linux driver added - * [r510] trunk/drv_MatrixOrbital.c: + * [r510] [lcd4linux @ 2005-01-22 12:44:41 by reinelt] MatrixOrbital backlight micro-fix 2005-01-18 reinelt - * [r509] trunk/cfg.c, trunk/cfg.h, trunk/configure, - trunk/configure.in, trunk/debug.c, trunk/debug.h, - trunk/drivers.m4, trunk/drv.c, trunk/drv.h, trunk/drv_BWCT.c, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_Image.c, trunk/drv_LCDTerm.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_NULL.c, trunk/drv_RouterBoard.c, trunk/drv_T6963.c, - trunk/drv_USBLCD.c, trunk/drv_X11.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_graphic.h, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/drv_generic_serial.c, - trunk/drv_generic_serial.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/evaluator.c, trunk/evaluator.h, - trunk/font_6x8.h, trunk/hash.c, trunk/hash.h, trunk/layout.c, - trunk/layout.h, trunk/lcd4linux.c, trunk/lcd4linux.xpm, - trunk/pid.c, trunk/pid.h, trunk/plugin.c, trunk/plugin.h, - trunk/plugin_apm.c, trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_diskstats.c, trunk/plugin_dvb.c, - trunk/plugin_exec.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_loadavg.c, - trunk/plugin_math.c, trunk/plugin_meminfo.c, - trunk/plugin_mysql.c, trunk/plugin_netdev.c, trunk/plugin_pop3.c, - trunk/plugin_ppp.c, trunk/plugin_proc_stat.c, - trunk/plugin_sample.c, trunk/plugin_seti.c, - trunk/plugin_string.c, trunk/plugin_test.c, trunk/plugin_time.c, - trunk/plugin_uname.c, trunk/plugin_uptime.c, - trunk/plugin_wireless.c, trunk/plugin_xmms.c, trunk/plugins.m4, - trunk/qprintf.c, trunk/qprintf.h, trunk/thread.c, trunk/thread.h, - trunk/timer.c, trunk/timer.h, trunk/udelay.c, trunk/udelay.h, - trunk/widget.c, trunk/widget.h, trunk/widget_bar.c, - trunk/widget_bar.h, trunk/widget_icon.c, trunk/widget_icon.h, - trunk/widget_text.c, trunk/widget_text.h: + * [r509] [lcd4linux @ 2005-01-18 06:30:21 by reinelt] added (C) to all copyright statements 2005-01-17 reinelt - * [r508] trunk/drv_HD44780.c: + * [r508] [lcd4linux @ 2005-01-17 06:38:48 by reinelt] info about backlight and brightness - * [r507] trunk/cfg.c, trunk/drv_HD44780.c, - trunk/lcd4linux.conf.sample: + * [r507] [lcd4linux @ 2005-01-17 06:29:24 by reinelt] added software-controlled backlight support to HD44780 2005-01-15 reinelt - * [r506] trunk/drv_LCDTerm.c: + * [r506] [lcd4linux @ 2005-01-15 13:13:57 by reinelt] LCDTerm driver added, take 2 - * [r505] trunk/lcd4linux.conf.sample: + * [r505] [lcd4linux @ 2005-01-15 13:13:21 by reinelt] LCDTerm section added to lcd4linux.conf.sample - * [r504] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv.c, trunk/lcd4linux.conf.sample: + * [r504] [lcd4linux @ 2005-01-15 13:10:13 by reinelt] LCDTerm driver added 2005-01-11 reinelt - * [r503] trunk/lcd4linux.conf.sample: + * [r503] [lcd4linux @ 2005-01-11 10:25:26 by reinelt] further changes to lcd4linux.conf.sample - * [r502] trunk/lcd4linux.conf.sample, trunk/plugin_proc_stat.c: + * [r502] [lcd4linux @ 2005-01-11 10:19:33 by reinelt] changes to lcd4linux.conf.sample 2005-01-09 reinelt - * [r501] trunk/ChangeLog: + * [r501] [lcd4linux @ 2005-01-09 10:57:25 by reinelt] ChangeLog updated - * [r500] trunk/CREDITS, trunk/README, trunk/configure, - trunk/configure.in, trunk/drv_generic_graphic.c, - trunk/drv_generic_text.c, trunk/plugin_uname.c: + * [r500] [lcd4linux @ 2005-01-09 10:53:22 by reinelt] small type in plugin_uname fixed new homepage lcd4linux.bulix.org 2005-01-06 reinelt - * [r499] trunk/drv_M50530.c, trunk/drv_generic_parport.c, - trunk/lcd4linux.conf.sample: + * [r499] [lcd4linux @ 2005-01-06 16:54:53 by reinelt] M50530 fixes 2004-12-22 reinelt - * [r498] trunk/configure, trunk/configure.in, trunk/drv_T6963.c, - trunk/drv_USBLCD.c: + * [r498] [lcd4linux @ 2004-12-22 20:24:00 by reinelt] T6963 fix for displays > 8 rows 2004-11-30 reinelt - * [r497] trunk/drv_HD44780.c: + * [r497] [lcd4linux @ 2004-11-30 05:01:25 by reinelt] removed compiler warnings for deactivated i2c bus 2004-11-29 reinelt - * [r496] trunk/cfg.c, trunk/drv_Image.c, trunk/drv_X11.c, - trunk/widget_bar.c, trunk/widget_text.c: + * [r496] [lcd4linux @ 2004-11-29 04:42:06 by reinelt] removed the 99999 msec limit on widget update time (thanks to Petri Damsten) 2004-11-28 reinelt - * [r495] trunk/drv_Cwlinux.c, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/lcd4linux.conf.sample, - trunk/widget_icon.c: + * [r495] [lcd4linux @ 2004-11-28 15:50:24 by reinelt] Cwlinux fixes (invalidation of user-defined chars) 2004-10-17 reinelt - * [r494] trunk/drv_HD44780.c, trunk/drv_generic_parport.h, - trunk/lcd4linux.conf.sample: + * [r494] [lcd4linux @ 2004-10-17 09:24:31 by reinelt] I2C support for HD44780 displays by Luis (does not work by now) 2004-10-02 reinelt - * [r493] trunk/configure, trunk/drivers.m4, trunk/drv_USBLCD.c, - trunk/lcd4linux.conf.sample: + * [r493] [lcd4linux @ 2004-10-02 09:31:55 by reinelt] USBLCD driver modified to use libusb 2004-09-24 reinelt - * [r492] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv.c, trunk/drv_BWCT.c, trunk/drv_USBLCD.c, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, - trunk/plugin_exec.c: + * [r492] [lcd4linux @ 2004-09-24 21:40:52 by reinelt] new driver for the BWCT USB LCD interface board. 2004-09-19 reinelt - * [r491] trunk/drv_HD44780.c, trunk/lcd4linux.conf.sample, - trunk/timer.c: + * [r491] [lcd4linux @ 2004-09-19 09:31:19 by reinelt] HD44780 busy flag checking improved: fall back to busy-waiting if too many errors occur 2004-09-18 reinelt - * [r490] trunk/drv_HD44780.c, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/lcd4linux.conf.sample: + * [r490] [lcd4linux @ 2004-09-18 15:58:57 by reinelt] even more HD44780 cleanups, hardwiring for LCM-162 - * [r489] trunk/drv_HD44780.c: + * [r489] [lcd4linux @ 2004-09-18 10:57:29 by reinelt] more parport/i2c cleanups - * [r488] trunk/drv_HD44780.c, trunk/drv_generic_parport.c, - trunk/lcd4linux.conf.sample, trunk/udelay.c: + * [r488] [lcd4linux @ 2004-09-18 09:48:29 by reinelt] HD44780 cleanup and prepararation for I2C backend LCM-162 submodel framework - * [r487] trunk/drv_HD44780.c, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/lcd4linux.conf.sample: + * [r487] [lcd4linux @ 2004-09-18 08:22:59 by reinelt] drv_generic_parport_status() to read status lines 2004-08-30 rjoco77 - * [r486] trunk/drv_RouterBoard.c: + * [r486] [lcd4linux @ 2004-08-30 12:48:52 by rjoco77] * Added backlight update immediatelly 2004-08-29 reinelt - * [r485] trunk/drv_RouterBoard.c: + * [r485] [lcd4linux @ 2004-08-29 20:07:55 by reinelt] Patch from Joco: Make RouterBoard Backlight configurable - * [r484] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_HD44780.c, trunk/drv_RouterBoard.c, - trunk/lcd4linux.conf.sample: + * [r484] [lcd4linux @ 2004-08-29 13:03:40 by reinelt] added RouterBoard driver 2004-07-14 reinelt - * [r483] trunk/drv_BeckmannEgle.c, trunk/lcd4linux.conf.sample: + * [r483] [lcd4linux @ 2004-07-14 04:44:44 by reinelt] Beckmann+Egle fix added smaple widget for the PPP plugin 2004-06-29 reinelt - * [r482] trunk/drv_BeckmannEgle.c: + * [r482] [lcd4linux @ 2004-06-29 04:49:30 by reinelt] B+E enhanced port detection 2004-06-26 reinelt - * [r481] trunk/cfg.c, trunk/debug.c, trunk/drv.c, trunk/drv.h, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_Image.c, trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_T6963.c, trunk/drv_USBLCD.c, trunk/drv_X11.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_parport.c, trunk/drv_generic_parport.h, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/evaluator.c, trunk/evaluator.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/lcd4linux.c, trunk/pid.c, trunk/plugin.c, - trunk/plugin_apm.c, trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_diskstats.c, trunk/plugin_dvb.c, - trunk/plugin_exec.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_loadavg.c, - trunk/plugin_math.c, trunk/plugin_meminfo.c, - trunk/plugin_netdev.c, trunk/plugin_pop3.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_sample.c, - trunk/plugin_seti.c, trunk/plugin_string.c, trunk/plugin_test.c, - trunk/plugin_time.c, trunk/plugin_uptime.c, - trunk/plugin_wireless.c, trunk/plugin_xmms.c, trunk/qprintf.c, - trunk/qprintf.h, trunk/timer.c, trunk/udelay.h, trunk/widget.c, - trunk/widget.h, trunk/widget_bar.c, trunk/widget_bar.h, - trunk/widget_icon.c, trunk/widget_icon.h, trunk/widget_text.c, - trunk/widget_text.h: + * [r481] [lcd4linux @ 2004-06-26 12:04:59 by reinelt] uh-oh... the last CVS log message messed up things a lot... - * [r480] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/debug.c, trunk/drv.c, trunk/drv.h, - trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_Image.c, trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_T6963.c, trunk/drv_USBLCD.c, trunk/drv_X11.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_parport.c, trunk/drv_generic_parport.h, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/evaluator.c, trunk/evaluator.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/lcd4linux.c, trunk/pid.c, trunk/plugin.c, - trunk/plugin_apm.c, trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_diskstats.c, trunk/plugin_dvb.c, - trunk/plugin_exec.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, trunk/plugin_loadavg.c, - trunk/plugin_math.c, trunk/plugin_meminfo.c, - trunk/plugin_netdev.c, trunk/plugin_pop3.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_sample.c, - trunk/plugin_seti.c, trunk/plugin_string.c, trunk/plugin_test.c, - trunk/plugin_time.c, trunk/plugin_uptime.c, - trunk/plugin_wireless.c, trunk/plugin_xmms.c, trunk/qprintf.c, - trunk/qprintf.h, trunk/timer.c, trunk/udelay.h, trunk/widget.c, - trunk/widget.h, trunk/widget_bar.c, trunk/widget_bar.h, - trunk/widget_icon.c, trunk/widget_icon.h, trunk/widget_text.c, - trunk/widget_text.h: + * [r480] [lcd4linux @ 2004-06-26 09:27:20 by reinelt] added '-W' to CFLAGS changed all C++ comments to C ones ('//' => '/* */') cleaned up a lot of signed/unsigned mistakes - * [r479] trunk/Makefile.in, trunk/drv_BeckmannEgle.c, - trunk/drv_MatrixOrbital.c, trunk/drv_USBLCD.c, - trunk/drv_generic_serial.c, trunk/drv_generic_text.c, - trunk/lcd4linux.conf.sample: + * [r479] [lcd4linux @ 2004-06-26 06:12:14 by reinelt] support for Beckmann+Egle Compact Terminals some mostly cosmetic changes in the MatrixOrbital and USBLCD @@ -2231,255 +2301,157 @@ 2004-06-24 nicowallmeier - * [r478] trunk/plugin_imon.c: + * [r478] [lcd4linux @ 2004-06-24 20:18:08 by nicowallmeier] minor bugfix 2004-06-20 reinelt - * [r477] trunk/ChangeLog: + * [r477] [lcd4linux @ 2004-06-20 10:12:27 by reinelt] ChangeLog updated - * [r476] trunk/cfg.c, trunk/cfg.h, trunk/debug.c, trunk/debug.h, - trunk/drv.c, trunk/drv.h, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, trunk/drv_Image.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_T6963.c, trunk/drv_USBLCD.c, trunk/drv_X11.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_parport.c, trunk/drv_generic_parport.h, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/evaluator.c, trunk/evaluator.h, trunk/hash.c, trunk/hash.h, - trunk/layout.c, trunk/layout.h, trunk/plugin_cfg.c, - trunk/plugin_exec.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_imon.c, trunk/plugin_isdn.c, - trunk/plugin_proc_stat.c, trunk/plugin_uptime.c, - trunk/plugin_wireless.c, trunk/qprintf.c, trunk/thread.c, - trunk/thread.h, trunk/timer.c, trunk/timer.h, trunk/udelay.c, - trunk/udelay.h, trunk/widget.c, trunk/widget.h, - trunk/widget_icon.c: + * [r476] [lcd4linux @ 2004-06-20 10:09:52 by reinelt] 'const'ified the whole source 2004-06-19 reinelt - * [r475] trunk/drv_Image.c, trunk/drv_USBLCD.c: + * [r475] [lcd4linux @ 2004-06-19 08:20:19 by reinelt] compiler warning in image driver fixed bar bug in USBLCD driver fixed 2004-06-17 reinelt - * [r474] trunk/lcd4linux.conf.sample, trunk/plugin_diskstats.c, - trunk/plugin_netdev.c: + * [r474] [lcd4linux @ 2004-06-17 10:58:57 by reinelt] changed plugin_netdev to use the new fast hash model - * [r473] trunk/drv_T6963.c, trunk/hash.c, trunk/hash.h, - trunk/lcd4linux.conf.sample, trunk/plugin_apm.c, - trunk/plugin_cpuinfo.c, trunk/plugin_diskstats.c, - trunk/plugin_dvb.c, trunk/plugin_exec.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_imon.c, - trunk/plugin_isdn.c, trunk/plugin_meminfo.c, - trunk/plugin_netdev.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/plugin_seti.c, - trunk/plugin_wireless.c, trunk/plugin_xmms.c: + * [r473] [lcd4linux @ 2004-06-17 06:23:39 by reinelt] hash handling rewritten to solve performance issues 2004-06-13 reinelt - * [r472] trunk/hash.c, trunk/hash.h, trunk/lcd4linux.conf.sample: + * [r472] [lcd4linux @ 2004-06-13 01:12:52 by reinelt] debug widgets changed (thanks to Andy Baxter) 2004-06-09 reinelt - * [r471] trunk/drv_T6963.c, trunk/drv_generic_graphic.c, - trunk/lcd4linux.conf.sample: + * [r471] [lcd4linux @ 2004-06-09 06:40:29 by reinelt] splash screen for T6963 driver 2004-06-08 reinelt - * [r470] trunk/Makefile.in, trunk/drv_X11.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/lcd4linux.conf.sample: + * [r470] [lcd4linux @ 2004-06-08 21:46:38 by reinelt] splash screen for X11 driver (and generic graphic driver) - * [r469] trunk/Makefile.in, trunk/aclocal.m4, trunk/bootstrap, - trunk/config.h.in, trunk/configure, trunk/configure.in: + * [r469] [lcd4linux @ 2004-06-08 12:35:24 by reinelt] autoconf/automake updates 2004-06-07 reinelt - * [r468] trunk/lcd4linux.conf.sample: + * [r468] [lcd4linux @ 2004-06-07 07:02:13 by reinelt] sample debugging widgets added - * [r467] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/plugin.c, trunk/plugin_test.c: + * [r467] [lcd4linux @ 2004-06-07 06:56:55 by reinelt] added test plugin from Andy Baxter 2004-06-06 reinelt - * [r466] trunk/drv.c, trunk/drv.h, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, trunk/drv_Image.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_T6963.c, trunk/drv_USBLCD.c, trunk/drv_X11.c, - trunk/lcd4linux.c: + * [r466] [lcd4linux @ 2004-06-06 06:51:59 by reinelt] do not display end splash screen if quiet=1 2004-06-05 reinelt - * [r465] trunk/drv_Cwlinux.c, trunk/drv_USBLCD.c, - trunk/plugin_i2c_sensors.c: + * [r465] [lcd4linux @ 2004-06-05 14:56:48 by reinelt] Cwlinux splash screen fixed USBLCD splash screen fixed plugin_i2c qprintf("%f") replaced with snprintf() - * [r464] trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_USBLCD.c, - trunk/drv_generic_text.c, trunk/drv_generic_text.h: + * [r464] [lcd4linux @ 2004-06-05 06:41:39 by reinelt] chancged splash screen again - * [r463] trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_USBLCD.c: + * [r463] [lcd4linux @ 2004-06-05 06:13:11 by reinelt] splash screen for all text-based display drivers 2004-06-02 reinelt - * [r462] trunk/drv.c, trunk/drv_HD44780.c, - trunk/drv_generic_text.c, trunk/drv_generic_text.h: + * [r462] [lcd4linux @ 2004-06-02 10:09:22 by reinelt] splash screen for HD44780 - * [r461] trunk/drv.c, trunk/drv.h, trunk/drv_BeckmannEgle.c, - trunk/drv_Crystalfontz.c, trunk/drv_Curses.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, trunk/drv_Image.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_NULL.c, - trunk/drv_T6963.c, trunk/drv_USBLCD.c, trunk/drv_X11.c, - trunk/layout.c, trunk/lcd4linux.c, trunk/lcd4linux.conf.sample: + * [r461] [lcd4linux @ 2004-06-02 09:41:19 by reinelt] prepared support for startup splash screen - * [r460] trunk/drv_Crystalfontz.c: + * [r460] [lcd4linux @ 2004-06-02 05:56:25 by reinelt] extended contrast range for Crystalfontz - * [r459] trunk/lcd4linux.conf.sample: + * [r459] [lcd4linux @ 2004-06-02 05:35:55 by reinelt] added i2c_sensors example to lcd4linux.conf.sample - * [r458] trunk/documentation, trunk/documentation/Makefile, - trunk/documentation/Makefile.generic, trunk/documentation/data, - trunk/documentation/data/doc.css, - trunk/documentation/data/images, - trunk/documentation/data/images/note-icon.png, - trunk/documentation/data/images/warn-icon.png, - trunk/documentation/data/references.xml, - trunk/documentation/drivers, - trunk/documentation/drivers/Makefile, - trunk/documentation/drivers/index.xml, trunk/documentation/dtd, - trunk/documentation/dtd/doc.dtd, - trunk/documentation/dtd/references.dtd, - trunk/documentation/dtd/xhtml-lat1.ent, - trunk/documentation/dtd/xhtml-special.ent, - trunk/documentation/dtd/xhtml-symbol.ent, - trunk/documentation/lcd4linux, - trunk/documentation/lcd4linux/Makefile, - trunk/documentation/lcd4linux/bug_report.xml, - trunk/documentation/lcd4linux/example.xml, - trunk/documentation/lcd4linux/index.xml, - trunk/documentation/lcd4linux/write_doc.xml, - trunk/documentation/plugins, - trunk/documentation/plugins/Makefile, - trunk/documentation/plugins/index.xml, trunk/documentation/xsl, - trunk/documentation/xsl/body.xsl, - trunk/documentation/xsl/doc.xsl, - trunk/documentation/xsl/head.xsl, - trunk/documentation/xsl/helpers.xsl, - trunk/documentation/xsl/references.xsl, - trunk/documentation/xsl/xhtml.xsl: + * [r458] [lcd4linux @ 2004-06-02 05:27:59 by reinelt] added documentation tree - * [r457] trunk/drv_BeckmannEgle.c, trunk/lcd4linux.c: + * [r457] [lcd4linux @ 2004-06-02 05:14:16 by reinelt] fixed models listing for Beckmann+Egle driver some cosmetic changes 2004-06-01 reinelt - * [r456] trunk/drv_Crystalfontz.c, trunk/drv_Cwlinux.c, - trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_T6963.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, trunk/hash.c, - trunk/hash.h, trunk/plugin_i2c_sensors.c, trunk/thread.c, - trunk/timer.c, trunk/timer.h: + * [r456] [lcd4linux @ 2004-06-01 06:45:28 by reinelt] some Fixme's processed documented some code - * [r455] trunk/README.Plugins, trunk/plugin_sample.c: + * [r455] [lcd4linux @ 2004-06-01 06:04:25 by reinelt] made README.Plugins and plugin_sample up to date. 2004-05-31 reinelt - * [r454] trunk/drv_MatrixOrbital.c: + * [r454] [lcd4linux @ 2004-05-31 21:23:16 by reinelt] some cleanups in the MatrixOrbital driver - * [r453] trunk/drv_Cwlinux.c, trunk/drv_generic_serial.c, - trunk/lcd4linux.conf.sample, trunk/plugin_i2c_sensors.c, - trunk/plugin_pop3.c: + * [r453] [lcd4linux @ 2004-05-31 21:05:13 by reinelt] fixed lots of bugs in the Cwlinux driver do not emit EAGAIN error on the first retry made plugin_i2c_sensors a bit less 'chatty' moved init and exit functions to the bottom of plugin_pop3 - * [r452] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/drivers.m4, - trunk/drv.c, trunk/drv_Cwlinux.c, trunk/drv_MatrixOrbital.c, - trunk/drv_NULL.c, trunk/hash.c: + * [r452] [lcd4linux @ 2004-05-31 16:39:05 by reinelt] added NULL display driver (for debugging/profiling purposes) added backlight/contrast initialisation for matrixOrbital added Backlight initialisation for Cwlinux - * [r451] trunk/ChangeLog: + * [r451] [lcd4linux @ 2004-05-31 06:27:34 by reinelt] ChangeLog update - * [r450] trunk/drv_Image.c, trunk/lcd4linux.conf.sample: + * [r450] [lcd4linux @ 2004-05-31 06:24:42 by reinelt] fixed symlink security issue with the image driver - * [r449] trunk/drv_BeckmannEgle.c, trunk/drv_Crystalfontz.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_USBLCD.c: + * [r449] [lcd4linux @ 2004-05-31 05:38:02 by reinelt] fixed possible bugs with user-defined chars (clear high bits) thanks to Andy Baxter for debugging the MilfordInstruments @@ -2487,7 +2459,7 @@ 2004-05-31 andy-b - * [r448] trunk/drv_MilfordInstruments.c: + * [r448] [lcd4linux @ 2004-05-31 01:31:01 by andy-b] fixed bug in Milford Instruments driver which drew extra graphics chars in @@ -2497,206 +2469,171 @@ 2004-05-30 reinelt - * [r447] trunk/drv_Crystalfontz.c, trunk/lcd4linux.conf.sample: + * [r447] [lcd4linux @ 2004-05-30 08:25:50 by reinelt] Crystalfontz 631 driver finished 2004-05-29 reinelt - * [r446] trunk/drv_Image.c: + * [r446] [lcd4linux @ 2004-05-29 23:30:20 by reinelt] fixed a compiler issue with drv_Image.c (thanks to Frank Stratmann) - * [r445] trunk/drv_M50530.c, trunk/lcd4linux.conf.sample, - trunk/plugin_ppp.c: + * [r445] [lcd4linux @ 2004-05-29 15:53:28 by reinelt] M50530: reset parport signals on exit plugin_ppp: ppp() has two parameters, not three lcd4linux.conf.sample: diskstats() corrected - * [r444] trunk/lcd4linux.conf.sample, trunk/plugin_diskstats.c: + * [r444] [lcd4linux @ 2004-05-29 01:07:56 by reinelt] bug in plugin_diskstats fixed - * [r443] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_diskstats.c, trunk/plugins.m4: + * [r443] [lcd4linux @ 2004-05-29 00:27:14 by reinelt] added plugin_diskstats.c 2004-05-28 reinelt - * [r442] trunk/ChangeLog, trunk/Status: + * [r442] [lcd4linux @ 2004-05-28 14:38:10 by reinelt] Status and Changelog Update - * [r441] trunk/drv_BeckmannEgle.c: + * [r441] [lcd4linux @ 2004-05-28 14:36:10 by reinelt] added drv_BeckmannEgle.c (forgotten at first check in :-) - * [r440] trunk/BeckmannEgle.c, trunk/Makefile.am, - trunk/Makefile.in, trunk/config.guess, trunk/config.sub, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Crystalfontz.c, trunk/drv_Cwlinux.c, - trunk/drv_MatrixOrbital.c, trunk/drv_MilfordInstruments.c, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/lcd4linux.conf.sample, trunk/lock.c, trunk/lock.h: + * [r440] [lcd4linux @ 2004-05-28 13:51:41 by reinelt] ported driver for Beckmann+Egle Mini-Terminals added 'flags' parameter to serial_init() 2004-05-27 nicowallmeier - * [r439] trunk/plugin_imon.c: + * [r439] [lcd4linux @ 2004-05-27 06:29:29 by nicowallmeier] Moved variables to Plugin:imon / Plugin:telmon 2004-05-27 reinelt - * [r438] trunk/Status: + * [r438] [lcd4linux @ 2004-05-27 03:49:41 by reinelt] Status update - * [r437] trunk/drv_Crystalfontz.c, trunk/drv_Cwlinux.c, - trunk/drv_HD44780.c, trunk/drv_MatrixOrbital.c, - trunk/plugin_imon.c, trunk/plugin_netdev.c, - trunk/plugin_proc_stat.c, trunk/plugin_wireless.c: + * [r437] [lcd4linux @ 2004-05-27 03:39:47 by reinelt] changed function naming scheme to plugin::function 2004-05-26 reinelt - * [r436] trunk/Makefile.am, trunk/Makefile.in, trunk/Status, - trunk/Text.c, trunk/config.h.in, trunk/configure, trunk/debug.c, - trunk/drivers.m4, trunk/drv.c, trunk/drv_Crystalfontz.c, - trunk/drv_Curses.c, trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_M50530.c, trunk/drv_MatrixOrbital.c, - trunk/drv_MilfordInstruments.c, trunk/drv_USBLCD.c, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/lcd4linux.conf.sample, trunk/widget.c: + * [r436] [lcd4linux @ 2004-05-26 11:37:35 by reinelt] Curses driver ported. - * [r435] trunk/Makefile.am, trunk/Makefile.in, - trunk/MilfordInstruments.c, trunk/Status, trunk/configure, - trunk/drivers.m4, trunk/drv.c, trunk/drv_MilfordInstruments.c, - trunk/lcd4linux.conf.sample: + * [r435] [lcd4linux @ 2004-05-26 05:03:24 by reinelt] MilfordInstruments driver ported 2004-05-25 reinelt - * [r434] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/drivers.m4, - trunk/drv.c: + * [r434] [lcd4linux @ 2004-05-25 19:54:11 by reinelt] 'make distcheck' bugs fixed release number changed to 0.10.0-RC1 - * [r433] trunk/PalmPilot.c, trunk/Status, trunk/mail.c, - trunk/mail.h, trunk/mail2.c, trunk/socket.c, trunk/socket.h, - trunk/wifi.c, trunk/wifi.h: + * [r433] [lcd4linux @ 2004-05-25 19:47:11 by reinelt] Status updated obsolete files removed - * [r432] trunk/ChangeLog: + * [r432] [lcd4linux @ 2004-05-25 14:28:46 by reinelt] Changelog updated - * [r431] trunk/drv_Image.c: + * [r431] [lcd4linux @ 2004-05-25 14:27:21 by reinelt] added drv_Image.c (this time really!) - * [r430] trunk/Makefile.am, trunk/Makefile.in, trunk/Raster.c, - trunk/configure, trunk/drivers.m4, trunk/drv.c, - trunk/drv_Crystalfontz.c, trunk/drv_X11.c, - trunk/lcd4linux.conf.sample: + * [r430] [lcd4linux @ 2004-05-25 14:26:28 by reinelt] added "Image" driver (was: Raster.c) for PPM and PNG creation fixed some glitches in the X11 driver - * [r429] trunk/lcd4linux.conf.sample.old: + * [r429] [lcd4linux @ 2004-05-25 06:42:31 by reinelt] removed old sample config lcd4linux.conf.sample.old from CVS 2004-05-23 reinelt - * [r428] trunk/drv_USBLCD.c, trunk/lcd4linux.conf.sample: + * [r428] [lcd4linux @ 2004-05-23 08:58:30 by reinelt] icon bug with USBLCD fixed 2004-05-22 reinelt - * [r427] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_uptime.c, trunk/plugins.m4: + * [r427] [lcd4linux @ 2004-05-22 18:30:01 by reinelt] added plugin 'uptime' - * [r426] trunk/drv_HD44780.c: + * [r426] [lcd4linux @ 2004-05-22 04:23:49 by reinelt] removed 16*x fix again (next time think before commit :-) - * [r425] trunk/drv_HD44780.c: + * [r425] [lcd4linux @ 2004-05-22 04:21:02 by reinelt] fix for display RAM layout on 16x4 displays (thanks to toxicated101) 2004-05-20 reinelt - * [r424] trunk/Makefile.am, trunk/Makefile.in, trunk/plugin.c, - trunk/plugin_time.c: + * [r424] [lcd4linux @ 2004-05-20 07:47:51 by reinelt] added plugin_time - * [r423] trunk/Makefile.in, trunk/configure, trunk/plugin_pop3.c: + * [r423] [lcd4linux @ 2004-05-20 07:14:35 by reinelt] made all local functions static 2004-05-19 reinelt - * [r422] trunk/Makefile.in, trunk/configure, trunk/configure.in: + * [r422] [lcd4linux @ 2004-05-19 05:38:25 by reinelt] removed AC_PROG_CXX (C++-Compiler) from configure - * [r421] trunk/plugin_isdn.c: + * [r421] [lcd4linux @ 2004-05-19 05:23:25 by reinelt] plugin_isdn.c added (sorry, I forgot...) 2004-05-09 reinelt - * [r420] trunk/ltmain.sh, trunk/plugin_i2c_sensors.c: + * [r420] [lcd4linux @ 2004-05-09 05:41:41 by reinelt] i2c fix for kernel 2.6.5 (temp_input1 vs. temp1_input) from Xavier 2004-04-17 nicowallmeier - * [r419] trunk/plugin_pop3.c, trunk/plugin_wireless.c: + * [r419] [lcd4linux @ 2004-04-17 13:03:34 by nicowallmeier] minor bugfix 2004-04-12 reinelt - * [r418] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/evaluator.c, trunk/isdn.c, trunk/isdn.h, - trunk/plugin.c, trunk/plugins.m4, trunk/qprintf.c: + * [r418] [lcd4linux @ 2004-04-12 11:12:24 by reinelt] added plugin_isdn, removed old ISDN client fixed some real bad bugs in the evaluator - * [r417] trunk/Status: + * [r417] [lcd4linux @ 2004-04-12 05:59:24 by reinelt] Status update - * [r416] trunk/drv_generic_parport.c, trunk/udelay.c: + * [r416] [lcd4linux @ 2004-04-12 05:14:42 by reinelt] another BIG FAT WARNING on the use of raw ports instead of ppdev - * [r415] trunk/debug.h, trunk/lcd4linux.conf.sample, - trunk/udelay.c: + * [r415] [lcd4linux @ 2004-04-12 04:55:59 by reinelt] emitted a BIG FAT WARNING if msr.h could not be found (and therefore @@ -2704,30 +2641,27 @@ 2004-04-11 reinelt - * [r414] trunk/drivers.m4, trunk/plugins.m4: + * [r414] [lcd4linux @ 2004-04-11 17:37:09 by reinelt] forgot these files at last checkin... sorry! 2004-04-09 reinelt - * [r413] trunk/exec.c, trunk/exec.h: + * [r413] [lcd4linux @ 2004-04-09 06:23:28 by reinelt] removed old exec stuff - * [r412] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/plugin.c: + * [r412] [lcd4linux @ 2004-04-09 06:09:54 by reinelt] big configure rework from Xavier 2004-04-08 reinelt - * [r411] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/plugin.c, trunk/plugin_pop3.c: + * [r411] [lcd4linux @ 2004-04-08 11:59:26 by reinelt] added plugin_pop3 from Javi - * [r410] trunk/Makefile.in, trunk/configure, trunk/plugin_exec.c, - trunk/qprintf.c, trunk/thread.c, trunk/thread.h: + * [r410] [lcd4linux @ 2004-04-08 10:48:23 by reinelt] finished plugin_exec modified thread handling @@ -2735,110 +2669,94 @@ 2004-04-07 hejl - * [r409] trunk/Makefile.am, trunk/plugin.c, - trunk/plugin_wireless.c: + * [r409] [lcd4linux @ 2004-04-07 08:29:05 by hejl] New plugin for wireless info 2004-03-21 reinelt - * [r408] trunk/lcd4linux.conf.sample, trunk/plugin_mysql.c: + * [r408] [lcd4linux @ 2004-03-21 22:05:53 by reinelt] MySQL plugin fixes from Javi 2004-03-20 reinelt - * [r407] trunk/lcd4linux.conf.sample, trunk/plugin_mysql.c: + * [r407] [lcd4linux @ 2004-03-20 23:09:01 by reinelt] MySQL plugin fixes from Javi - * [r406] trunk/plugin_exec.c: + * [r406] [lcd4linux @ 2004-03-20 11:49:40 by reinelt] forgot to add plugin_exec.c ... - * [r405] trunk/drv_HD44780.c, trunk/thread.c, trunk/thread.h: + * [r405] [lcd4linux @ 2004-03-20 07:31:32 by reinelt] support for HD66712 (which has a different RAM layout) further threading development 2004-03-19 reinelt - * [r404] trunk/drv_Crystalfontz.c, trunk/drv_Cwlinux.c, - trunk/drv_HD44780.c, trunk/drv_M50530.c, - trunk/drv_MatrixOrbital.c, trunk/drv_USBLCD.c, - trunk/drv_generic_text.c, trunk/drv_generic_text.h: + * [r404] [lcd4linux @ 2004-03-19 09:17:46 by reinelt] removed the extra 'goto' function, row and col are additional parameters of the write() function now. - * [r403] trunk/Makefile.am, trunk/Makefile.in, trunk/Status, - trunk/aclocal.m4, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/pid.c, trunk/plugin.c, trunk/thread.c, - trunk/thread.h: + * [r403] [lcd4linux @ 2004-03-19 06:37:47 by reinelt] asynchronous thread handling started 2004-03-14 reinelt - * [r402] trunk/Status, trunk/battery.c, trunk/battery.h: + * [r402] [lcd4linux @ 2004-03-14 07:14:05 by reinelt] old battery.[ch] files removed - * [r401] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/lcd4linux.c, trunk/plugin.c, trunk/plugin_apm.c, - trunk/plugin_dvb.c: + * [r401] [lcd4linux @ 2004-03-14 07:11:42 by reinelt] parameter count fixed for plugin_dvb() plugin_APM (battery status) ported - * [r400] trunk/Status, trunk/configure.in: + * [r400] [lcd4linux @ 2004-03-14 06:07:33 by reinelt] Status update. Fixed bug in configure.in with X11 disabled (thanks to Kevin Liu) 2004-03-13 reinelt - * [r399] trunk/ChangeLog, trunk/Status, trunk/plugin_seti.c: + * [r399] [lcd4linux @ 2004-03-13 19:06:01 by reinelt] ChangeLog and Status update; small glitch in plugin_seti fixed. 2004-03-13 nicowallmeier - * [r398] trunk/plugin_imon.c: + * [r398] [lcd4linux @ 2004-03-13 14:58:15 by nicowallmeier] Added clean termination of imond-connection (now correctly) - * [r397] trunk/plugin_imon.c: + * [r397] [lcd4linux @ 2004-03-13 14:55:14 by nicowallmeier] Added clean termination of imond-connection 2004-03-13 reinelt - * [r396] trunk/imon.h: + * [r396] [lcd4linux @ 2004-03-13 06:55:29 by reinelt] (unnecessary) imon.h removed - * [r395] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/plugin.c, trunk/plugin_seti.c, - trunk/seti.c, trunk/seti.h: + * [r395] [lcd4linux @ 2004-03-13 06:49:20 by reinelt] seti@home plugin ported to NextGeneration 2004-03-12 reinelt - * [r394] trunk/imon.c: + * [r394] [lcd4linux @ 2004-03-12 13:58:14 by reinelt] removed imon.c (has been replaced by plugin_imon.c) 2004-03-11 reinelt - * [r393] trunk/cfg.c, trunk/drv_HD44780.c, trunk/evaluator.c, - trunk/evaluator.h, trunk/hash.c, trunk/hash.h, trunk/lcd4linux.c, - trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_loadavg.c, trunk/plugin_meminfo.c, - trunk/plugin_netdev.c, trunk/plugin_proc_stat.c, - trunk/widget_bar.c, trunk/widget_icon.c, trunk/widget_text.c: + * [r393] [lcd4linux @ 2004-03-11 06:39:58 by reinelt] big patch from Martin: - reuse filehandles @@ -2849,41 +2767,35 @@ 2004-03-10 reinelt - * [r392] trunk/Makefile.am, trunk/Makefile.in, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/plugin.c, - trunk/plugin_mysql.c: + * [r392] [lcd4linux @ 2004-03-10 07:16:15 by reinelt] MySQL plugin from Javier added 2004-03-08 hejl - * [r391] trunk/plugin_loadavg.c: + * [r391] [lcd4linux @ 2004-03-08 18:46:21 by hejl] Fixed bug introduced with "caching" the loadavg values - * [r390] trunk/evaluator.c: + * [r390] [lcd4linux @ 2004-03-08 18:45:52 by hejl] fixed segfault when using string concatenation 2004-03-08 reinelt - * [r389] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/lcd4linux.conf.sample, trunk/widget_text.c: + * [r389] [lcd4linux @ 2004-03-08 16:26:26 by reinelt] re-introduced \nnn (octal) characters in strings text widgets can have a 'update' speed of 0 which means 'never' (may be used for static content) - * [r388] trunk/evaluator.c: + * [r388] [lcd4linux @ 2004-03-08 04:33:08 by reinelt] string concatenation fixed 2004-03-06 reinelt - * [r387] trunk/cfg.c, trunk/evaluator.c, trunk/evaluator.h, - trunk/lcd4linux.c, trunk/plugin_cfg.c, trunk/plugin_math.c, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_icon.c, - trunk/widget_icon.h, trunk/widget_text.c, trunk/widget_text.h: + * [r387] [lcd4linux @ 2004-03-06 20:31:16 by reinelt] Complete rewrite of the evaluator to get rid of the code from mark Morley (because of license issues). @@ -2892,38 +2804,18 @@ 2004-03-03 hejl - * [r386] trunk/hash.c: + * [r386] [lcd4linux @ 2004-03-03 08:40:07 by hejl] Fixed memory leak in hash_get_regex 2004-03-03 reinelt - * [r385] trunk/drv_generic_parport.c, trunk/drv_generic_serial.c, - trunk/hash.c, trunk/hash.h, trunk/lcd4linux.c, trunk/pid.c, - trunk/plugin_imon.c, trunk/plugin_netdev.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c, trunk/qprintf.h, trunk/timer.c, - trunk/widget_icon.c: + * [r385] [lcd4linux @ 2004-03-03 04:44:16 by reinelt] changes (cosmetics?) to the big patch from Martin hash patch un-applied - * [r384] trunk/Raster.c, trunk/Text.c, trunk/cfg.c, - trunk/drv_HD44780.c, trunk/drv_generic_graphic.c, - trunk/drv_generic_parport.c, trunk/drv_generic_serial.c, - trunk/drv_generic_text.c, trunk/evaluator.c, trunk/evaluator.h, - trunk/exec.c, trunk/hash.c, trunk/hash.h, trunk/imon.c, - trunk/layout.c, trunk/lcd4linux.c, trunk/lock.c, trunk/mail.c, - trunk/mail2.c, trunk/pid.c, trunk/plugin.c, trunk/plugin.h, - trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, trunk/plugin_dvb.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_imon.c, - trunk/plugin_loadavg.c, trunk/plugin_math.c, - trunk/plugin_meminfo.c, trunk/plugin_netdev.c, - trunk/plugin_ppp.c, trunk/plugin_proc_stat.c, - trunk/plugin_sample.c, trunk/plugin_string.c, - trunk/plugin_uname.c, trunk/plugin_xmms.c, trunk/seti.c, - trunk/timer.c, trunk/timer.h, trunk/widget.c, trunk/widget.h, - trunk/widget_bar.c, trunk/widget_icon.c, trunk/widget_text.c, - trunk/wifi.c: + * [r384] [lcd4linux @ 2004-03-03 03:47:04 by reinelt] big patch from Martin Hejl: - use qprintf() where appropriate @@ -2931,14 +2823,13 @@ - add quit() functions to free allocated memory - fixed lots of memory leaks - * [r383] trunk/drv_Crystalfontz.c: + * [r383] [lcd4linux @ 2004-03-03 03:41:02 by reinelt] Crystalfontz Contrast issue fixed 2004-03-01 reinelt - * [r382] trunk/cfg.c, trunk/drv_Crystalfontz.c, - trunk/drv_HD44780.c, trunk/lcd4linux.conf.sample: + * [r382] [lcd4linux @ 2004-03-01 04:29:51 by reinelt] cfg_number() returns -1 on error, 0 if value not found (but default val used), @@ -2948,60 +2839,52 @@ 2004-02-29 reinelt - * [r381] trunk/ChangeLog, trunk/configure, trunk/configure.in, - trunk/lcd4linux.conf.sample, trunk/libtool: + * [r381] [lcd4linux @ 2004-02-29 17:09:53 by reinelt] ChangeLog updated Version number bumped to 0.10.0 - * [r380] trunk/drv_generic_graphic.c: + * [r380] [lcd4linux @ 2004-02-29 14:30:59 by reinelt] icon visibility fix for generic graphics from Xavier 2004-02-27 reinelt - * [r379] trunk/Makefile.am, trunk/Makefile.in, trunk/lcd4linux.c, - trunk/qprintf.c, trunk/qprintf.h: + * [r379] [lcd4linux @ 2004-02-27 07:06:24 by reinelt] new function 'qprintf()' (simple but quick snprintf() replacement) - * [r378] trunk/hash.c, trunk/hash.h: + * [r378] [lcd4linux @ 2004-02-27 06:07:55 by reinelt] hash improvements from Martin 2004-02-26 reinelt - * [r377] trunk/evaluator.c: + * [r377] [lcd4linux @ 2004-02-26 21:42:45 by reinelt] memory leak fixes from Martin 2004-02-24 reinelt - * [r376] trunk/Status: + * [r376] [lcd4linux @ 2004-02-24 06:00:22 by reinelt] Status and Todo list from Xavier - * [r375] trunk/Makefile.am, trunk/Makefile.in, trunk/XWindow.c, - trunk/configure, trunk/configure.in, trunk/drv.c, - trunk/drv_T6963.c, trunk/drv_X11.c, trunk/drv_generic_graphic.c, - trunk/lcd4linux.conf.sample: + * [r375] [lcd4linux @ 2004-02-24 05:54:57 by reinelt] X11 driver ported 2004-02-23 reinelt - * [r374] trunk/README.Rows, trunk/README.Tokens, - trunk/lcd4linux.conf.sample: + * [r374] [lcd4linux @ 2004-02-23 06:44:27 by reinelt] "Lightning" widget from Xavier (lcd4linux.conf.sample) removed obsolete Docs. 2004-02-22 reinelt - * [r373] trunk/Makefile.in, trunk/drv_T6963.c, - trunk/drv_generic_graphic.c, trunk/lcd4linux.conf.sample, - trunk/plugin_imon.c: + * [r373] [lcd4linux @ 2004-02-22 17:35:41 by reinelt] some fixes for generic graphic driver and T6963 removed ^M from plugin_imon (Nico, are you editing under @@ -3009,22 +2892,19 @@ 2004-02-18 nicowallmeier - * [r372] trunk/Makefile.am, trunk/plugin.c, trunk/plugin_imon.c: + * [r372] [lcd4linux @ 2004-02-18 14:45:42 by nicowallmeier] Imon/Telmon plugin ported 2004-02-18 reinelt - * [r371] trunk/cfg.c, trunk/drv_T6963.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_text.h, trunk/lcd4linux.conf.sample, - trunk/widget.c, trunk/widget_text.c: + * [r371] [lcd4linux @ 2004-02-18 06:39:20 by reinelt] T6963 driver for graphic displays finished 2004-02-17 reinelt - * [r370] trunk/configure, trunk/configure.in: + * [r370] [lcd4linux @ 2004-02-17 05:37:20 by reinelt] Namespace clash between Curses driver and general text driver resolved @@ -3032,110 +2912,82 @@ 2004-02-16 reinelt - * [r369] trunk/plugin_dvb.c: + * [r369] [lcd4linux @ 2004-02-16 13:03:37 by reinelt] compile problem with missing frontend.h fixed - * [r368] trunk/plugin_i2c_sensors.c: + * [r368] [lcd4linux @ 2004-02-16 08:19:44 by reinelt] i2c_sensors patch from Xavier 2004-02-15 reinelt - * [r367] trunk/Makefile.am, trunk/Makefile.in, trunk/T6963.c, - trunk/configure, trunk/configure.in, trunk/drv.c, - trunk/drv_HD44780.c, trunk/drv_M50530.c, trunk/drv_T6963.c, - trunk/drv_generic_graphic.c, trunk/drv_generic_graphic.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/font_6x8.h, trunk/fontmap.c, trunk/fontmap.h, - trunk/lcd4linux.conf.sample, trunk/libtool, trunk/pixmap.c, - trunk/pixmap.h, trunk/plugin_i2c_sensors.c, trunk/widget_icon.c, - trunk/widget_icon.h: + * [r367] [lcd4linux @ 2004-02-15 21:43:43 by reinelt] T6963 driver nearly finished framework for graphic displays done i2c_sensors patch from Xavier some more old generation files removed - * [r366] trunk/M50530.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/USBLCD.c, trunk/configure, trunk/configure.in, trunk/drv.c, - trunk/drv_M50530.c, trunk/drv_USBLCD.c, - trunk/lcd4linux.conf.sample, trunk/libtool, trunk/ltmain.sh: + * [r366] [lcd4linux @ 2004-02-15 08:22:47 by reinelt] ported USBLCD driver to NextGeneration added drv_M50530.c (I forgot yesterday, sorry) removed old drivers M50530.c and USBLCD.c - * [r365] trunk/lcd4linux.conf.sample, trunk/plugin_netdev.c: + * [r365] [lcd4linux @ 2004-02-15 07:23:04 by reinelt] bug in netdev parsing fixed 2004-02-14 nicowallmeier - * [r364] trunk/plugin_i2c_sensors.c: + * [r364] [lcd4linux @ 2004-02-14 12:07:27 by nicowallmeier] minor bugfix 2004-02-14 reinelt - * [r363] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/configure, trunk/configure.in, trunk/drv.c, - trunk/drv_Crystalfontz.c, trunk/drv_Cwlinux.c, - trunk/drv_HD44780.c, trunk/drv_MatrixOrbital.c, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, - trunk/lcd4linux.conf.sample, trunk/plugin_i2c_sensors.c: + * [r363] [lcd4linux @ 2004-02-14 11:56:11 by reinelt] M50530 driver ported changed lots of 'char' to 'unsigned char' - * [r362] trunk/plugin_i2c_sensors.c: + * [r362] [lcd4linux @ 2004-02-14 10:09:50 by reinelt] I2C Sensors for 2.4 kernels (/proc instead of /sysfs) 2004-02-10 reinelt - * [r361] trunk/Crystalfontz.c, trunk/Cwlinux.c, trunk/HD44780.c, - trunk/Makefile.am, trunk/Makefile.in, trunk/MatrixOrbital.c, - trunk/SIN.c, trunk/Skeleton.c, trunk/bar.c, trunk/bar.h, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/debug.c, trunk/display.c, trunk/display.h, trunk/dvb.c, - trunk/dvb.h, trunk/expr.c, trunk/expr.h, trunk/filter.c, - trunk/filter.h, trunk/icon.c, trunk/icon.h, trunk/lcd4linux.c, - trunk/parport.c, trunk/parport.h, trunk/parser.c, trunk/parser.h, - trunk/plugin.c, trunk/processor.c, trunk/processor.h, - trunk/system.c, trunk/system.h: + * [r361] [lcd4linux @ 2004-02-10 07:42:35 by reinelt] cut off all old-style files which are no longer used with NextGeneration - * [r360] trunk/Makefile.am, trunk/Makefile.in, trunk/plugin.c, - trunk/plugin_dvb.c: + * [r360] [lcd4linux @ 2004-02-10 06:54:38 by reinelt] DVB plugin ported 2004-02-09 nicowallmeier - * [r359] trunk/widget_text.c: + * [r359] [lcd4linux @ 2004-02-09 19:49:38 by nicowallmeier] Minor bugfix 2004-02-07 reinelt - * [r358] trunk/drv_generic_text.c, trunk/widget_icon.c: + * [r358] [lcd4linux @ 2004-02-07 13:45:23 by reinelt] icon visibility patch #2 from Xavier 2004-02-05 mkeil - * [r357] trunk/plugin_xmms.c: + * [r357] [lcd4linux @ 2004-02-05 23:58:18 by mkeil] Fixed/Optimized Hashage-timings 2004-02-05 reinelt - * [r356] trunk/drv_Crystalfontz.c, trunk/evaluator.c, - trunk/lcd4linux.conf.sample: + * [r356] [lcd4linux @ 2004-02-05 07:10:23 by reinelt] evaluator function names are no longer case-sensitive Crystalfontz Fan PWM control, Fan RPM monitoring, temperature @@ -3143,30 +2995,27 @@ 2004-02-04 reinelt - * [r355] trunk/widget_icon.c, trunk/widget_icon.h: + * [r355] [lcd4linux @ 2004-02-04 19:11:44 by reinelt] icon visibility patch from Xavier - * [r354] trunk/drv_Crystalfontz.c, trunk/drv_HD44780.c, - trunk/drv_generic_serial.c, trunk/lcd4linux.conf.sample, - trunk/plugin_proc_stat.c: + * [r354] [lcd4linux @ 2004-02-04 19:10:51 by reinelt] Crystalfontz driver nearly finished 2004-02-02 reinelt - * [r353] trunk/drv_HD44780.c: + * [r353] [lcd4linux @ 2004-02-02 05:22:16 by reinelt] Brightness fpr Noritake Displays avaliable as a plugin 2004-02-01 reinelt - * [r352] trunk/layout.c, trunk/plugin_cfg.c, trunk/plugin_netdev.c, - trunk/plugin_proc_stat.c: + * [r352] [lcd4linux @ 2004-02-01 19:37:40 by reinelt] got rid of every strtok() incarnation. - * [r351] trunk/cfg.c, trunk/layout.c: + * [r351] [lcd4linux @ 2004-02-01 18:08:50 by reinelt] removed strtok() from layout processing (took me hours to find this bug) @@ -3174,14 +3023,13 @@ 2004-02-01 hejl - * [r350] trunk/drv_HD44780.c: + * [r350] [lcd4linux @ 2004-02-01 11:51:22 by hejl] Fixes for busy flag 2004-02-01 reinelt - * [r349] trunk/drv_Crystalfontz.c, trunk/drv_HD44780.c, - trunk/drv_generic_serial.c, trunk/drv_generic_serial.h: + * [r349] [lcd4linux @ 2004-02-01 08:05:12 by reinelt] Crystalfontz 633 extensions (CRC checking and stuff) Models table for HD44780 @@ -3189,25 +3037,12 @@ 2004-01-30 reinelt - * [r348] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/MatrixOrbital.c, trunk/MilfordInstruments.c, - trunk/PalmPilot.c, trunk/Raster.c, trunk/T6963.c, trunk/USBLCD.c, - trunk/XWindow.c, trunk/aclocal.m4, trunk/bar.c, trunk/cfg.c, - trunk/cfg.h, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/drv_Crystalfontz.c, - trunk/drv_generic_text.c, trunk/evaluator.c, trunk/filter.c, - trunk/hash.c, trunk/icon.c, trunk/layout.c, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/mail2.c, trunk/pixmap.c, - trunk/plugin_cfg.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_sample.c, trunk/timer.c, trunk/widget.c, - trunk/widget_bar.c, trunk/widget_icon.c, trunk/widget_text.c: + * [r348] [lcd4linux @ 2004-01-30 20:57:55 by reinelt] HD44780 patch from Martin Hejl dmalloc integrated - * [r347] trunk/drv_HD44780.c, trunk/plugin_i2c_sensors.c, - trunk/plugin_loadavg.c, trunk/processor.c: + * [r347] [lcd4linux @ 2004-01-30 07:12:35 by reinelt] HD44780 busy-flag support from Martin Hejl loadavg() uClibc replacement from Martin Heyl @@ -3217,141 +3052,96 @@ 2004-01-29 reinelt - * [r346] trunk/plugin_i2c_sensors.c: + * [r346] [lcd4linux @ 2004-01-29 05:55:30 by reinelt] check for /sys mounted - * [r345] trunk/config.h.in, trunk/configure, trunk/configure.in: + * [r345] [lcd4linux @ 2004-01-29 05:53:47 by reinelt] uClibc compatibility issues from Martin Hejl - * [r344] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/MatrixOrbital.c, - trunk/MilfordInstruments.c, trunk/PalmPilot.c, trunk/SIN.c, - trunk/Skeleton.c, trunk/Text.c, trunk/XWindow.c, trunk/bar.c, - trunk/battery.c, trunk/cfg.c, trunk/drv_Crystalfontz.c, - trunk/drv_Cwlinux.c, trunk/drv_HD44780.c, - trunk/drv_MatrixOrbital.c, trunk/drv_generic_serial.c, - trunk/drv_generic_text.c, trunk/evaluator.c, trunk/exec.c, - trunk/expr.c, trunk/filter.c, trunk/fontmap.c, trunk/hash.c, - trunk/icon.c, trunk/imon.c, trunk/isdn.c, - trunk/lcd4linux.conf.sample, trunk/lock.c, trunk/mail.c, - trunk/mail2.c, trunk/parser.c, trunk/pid.c, trunk/pixmap.c, - trunk/plugin.c, trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_loadavg.c, - trunk/plugin_math.c, trunk/plugin_meminfo.c, - trunk/plugin_netdev.c, trunk/plugin_proc_stat.c, - trunk/plugin_sample.c, trunk/plugin_string.c, - trunk/plugin_uname.c, trunk/plugin_xmms.c, trunk/processor.c, - trunk/seti.c, trunk/socket.c, trunk/timer.c, trunk/widget.c, - trunk/widget_bar.c, trunk/widget_icon.c, trunk/widget_text.c, - trunk/wifi.c: + * [r344] [lcd4linux @ 2004-01-29 04:40:02 by reinelt] every .c file includes "config.h" now 2004-01-28 reinelt - * [r343] trunk/plugin_ppp.c: + * [r343] [lcd4linux @ 2004-01-28 06:43:31 by reinelt] plugin_ppp finished. 2004-01-27 reinelt - * [r342] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_i2c_sensors.c, trunk/plugin_ppp.c, - trunk/plugin_proc_stat.c: + * [r342] [lcd4linux @ 2004-01-27 08:13:39 by reinelt] ported PPP token to plugin_ppp - * [r341] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/configure, trunk/configure.in, trunk/drv.c, - trunk/drv_Cwlinux.c: + * [r341] [lcd4linux @ 2004-01-27 06:34:14 by reinelt] Cwlinux driver portet to NextGeneration (compiles, but not tested!) - * [r340] trunk/plugin_i2c_sensors.c: + * [r340] [lcd4linux @ 2004-01-27 05:06:10 by reinelt] i2c update from Xavier - * [r339] trunk/TODO, trunk/hash.c: + * [r339] [lcd4linux @ 2004-01-27 04:48:57 by reinelt] bug with hash_age() fixed (thanks to Markus Keil for pointing this out) 2004-01-25 reinelt - * [r338] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_Crystalfontz.c, trunk/drv_generic_serial.c, - trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_meminfo.c, trunk/plugin_netdev.c, - trunk/plugin_proc_stat.c: + * [r338] [lcd4linux @ 2004-01-25 05:30:08 by reinelt] plugin_netdev for parsing /proc/net/dev added 2004-01-23 reinelt - * [r337] trunk/drv_Crystalfontz.c, trunk/drv_HD44780.c, - trunk/drv_MatrixOrbital.c, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/lcd4linux.conf.sample, - trunk/widget_icon.c, trunk/widget_icon.h: + * [r337] [lcd4linux @ 2004-01-23 07:04:03 by reinelt] icons finished! - * [r336] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_Crystalfontz.c, trunk/drv_HD44780.c, - trunk/drv_MatrixOrbital.c, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/lcd4linux.conf.sample, - trunk/widget.c, trunk/widget_bar.c, trunk/widget_icon.c, - trunk/widget_icon.h, trunk/widget_text.c: + * [r336] [lcd4linux @ 2004-01-23 04:53:23 by reinelt] icon widget added (not finished yet!) 2004-01-22 reinelt - * [r335] trunk/plugin_proc_stat.c: + * [r335] [lcd4linux @ 2004-01-22 08:55:30 by reinelt] fixed unhandled kernel-2.6 entries in /prco/stat - * [r334] trunk/cfg.c, trunk/drv_Crystalfontz.c, - trunk/drv_HD44780.c, trunk/drv_MatrixOrbital.c, - trunk/drv_generic_text.c, trunk/drv_generic_text.h, trunk/hash.c, - trunk/lcd4linux.conf.sample, trunk/widget_text.c: + * [r334] [lcd4linux @ 2004-01-22 07:57:45 by reinelt] several bugs fixed where segfaulting on layout>display Crystalfontz driver optimized, 632 display already works 2004-01-21 reinelt - * [r333] trunk/hash.c, trunk/hash.h, trunk/plugin_proc_stat.c: + * [r333] [lcd4linux @ 2004-01-21 14:29:03 by reinelt] new helper 'hash_get_regex' which delivers the sum over regex matched items new function 'disk()' which uses this regex matching - * [r332] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in, trunk/drv.c, trunk/drv_Crystalfontz.c, - trunk/drv_MatrixOrbital.c: + * [r332] [lcd4linux @ 2004-01-21 12:36:19 by reinelt] Crystalfontz NextGeneration driver added - * [r331] trunk/ChangeLog: + * [r331] [lcd4linux @ 2004-01-21 11:32:48 by reinelt] changelog commited - * [r330] trunk/plugin_proc_stat.c, trunk/plugin_xmms.c: + * [r330] [lcd4linux @ 2004-01-21 11:31:23 by reinelt] two bugs with hash_age() ixed - * [r329] trunk/config.guess, trunk/config.sub, trunk/hash.c, - trunk/hash.h, trunk/libtool, trunk/ltmain.sh, - trunk/plugin_cpuinfo.c, trunk/plugin_meminfo.c, - trunk/plugin_proc_stat.c, trunk/plugin_xmms.c: + * [r329] [lcd4linux @ 2004-01-21 10:48:17 by reinelt] hash_age function added - * [r328] trunk/drv_HD44780.c, trunk/lcd4linux.conf.sample: + * [r328] [lcd4linux @ 2004-01-21 06:39:27 by reinelt] HD44780 missed the "clear display' sequence asc255bug handling added @@ -3359,103 +3149,76 @@ 2004-01-20 reinelt - * [r327] trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/drv.c, trunk/drv.h, trunk/drv_HD44780.c, - trunk/drv_MatrixOrbital.c, trunk/drv_generic_parport.c, - trunk/drv_generic_parport.h, trunk/lcd4linux.conf.sample: + * [r327] [lcd4linux @ 2004-01-20 15:32:48 by reinelt] first version of Next Generation HD44780 (untested! but it compiles...) some cleanup in the other drivers - * [r326] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_generic_parport.c, trunk/drv_generic_parport.h: + * [r326] [lcd4linux @ 2004-01-20 14:35:38 by reinelt] drv_generic_parport added, code from parport.c - * [r325] trunk/drv_generic_serial.c, trunk/drv_generic_serial.h: + * [r325] [lcd4linux @ 2004-01-20 14:26:09 by reinelt] moved drv_generic to drv_generic_serial - * [r324] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_MatrixOrbital.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_text.c, - trunk/widget_bar.c: + * [r324] [lcd4linux @ 2004-01-20 14:25:12 by reinelt] some reorganization moved drv_generic to drv_generic_serial moved port locking stuff to drv_generic_serial - * [r323] trunk/drv_MatrixOrbital.c, trunk/drv_generic_text.c, - trunk/lcd4linux.conf.sample, trunk/plugin_proc_stat.c, - trunk/widget_bar.c: + * [r323] [lcd4linux @ 2004-01-20 12:45:47 by reinelt] "Default screen" working with MatrixOrbital - * [r322] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_MatrixOrbital.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_bar.c, - trunk/drv_generic_bar.h, trunk/drv_generic_text.c, - trunk/drv_generic_text.h, trunk/hash.c, - trunk/lcd4linux.conf.sample: + * [r322] [lcd4linux @ 2004-01-20 05:36:59 by reinelt] moved text-display-specific stuff to drv_generic_text moved all the bar stuff from drv_generic_bar to generic_text - * [r321] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_MatrixOrbital.c, trunk/drv_generic.c, - trunk/drv_generic.h, trunk/drv_generic_bar.c, - trunk/drv_generic_bar.h, trunk/lcd4linux.conf.sample, - trunk/widget_bar.c, trunk/widget_bar.h, trunk/widget_text.c: + * [r321] [lcd4linux @ 2004-01-20 04:51:39 by reinelt] moved generic stuff from drv_MatrixOrbital to drv_generic implemented new-stylish bars which are nearly finished 2004-01-18 reinelt - * [r320] trunk/Makefile.am, trunk/Makefile.in, - trunk/drv_MatrixOrbital.c, trunk/widget_bar.c, - trunk/widget_bar.h: + * [r320] [lcd4linux @ 2004-01-18 21:25:16 by reinelt] Framework for bar widget opened - * [r319] trunk/hash.c, trunk/hash.h, trunk/lcd4linux.conf.sample, - trunk/plugin_proc_stat.c, trunk/timer.c: + * [r319] [lcd4linux @ 2004-01-18 09:01:45 by reinelt] /proc/stat parsing finished - * [r318] trunk/cfg.c, trunk/expr.c, trunk/hash.c, - trunk/plugin_proc_stat.c: + * [r318] [lcd4linux @ 2004-01-18 06:54:08 by reinelt] bug in expr.c fixed (thanks to Xavier) some progress with /proc/stat parsing 2004-01-16 reinelt - * [r317] trunk/hash.h, trunk/plugin_cpuinfo.c, - trunk/plugin_proc_stat.c, trunk/plugin_xmms.c: + * [r317] [lcd4linux @ 2004-01-16 11:12:26 by reinelt] some bugs in plugin_xmms fixed, parsing moved to own function plugin_proc_stat nearly finished 2004-01-16 mkeil - * [r316] trunk/plugin_xmms.c: + * [r316] [lcd4linux @ 2004-01-16 10:09:49 by mkeil] -include caching for values 2004-01-16 reinelt - * [r315] trunk/hash.c, trunk/hash.h, trunk/plugin_cpuinfo.c, - trunk/plugin_meminfo.c, trunk/plugin_proc_stat.c: + * [r315] [lcd4linux @ 2004-01-16 07:26:25 by reinelt] moved various /proc parsing to own functions made some progress with /proc/stat parsing - * [r314] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/filter.c, trunk/hash.c, trunk/hash.h, - trunk/lcd4linux.conf.sample, trunk/plugin.c, - trunk/plugin_proc_stat.c, trunk/system.c: + * [r314] [lcd4linux @ 2004-01-16 05:04:53 by reinelt] started plugin proc_stat which should parse /proc/stat which again is a paint in the a** @@ -3464,22 +3227,16 @@ 2004-01-15 reinelt - * [r313] trunk/debian/postinst, trunk/debian/watch, - trunk/drv_MatrixOrbital.c, trunk/evaluator.c, - trunk/lcd4linux.conf.sample, trunk/widget_text.c, - trunk/widget_text.h: + * [r313] [lcd4linux @ 2004-01-15 07:47:02 by reinelt] debian/ postinst and watch added (did CVS forget about them?) evaluator: conditional expressions (a?b:c) added text widget nearly finished - * [r312] trunk/ChangeLog: + * [r312] [lcd4linux @ 2004-01-15 04:32:14 by reinelt] - * [r311] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/lcd4linux.conf.sample.old, - trunk/plugin.c, trunk/plugin_cpuinfo.c, trunk/plugin_loadavg.c, - trunk/plugin_meminfo.c, trunk/widget_text.c, trunk/widget_text.h: + * [r311] [lcd4linux @ 2004-01-15 04:29:45 by reinelt] moved lcd4linux.conf.sample to *.old lcd4linux.conf.sample with new layout @@ -3488,11 +3245,7 @@ 2004-01-14 reinelt - * [r310] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/cfg.h, trunk/drv_MatrixOrbital.c, trunk/expr.c, - trunk/layout.c, trunk/lcd4linux.c, trunk/plugin.c, - trunk/plugin_cfg.c, trunk/plugin_cpuinfo.c, trunk/plugin_uname.c, - trunk/widget.c, trunk/widget.h, trunk/widget_text.c: + * [r310] [lcd4linux @ 2004-01-14 11:33:00 by reinelt] new plugin 'uname' which does what it's called text widget nearly finished @@ -3500,82 +3253,64 @@ 2004-01-13 reinelt - * [r309] trunk/Makefile.am, trunk/Makefile.in, trunk/hash.c, - trunk/hash.h, trunk/plugin.c, trunk/plugin_cfg.c, - trunk/plugin_cpuinfo.c, trunk/plugin_sample.c: + * [r309] [lcd4linux @ 2004-01-13 10:03:01 by reinelt] new util 'hash' for associative arrays new plugin 'cpuinfo' - * [r308] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in, trunk/layout.c, trunk/lcd4linux.c, - trunk/parport.c, trunk/timer.c, trunk/timer.h, trunk/widget.c, - trunk/widget.h, trunk/widget_text.c: + * [r308] [lcd4linux @ 2004-01-13 08:18:07 by reinelt] timer queues added liblcd4linux deactivated turing transformation to new layout 2004-01-12 reinelt - * [r307] trunk/evaluator.c, trunk/evaluator.h, trunk/expr.c, - trunk/layout.c, trunk/lcd4linux.c: + * [r307] [lcd4linux @ 2004-01-12 03:51:01 by reinelt] evaluating the 'Variables' section in the config file 2004-01-11 reinelt - * [r306] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/drv_MatrixOrbital.c, trunk/layout.c, trunk/plugin.c, - trunk/plugin_string.c, trunk/widget.c, trunk/widget.h, - trunk/widget_text.c: + * [r306] [lcd4linux @ 2004-01-11 18:26:02 by reinelt] further widget and layout processing - * [r305] trunk/cfg.c, trunk/drv_MatrixOrbital.c, trunk/layout.c, - trunk/widget.c: + * [r305] [lcd4linux @ 2004-01-11 09:26:15 by reinelt] layout starts to exist... 2004-01-10 reinelt - * [r304] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/cfg.h, trunk/drv.h, trunk/drv_MatrixOrbital.c, - trunk/layout.c, trunk/layout.h, trunk/lcd4linux.c, - trunk/plugin.c, trunk/widget.c, trunk/widget.h, - trunk/widget_text.c: + * [r304] [lcd4linux @ 2004-01-10 20:22:33 by reinelt] added new function 'cfg_list()' (not finished yet) added layout.c (will replace processor.c someday) added widget_text.c (will be the first and most important widget) modified lcd4linux.c so that old-style configs should work, too - * [r303] trunk/lcd4linux.c, trunk/plugin.c: + * [r303] [lcd4linux @ 2004-01-10 17:45:26 by reinelt] changed initialization order so cfg() gets initialized before plugins. This way a plugin's init() can use cfg_get(). Thanks to Xavier for reporting this one! - * [r302] trunk/Makefile.am, trunk/Makefile.in, trunk/plugin.c, - trunk/plugin_i2c_sensors.c: + * [r302] [lcd4linux @ 2004-01-10 17:36:56 by reinelt] I2C Sensors plugin from Xavier added - * [r301] trunk/drv_MatrixOrbital.c, trunk/widget.c, trunk/widget.h: + * [r301] [lcd4linux @ 2004-01-10 17:34:40 by reinelt] further matrixOrbital changes widgets initialized - * [r300] trunk/drv.c, trunk/drv_MatrixOrbital.c: + * [r300] [lcd4linux @ 2004-01-10 10:20:22 by reinelt] new MatrixOrbital changes 2004-01-09 reinelt - * [r299] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in, trunk/display.c, trunk/display.h, - trunk/drv.c, trunk/drv.h, trunk/drv_MatrixOrbital.c, - trunk/lcd4linux.c: + * [r299] [lcd4linux @ 2004-01-09 17:03:06 by reinelt] initiated transfer to new driver architecture new file 'drv.c' will someday replace 'display.c' @@ -3584,36 +3319,27 @@ the switch (at least I hope so) - * [r298] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/MatrixOrbital.c, trunk/MilfordInstruments.c, - trunk/PalmPilot.c, trunk/Raster.c, trunk/T6963.c, trunk/Text.c, - trunk/USBLCD.c, trunk/XWindow.c, trunk/cfg.c, trunk/cfg.h, - trunk/exec.c, trunk/expr.c, trunk/filter.c, trunk/icon.c, - trunk/imon.c, trunk/lcd4linux.c, trunk/mail.c, trunk/mail2.c, - trunk/parport.c, trunk/processor.c, trunk/seti.c, trunk/system.c, - trunk/wifi.c: + * [r298] [lcd4linux @ 2004-01-09 04:16:06 by reinelt] added 'section' argument to cfg_get(), but NULLed it on all calls by now. 2004-01-08 reinelt - * [r297] trunk/cfg.c: + * [r297] [lcd4linux @ 2004-01-08 06:00:28 by reinelt] allowed '.' in key names allowed empty group keys (not only "group anything {", but "anything {") - * [r296] trunk/AUTHORS, trunk/cfg.c, trunk/lcd4linux.c: + * [r296] [lcd4linux @ 2004-01-08 05:28:12 by reinelt] Luk Claes added to AUTHORS cfg: group handling ('{}') added 2004-01-07 reinelt - * [r295] trunk/cfg.c, trunk/config.h.in, trunk/evaluator.c, - trunk/libtool: + * [r295] [lcd4linux @ 2004-01-07 10:15:41 by reinelt] small glitch in evaluator fixed made config table sorted and access with bsearch(), @@ -3621,94 +3347,79 @@ 2004-01-06 reinelt - * [r294] trunk/AUTHORS, trunk/debian/copyright, trunk/evaluator.c: + * [r294] [lcd4linux @ 2004-01-06 23:01:37 by reinelt] more copyright issues - * [r293] trunk/AUTHORS, trunk/HD44780.c, - trunk/MilfordInstruments.c, trunk/USBLCD.c, trunk/XWindow.c, - trunk/battery.c, trunk/battery.h, trunk/debian/copyright, - trunk/imon.c, trunk/imon.h, trunk/plugin_xmms.c, trunk/seti.c, - trunk/wifi.c, trunk/wifi.h: + * [r293] [lcd4linux @ 2004-01-06 22:33:13 by reinelt] Copyright statements cleaned up - * [r292] trunk/debian/control, trunk/debian/dirs, - trunk/debian/rules, trunk/debian/templates: + * [r292] [lcd4linux @ 2004-01-06 21:14:51 by reinelt] more debianizing - * [r291] trunk/debian/copyright: + * [r291] [lcd4linux @ 2004-01-06 18:22:41 by reinelt] debian updates - * [r290] trunk/aclocal.m4, trunk/configure, trunk/ltmain.sh: + * [r290] [lcd4linux @ 2004-01-06 17:56:43 by reinelt] autotools update - * [r289] trunk/ChangeLog: + * [r289] [lcd4linux @ 2004-01-06 17:37:00 by reinelt] - * [r288] trunk/Makefile.am, trunk/Makefile.in, - trunk/README.Plugins, trunk/evaluator.c, trunk/plugin.c, - trunk/plugin_sample.c: + * [r288] [lcd4linux @ 2004-01-06 17:33:45 by reinelt] Evaluator: functions with variable argument lists Evaluator: plugin_sample.c and README.Plugins added - * [r287] trunk/evaluator.c, trunk/plugin.c: + * [r287] [lcd4linux @ 2004-01-06 15:19:12 by reinelt] Evaluator rearrangements... 2004-01-05 reinelt - * [r286] trunk/Makefile.am, trunk/Makefile.in, trunk/expr.c, - trunk/expr.h, trunk/parser.c, trunk/parser.h, trunk/processor.c: + * [r286] [lcd4linux @ 2004-01-05 11:57:38 by reinelt] added %y tokens to make the Evaluator useable 2004-01-02 reinelt - * [r285] trunk/debian, trunk/debian/changelog, trunk/debian/compat, - trunk/debian/config, trunk/debian/control, - trunk/debian/copyright, trunk/debian/dirs, trunk/debian/docs, - trunk/debian/init.d, trunk/debian/rules, trunk/debian/templates: + * [r285] [lcd4linux @ 2004-01-02 14:20:15 by reinelt] debianization added - * [r284] trunk/ChangeLog, trunk/TODO: + * [r284] [lcd4linux @ 2004-01-02 14:18:54 by reinelt] Changelog, TODO updated 2003-12-19 reinelt - * [r283] trunk/Makefile.am, trunk/Makefile.in, trunk/plugin.c, - trunk/plugin_xmms.c: + * [r283] [lcd4linux @ 2003-12-19 06:27:33 by reinelt] added XMMS plugin from Markus Keil - * [r282] trunk/.cvsignore: + * [r282] [lcd4linux @ 2003-12-19 05:56:13 by reinelt] added .cvsignore containing '*.lo' - * [r281] trunk/plugin_math.c, trunk/plugin_string.c: + * [r281] [lcd4linux @ 2003-12-19 05:50:34 by reinelt] added plugin_math.c and plugin_string.c - * [r280] trunk/Makefile.am, trunk/Makefile.in, trunk/plugin.c: + * [r280] [lcd4linux @ 2003-12-19 05:49:23 by reinelt] extracted plugin_math and plugin_string into extra files - * [r279] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/cfg.c, trunk/client.c, - trunk/client.h, trunk/lcd4linux.c, trunk/plugin.c, - trunk/plugin.h: + * [r279] [lcd4linux @ 2003-12-19 05:35:13 by reinelt] renamed 'client' to 'plugin' 2003-12-01 reinelt - * [r278] trunk/lcd4linux.c, trunk/system.c, trunk/wifi.c: + * [r278] [lcd4linux @ 2003-12-01 07:08:50 by reinelt] Patches from Xavier: - WiFi: make interface configurable @@ -3717,82 +3428,77 @@ 2003-11-30 reinelt - * [r277] trunk/Cwlinux.c: + * [r277] [lcd4linux @ 2003-11-30 16:18:36 by reinelt] Cwlinux: invalidate Framebuffer in case a char got redefined 2003-11-28 nicowallmeier - * [r276] trunk/wifi.c: + * [r276] [lcd4linux @ 2003-11-28 18:34:55 by nicowallmeier] Minor bugfixes 2003-11-24 reinelt - * [r275] trunk/isdn.c, trunk/processor.c: + * [r275] [lcd4linux @ 2003-11-24 11:34:54 by reinelt] 'Fixed' Rows which do not scroll by Lars Kempe temporary workaround for debian kernel-header bug 2003-11-16 reinelt - * [r274] trunk/Crystalfontz.c, trunk/MatrixOrbital.c, - trunk/lcd4linux.c: + * [r274] [lcd4linux @ 2003-11-16 09:45:49 by reinelt] Crystalfontz changes, small glitch in getopt() fixed 2003-11-14 reinelt - * [r273] trunk/wifi.c, trunk/wifi.h: + * [r273] [lcd4linux @ 2003-11-14 05:59:37 by reinelt] added wifi.c wifi.h which have been forgotten at the last checkin 2003-11-12 reinelt - * [r272] trunk/HD44780.c: + * [r272] [lcd4linux @ 2003-11-12 05:42:35 by reinelt] small changes to the 16x4 handling 2003-11-11 reinelt - * [r271] trunk/Makefile.am, trunk/Makefile.in, trunk/parser.c, - trunk/parser.h, trunk/processor.c: + * [r271] [lcd4linux @ 2003-11-11 04:40:20 by reinelt] WIFI patch from Xavier Vello - * [r270] trunk/TODO, trunk/dvb.c: + * [r270] [lcd4linux @ 2003-11-11 04:30:41 by reinelt] very minor changes 2003-10-27 reinelt - * [r269] trunk/README.Rows, trunk/README.Tokens, - trunk/lcd4linux.conf.sample: + * [r269] [lcd4linux @ 2003-10-27 09:05:42 by reinelt] README.Rows, README.Tokens, lcd4linux.conf.sample from Thomas Siedentopf 2003-10-22 reinelt - * [r268] trunk/XWindow.c, trunk/icon.c: + * [r268] [lcd4linux @ 2003-10-22 04:32:25 by reinelt] fixed icon bug found by Rob van Nieuwkerk - * [r267] trunk/Makefile.in, trunk/MatrixOrbital.c, trunk/icon.c, - trunk/lcd4linux.c: + * [r267] [lcd4linux @ 2003-10-22 04:19:16 by reinelt] Makefile.in for imon.c/.h, some MatrixOrbital clients 2003-10-12 nicowallmeier - * [r266] trunk/Makefile.am, trunk/imon.c, trunk/imon.h, - trunk/parser.c, trunk/parser.h, trunk/processor.c: + * [r266] [lcd4linux @ 2003-10-12 06:08:28 by nicowallmeier] imond/telmond support 2003-10-12 reinelt - * [r265] trunk/MatrixOrbital.c, trunk/processor.c, trunk/udelay.c: + * [r265] [lcd4linux @ 2003-10-12 04:46:19 by reinelt] first try to integrate the Evaluator into a display driver (MatrixOrbital here) @@ -3802,10 +3508,7 @@ 2003-10-11 reinelt - * [r264] trunk/Makefile.am, trunk/Makefile.in, trunk/cfg.c, - trunk/client.c, trunk/client.h, trunk/config.guess, - trunk/config.sub, trunk/evaluator.c, trunk/evaluator.h, - trunk/expression.c, trunk/expression.h, trunk/lcd4linux.c: + * [r264] [lcd4linux @ 2003-10-11 06:01:52 by reinelt] renamed expression.{c,h} to client.{c,h} added config file client @@ -3814,114 +3517,90 @@ 2003-10-08 reinelt - * [r263] trunk/ChangeLog, trunk/parport.c: + * [r263] [lcd4linux @ 2003-10-08 14:21:10 by reinelt] Changelog; small type in parport.c 2003-10-08 andy-b - * [r262] trunk/MilfordInstruments.c: + * [r262] [lcd4linux @ 2003-10-08 13:39:53 by andy-b] Cleaned up code in MilfordInstruments.c, and added descriptions for other display sizes (untested) 2003-10-08 nicowallmeier - * [r261] trunk/HD44780.c: + * [r261] [lcd4linux @ 2003-10-08 06:48:47 by nicowallmeier] special handling for 16x4 displays - * [r260] trunk/HD44780.c: + * [r260] [lcd4linux @ 2003-10-08 06:45:00 by nicowallmeier] Support of two displays of the same size 2003-10-07 reinelt - * [r259] trunk/Makefile.in, trunk/config.h.in, trunk/configure, - trunk/configure.in: + * [r259] [lcd4linux @ 2003-10-07 04:12:38 by reinelt] AM_PROG_LIBTOOL removed 2003-10-06 reinelt - * [r258] trunk/expression.c: + * [r258] [lcd4linux @ 2003-10-06 05:51:15 by reinelt] functions: min(), max() - * [r257] trunk/evaluator.c, trunk/expression.c: + * [r257] [lcd4linux @ 2003-10-06 05:47:27 by reinelt] operators: ==, \!=, <=, >= - * [r256] trunk/evaluator.c, trunk/evaluator.h, trunk/expression.c, - trunk/expression.h: + * [r256] [lcd4linux @ 2003-10-06 04:34:06 by reinelt] expression evaluator added - * [r255] trunk/bootstrap, trunk/libtool: + * [r255] [lcd4linux @ 2003-10-06 04:33:06 by reinelt] files 'libtool' and 'bootstrap' added - * [r254] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in: + * [r254] [lcd4linux @ 2003-10-06 04:30:43 by reinelt] libtool stuff again... 2003-10-05 reinelt - * [r253] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/Makefile.am, trunk/Makefile.in, trunk/MatrixOrbital.c, - trunk/MilfordInstruments.c, trunk/PalmPilot.c, trunk/Raster.c, - trunk/SIN.c, trunk/Skeleton.c, trunk/T6963.c, trunk/Text.c, - trunk/USBLCD.c, trunk/XWindow.c, trunk/bar.c, trunk/bar.h, - trunk/battery.c, trunk/battery.h, trunk/cfg.c, trunk/cfg.h, - trunk/debug.c, trunk/debug.h, trunk/display.c, trunk/display.h, - trunk/dvb.c, trunk/dvb.h, trunk/exec.c, trunk/exec.h, - trunk/filter.c, trunk/filter.h, trunk/fontmap.c, trunk/fontmap.h, - trunk/icon.c, trunk/icon.h, trunk/isdn.c, trunk/isdn.h, - trunk/lcd4linux.c, trunk/lock.c, trunk/lock.h, trunk/mail.c, - trunk/mail.h, trunk/mail2.c, trunk/parport.c, trunk/parport.h, - trunk/parser.c, trunk/parser.h, trunk/pid.c, trunk/pid.h, - trunk/pixmap.c, trunk/pixmap.h, trunk/processor.c, - trunk/processor.h, trunk/seti.c, trunk/seti.h, trunk/socket.c, - trunk/socket.h, trunk/system.c, trunk/system.h, trunk/udelay.c, - trunk/udelay.h, trunk/widget.c, trunk/widget.h: + * [r253] [lcd4linux @ 2003-10-05 17:58:50 by reinelt] libtool junk; copyright messages cleaned up 2003-10-04 reinelt - * [r252] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/ltmain.sh: + * [r252] [lcd4linux @ 2003-10-04 07:54:17 by reinelt] autoconf/automake/libtool fixes from Ronald Landheer-Cieslak 2003-10-03 reinelt - * [r251] trunk/parport.c: + * [r251] [lcd4linux @ 2003-10-03 03:53:12 by reinelt] compile error in parport fixed (thanks to Andrew from FilmCan) - * [r250] trunk/MatrixOrbital.c, trunk/processor.c: + * [r250] [lcd4linux @ 2003-10-03 03:51:14 by reinelt] start support for new MatrixOrbital MX2 displays 2003-09-29 reinelt - * [r249] trunk/Makefile.am, trunk/Makefile.in, - trunk/MilfordInstruments.c, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/display.c: + * [r249] [lcd4linux @ 2003-09-29 06:58:36 by reinelt] new driver for Milford Instruments MI420 by Andy Baxter - * [r248] trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/T6963.c: + * [r248] [lcd4linux @ 2003-09-29 06:12:56 by reinelt] changed default HD44780 wiring: unused signals are GND 2003-09-21 reinelt - * [r247] trunk/HD44780.c, trunk/MatrixOrbital.c: + * [r247] [lcd4linux @ 2003-09-21 06:43:02 by reinelt] MatrixOrbital: bidirectional communication HD44780: special handling for 16x1 displays (thanks to anonymous @@ -3929,379 +3608,318 @@ 2003-09-19 reinelt - * [r246] trunk/ChangeLog, trunk/configure, trunk/configure.in, - trunk/lock.c: + * [r246] [lcd4linux @ 2003-09-19 08:40:32 by reinelt] increased version number to 0.9.12 port locking is done as /var/lock/LCK..usb_tts_0 for /dev/usb/tts/0 - * [r245] trunk/Makefile.am, trunk/Makefile.in, trunk/TODO, - trunk/icon.c, trunk/widget.c, trunk/widget.h: + * [r245] [lcd4linux @ 2003-09-19 03:51:29 by reinelt] minor fixes, widget.c added 2003-09-13 reinelt - * [r244] trunk/ChangeLog, trunk/configure, trunk/configure.in: + * [r244] [lcd4linux @ 2003-09-13 07:20:51 by reinelt] Changelog - * [r243] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/MatrixOrbital.c, trunk/PalmPilot.c, - trunk/SIN.c, trunk/Skeleton.c, trunk/T6963.c, trunk/Text.c: + * [r243] [lcd4linux @ 2003-09-13 06:45:43 by reinelt] icons for all remaining drivers - * [r242] trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/aclocal.m4, trunk/config.h.in, trunk/configure, - trunk/configure.in: + * [r242] [lcd4linux @ 2003-09-13 06:20:39 by reinelt] HD44780 timings changed; deactivated libtool 2003-09-11 reinelt - * [r241] trunk/config.sub, trunk/configure, trunk/configure.in: + * [r241] [lcd4linux @ 2003-09-11 15:05:24 by reinelt] missing files for autoconf/automake/libtool - * [r240] trunk/HD44780.c, trunk/M50530.c, trunk/MatrixOrbital.c, - trunk/USBLCD.c, trunk/icon.c, trunk/processor.c: + * [r240] [lcd4linux @ 2003-09-11 04:09:52 by reinelt] minor cleanups 2003-09-10 reinelt - * [r239] trunk/Makefile.in, trunk/configure, trunk/configure.in, - trunk/processor.c: + * [r239] [lcd4linux @ 2003-09-10 15:59:39 by reinelt] minor cleanups - * [r238] trunk/ChangeLog: + * [r238] [lcd4linux @ 2003-09-10 15:09:21 by reinelt] ChangeLog - * [r237] trunk/Raster.c, trunk/XWindow.c, trunk/icon.c, - trunk/pixmap.c, trunk/pixmap.h, trunk/processor.c: + * [r237] [lcd4linux @ 2003-09-10 14:01:52 by reinelt] icons nearly finished\! - * [r236] trunk/lcd4linux.c, trunk/processor.c: + * [r236] [lcd4linux @ 2003-09-10 08:37:09 by reinelt] icons: reorganized tick_* again... - * [r235] trunk/HD44780.c, trunk/M50530.c, trunk/MatrixOrbital.c, - trunk/USBLCD.c, trunk/display.c, trunk/icon.c, trunk/processor.c: + * [r235] [lcd4linux @ 2003-09-10 03:48:22 by reinelt] Icons for M50530, new processing scheme (Ticks.Text...) 2003-09-09 reinelt - * [r234] trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/USBLCD.c: + * [r234] [lcd4linux @ 2003-09-09 11:47:47 by reinelt] basic icon support for HD44780 - * [r233] trunk/Crystalfontz.c, trunk/Cwlinux.c, trunk/HD44780.c, - trunk/M50530.c, trunk/MatrixOrbital.c, trunk/PalmPilot.c, - trunk/Raster.c, trunk/USBLCD.c, trunk/XWindow.c, trunk/cfg.c, - trunk/cfg.h, trunk/filter.c, trunk/lcd4linux.c, trunk/parport.c, - trunk/processor.c: + * [r233] [lcd4linux @ 2003-09-09 06:54:43 by reinelt] new function 'cfg_number()' - * [r232] trunk/MatrixOrbital.c, trunk/TODO, trunk/USBLCD.c, - trunk/bar.c, trunk/display.c, trunk/display.h, trunk/icon.c, - trunk/icon.h, trunk/lcd4linux.c, trunk/processor.c, - trunk/processor.h: + * [r232] [lcd4linux @ 2003-09-09 05:30:33 by reinelt] even more icons stuff 2003-09-01 reinelt - * [r231] trunk/Makefile.am, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.guess, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/ltmain.sh: + * [r231] [lcd4linux @ 2003-09-01 07:07:03 by reinelt] shared liblcd4linux - * [r230] trunk/MatrixOrbital.c, trunk/bar.c, trunk/display.c, - trunk/display.h, trunk/icon.c, trunk/icon.h, trunk/parser.c, - trunk/parser.h, trunk/processor.c: + * [r230] [lcd4linux @ 2003-09-01 04:09:34 by reinelt] icons nearly finished, but MatrixOrbital only 2003-08-24 reinelt - * [r229] trunk/ChangeLog: + * [r229] [lcd4linux @ 2003-08-24 05:28:31 by reinelt] ChangeLog - * [r228] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/Makefile.am, trunk/Makefile.in, trunk/MatrixOrbital.c, - trunk/PalmPilot.c, trunk/Raster.c, trunk/SIN.c, trunk/Text.c, - trunk/USBLCD.c, trunk/cfg.c, trunk/cfg.h, trunk/debug.c, - trunk/debug.h, trunk/display.c, trunk/display.h, trunk/icon.c, - trunk/lcd4linux.c, trunk/parport.c, trunk/processor.c, - trunk/seti.c, trunk/system.c: + * [r228] [lcd4linux @ 2003-08-24 05:17:58 by reinelt] liblcd4linux patch from Patrick Schemitz - * [r227] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/display.c, trunk/icon.c, - trunk/icon.h: + * [r227] [lcd4linux @ 2003-08-24 04:31:56 by reinelt] icon.c icon.h added 2003-08-22 reinelt - * [r226] trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/parport.c: + * [r226] [lcd4linux @ 2003-08-22 03:45:08 by reinelt] bug in parallel port code fixed, more icons stuff 2003-08-20 reinelt - * [r225] trunk/bar.c: + * [r225] [lcd4linux @ 2003-08-20 05:26:43 by reinelt] small bug in bar compaction fixed 2003-08-19 reinelt - * [r224] trunk/HD44780.c, trunk/parport.c: + * [r224] [lcd4linux @ 2003-08-19 05:23:55 by reinelt] HD44780 dual-controller patch from Jesse Brook Kovach - * [r223] trunk/Crystalfontz.c, trunk/HD44780.c, - trunk/MatrixOrbital.c, trunk/bar.c: + * [r223] [lcd4linux @ 2003-08-19 04:28:41 by reinelt] more Icon stuff, minor glitches fixed 2003-08-17 reinelt - * [r222] trunk/MatrixOrbital.c, trunk/display.c, trunk/display.h, - trunk/lcd4linux.c, trunk/processor.c: + * [r222] [lcd4linux @ 2003-08-17 16:37:39 by reinelt] more icon framework - * [r221] trunk/PalmPilot.c, trunk/Raster.c, trunk/SIN.c, - trunk/Skeleton.c, trunk/display.c, trunk/display.h: + * [r221] [lcd4linux @ 2003-08-17 12:11:58 by reinelt] framework for icons prepared - * [r220] trunk/Makefile.am, trunk/Makefile.in, trunk/SIN.c, - trunk/Skeleton.c, trunk/configure, trunk/configure.in: + * [r220] [lcd4linux @ 2003-08-17 08:25:30 by reinelt] preparations for liblcd4linux; minor bugs in SIN.c and Skeleton.c - * [r219] trunk/ChangeLog, trunk/Crystalfontz.c, - trunk/Crystalfontz.h, trunk/Makefile.am, trunk/Makefile.in: + * [r219] [lcd4linux @ 2003-08-17 06:57:04 by reinelt] complete rewrite of the Crystalfontz driver - * [r218] trunk/config.guess: + * [r218] [lcd4linux @ 2003-08-17 04:38:57 by reinelt] added config.guess 2003-08-16 reinelt - * [r217] trunk/BeckmannEgle.c, trunk/Cwlinux.c, trunk/HD44780.c, - trunk/M50530.c, trunk/MatrixOrbital.c, trunk/T6963.c, - trunk/USBLCD.c, trunk/parport.c: + * [r217] [lcd4linux @ 2003-08-16 07:31:35 by reinelt] double buffering in all drivers 2003-08-15 reinelt - * [r216] trunk/HD44780.c, trunk/M50530.c, trunk/T6963.c, - trunk/parport.c, trunk/parport.h: + * [r216] [lcd4linux @ 2003-08-15 07:54:07 by reinelt] HD44780 4 bit mode implemented 2003-08-14 reinelt - * [r215] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in: + * [r215] [lcd4linux @ 2003-08-14 04:59:30 by reinelt] changed version to 0.9.11, added curses.m4 to Makefile.am - * [r214] trunk/ChangeLog: + * [r214] [lcd4linux @ 2003-08-14 03:48:54 by reinelt] ChangeLog - * [r213] trunk/cfg.c, trunk/lcd4linux.c: + * [r213] [lcd4linux @ 2003-08-14 03:47:40 by reinelt] remove PID file if driver initialisation fails 2003-08-12 reinelt - * [r212] trunk/HD44780.c, trunk/config.h.in, trunk/configure: + * [r212] [lcd4linux @ 2003-08-12 05:10:31 by reinelt] first version of HD44780 4Bit-Mode patch 2003-08-11 reinelt - * [r211] trunk/configure.in: + * [r211] [lcd4linux @ 2003-08-11 04:51:28 by reinelt] another uClibc issue: realloc 2003-08-08 reinelt - * [r210] trunk/ChangeLog, trunk/configure, trunk/configure.in: + * [r210] [lcd4linux @ 2003-08-08 23:11:34 by reinelt] - * [r209] trunk/dvb.c, trunk/dvb.h: + * [r209] [lcd4linux @ 2003-08-08 23:08:38 by reinelt] CVS Id and Log missing from dvb.{c,h} - * [r208] trunk/Makefile.am, trunk/Makefile.in, trunk/lcd4linux.c, - trunk/pid.c, trunk/pid.h: + * [r208] [lcd4linux @ 2003-08-08 08:05:23 by reinelt] added PID file handling - * [r207] trunk/ChangeLog, trunk/configure, trunk/debug.c, - trunk/lcd4linux.c: + * [r207] [lcd4linux @ 2003-08-08 06:58:06 by reinelt] improved forking - * [r206] trunk/CREDITS, trunk/ChangeLog, trunk/TODO, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/dvb.c: + * [r206] [lcd4linux @ 2003-08-08 05:42:51 by reinelt] uClibc compatibility issue; small glitch in dvb.c 2003-08-01 reinelt - * [r205] trunk/Cwlinux.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/README, trunk/T6963.c: + * [r205] [lcd4linux @ 2003-08-01 05:15:42 by reinelt] last cleanups for 0.9.9 2003-07-29 reinelt - * [r204] trunk/Makefile.in, trunk/Raster.c, trunk/aclocal.m4, - trunk/configure, trunk/configure.in: + * [r204] [lcd4linux @ 2003-07-29 04:56:13 by reinelt] disable Raster driver automagically if gd.h not found 2003-07-28 reinelt - * [r203] trunk/README.Crystalfontz, trunk/README.HD44780, - trunk/README.HD44780.GPO, trunk/README.MatrixOrbital, - trunk/README.Png, trunk/README.Raster, trunk/README.Text, - trunk/README.Webinterface, trunk/README.X11: + * [r203] [lcd4linux @ 2003-07-28 08:22:17 by reinelt] several README's moved to web page 2003-07-24 reinelt - * [r202] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/MatrixOrbital.c, trunk/PalmPilot.c, trunk/Raster.c, - trunk/SIN.c, trunk/Skeleton.c, trunk/T6963.c, trunk/Text.c, - trunk/USBLCD.c, trunk/XWindow.c, trunk/display.c, - trunk/display.h, trunk/lcd4linux.c, trunk/processor.c: + * [r202] [lcd4linux @ 2003-07-24 04:48:09 by reinelt] 'soft clear' needed for virtual rows 2003-07-21 reinelt - * [r201] trunk/processor.c: + * [r201] [lcd4linux @ 2003-07-21 06:34:14 by reinelt] bars on virtual rows fixed - * [r200] trunk/processor.c: + * [r200] [lcd4linux @ 2003-07-21 06:10:11 by reinelt] removed maxlen parameter from process_row() - * [r199] trunk/dvb.c: + * [r199] [lcd4linux @ 2003-07-21 05:56:48 by reinelt] check for HAVE_LINUX_DVB_FRONTEND_H needs config.h 2003-07-19 reinelt - * [r198] trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/dvb.c: + * [r198] [lcd4linux @ 2003-07-19 09:42:42 by reinelt] check for dvb/frontend.h and disable DVB client if not found. 2003-07-18 reinelt - * [r197] trunk/udelay.c: + * [r197] [lcd4linux @ 2003-07-18 04:43:14 by reinelt] udelay: unnecessary sanity check removed 2003-06-26 reinelt - * [r196] trunk/system.c: + * [r196] [lcd4linux @ 2003-06-26 05:31:16 by reinelt] bug in /proc/net/dev parsing fixed 2003-06-22 reinelt - * [r195] trunk/dvb.c, trunk/dvb.h: + * [r195] [lcd4linux @ 2003-06-22 19:31:24 by reinelt] added dvb.c dvb.h 2003-06-21 reinelt - * [r194] trunk/Makefile.am, trunk/Makefile.in, trunk/isdn.c, - trunk/parser.c, trunk/parser.h, trunk/processor.c: + * [r194] [lcd4linux @ 2003-06-21 05:46:18 by reinelt] DVB client integrated 2003-06-13 reinelt - * [r193] trunk/processor.c: + * [r193] [lcd4linux @ 2003-06-13 06:35:56 by reinelt] added scrolling capability - * [r192] trunk/lcd4linux.c, trunk/seti.c, trunk/system.c: + * [r192] [lcd4linux @ 2003-06-13 05:11:10 by reinelt] error message cosmetics 2003-05-19 reinelt - * [r191] trunk/Cwlinux.c: + * [r191] [lcd4linux @ 2003-05-19 05:55:17 by reinelt] Cwlinux sleep optimization 2003-05-14 reinelt - * [r190] trunk/Cwlinux.c: + * [r190] [lcd4linux @ 2003-05-14 06:17:39 by reinelt] added support for CW1602 2003-04-12 reinelt - * [r189] trunk/XWindow.c: + * [r189] [lcd4linux @ 2003-04-12 16:23:10 by reinelt] small glitch in XWindow.c (thanks to Moe Wibble) 2003-04-07 reinelt - * [r188] trunk/HD44780.c, trunk/M50530.c, trunk/T6963.c, - trunk/lcd4linux.c, trunk/parport.c, trunk/parport.h: + * [r188] [lcd4linux @ 2003-04-07 06:02:58 by reinelt] further parallel port abstraction 2003-04-04 reinelt - * [r187] trunk/HD44780.c, trunk/M50530.c, trunk/USBLCD.c, - trunk/configure, trunk/configure.in, trunk/parport.c, - trunk/parport.h, trunk/udelay.c: + * [r187] [lcd4linux @ 2003-04-04 06:01:59 by reinelt] new parallel port abstraction scheme 2003-02-27 reinelt - * [r186] trunk/configure, trunk/configure.in: + * [r186] [lcd4linux @ 2003-02-27 07:48:57 by reinelt] changed versioning scheme from 0.99 to 0.9.9 - * [r185] trunk/INSTALL, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/curses.m4, trunk/install-sh, trunk/missing, - trunk/mkinstalldirs, trunk/udelay.c: + * [r185] [lcd4linux @ 2003-02-27 07:43:10 by reinelt] asm/msr.h: included hard-coded definition of rdtscl() if msr.h cannot be found. @@ -4311,45 +3929,39 @@ 2003-02-24 reinelt - * [r184] trunk/Cwlinux.c: + * [r184] [lcd4linux @ 2003-02-24 04:50:57 by reinelt] cwlinux fixes 2003-02-22 reinelt - * [r183] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/Cwlinux.c, trunk/HD44780.c, trunk/M50530.c, - trunk/MatrixOrbital.c, trunk/PalmPilot.c, trunk/Raster.c, - trunk/SIN.c, trunk/T6963.c, trunk/Text.c, trunk/USBLCD.c, - trunk/XWindow.c, trunk/cfg.c, trunk/cfg.h, trunk/exec.c, - trunk/filter.c, trunk/lcd4linux.c, trunk/mail.c, trunk/mail2.c, - trunk/processor.c, trunk/seti.c, trunk/system.c: + * [r183] [lcd4linux @ 2003-02-22 07:53:09 by reinelt] cfg_get(key,defval) - * [r182] trunk/Cwlinux.c: + * [r182] [lcd4linux @ 2003-02-22 07:23:24 by reinelt] Cwlinux fixes 2003-02-18 reinelt - * [r181] trunk/README.X11, trunk/XWindow.c: + * [r181] [lcd4linux @ 2003-02-18 06:13:44 by reinelt] X11 driver fixes and cleanup 2003-02-17 reinelt - * [r180] trunk/XWindow.c: + * [r180] [lcd4linux @ 2003-02-17 06:06:12 by reinelt] small bug in X11 driver: omit pixel gap between cahracters - * [r179] trunk/Text.c: + * [r179] [lcd4linux @ 2003-02-17 04:27:58 by reinelt] Text (curses) driver: cosmetic changes 2003-02-13 reinelt - * [r178] trunk/MatrixOrbital.c, trunk/lcd4linux.c: + * [r178] [lcd4linux @ 2003-02-13 10:40:17 by reinelt] changed "copyright" to "2003" added slightly different protocol for MatrixOrbital "LK202" @@ -4357,7 +3969,7 @@ 2003-02-05 reinelt - * [r177] trunk/exec.c, trunk/processor.c: + * [r177] [lcd4linux @ 2003-02-05 04:31:38 by reinelt] T_EXEC: remove trailing CR/LF T_EXEC: deactivated maxlen calculation (for I don't understand @@ -4365,177 +3977,157 @@ 2003-01-12 reinelt - * [r176] trunk/bar.c: + * [r176] [lcd4linux @ 2003-01-12 06:51:27 by reinelt] fixed bug in bar compaction 2002-12-08 reinelt - * [r175] trunk/AUTHORS, trunk/ChangeLog, trunk/Makefile.am, - trunk/Makefile.in, trunk/acconfig.h, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/curses.m4, trunk/depcomp: + * [r175] [lcd4linux @ 2002-12-08 07:36:06 by reinelt] autoconf/automake cleanup 2002-12-06 reinelt - * [r174] trunk/CREDITS, trunk/Makefile.in, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/configure.in: + * [r174] [lcd4linux @ 2002-12-06 07:38:43 by reinelt] libgd/libpng bugfix: removed '-lpng -lz' from LDFLAGS 2002-12-05 reinelt - * [r173] trunk/mail2.c, trunk/parser.c, trunk/processor.c: + * [r173] [lcd4linux @ 2002-12-05 19:23:01 by reinelt] fixed undefined operations found by gcc3 - * [r172] trunk/system.c: + * [r172] [lcd4linux @ 2002-12-05 19:12:47 by reinelt] sensors factor and offset patch from Petri Damsten <petri.damsten@raketti.net> - * [r171] trunk/Makefile.am, trunk/Makefile.in, trunk/configure, - trunk/configure.in, trunk/display.c, trunk/socket.c: + * [r171] [lcd4linux @ 2002-12-05 19:09:57 by reinelt] patches for gcc-3.2 2002-09-12 reinelt - * [r170] trunk/Cwlinux.c: + * [r170] [lcd4linux @ 2002-09-12 05:24:54 by reinelt] code cleanup, character defining for bars 2002-09-11 reinelt - * [r169] trunk/Cwlinux.c: + * [r169] [lcd4linux @ 2002-09-11 05:32:35 by reinelt] changed to use new bar functions - * [r168] trunk/Cwlinux.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/acconfig.h, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/display.c: + * [r168] [lcd4linux @ 2002-09-11 05:16:32 by reinelt] added Cwlinux driver 2002-08-30 reinelt - * [r167] trunk/Text.c: + * [r167] [lcd4linux @ 2002-08-30 03:54:01 by reinelt] bug in curses driver fixed 2002-08-22 reinelt - * [r166] trunk/BeckmannEgle.c: + * [r166] [lcd4linux @ 2002-08-22 05:51:36 by reinelt] cosmetic changes 2002-08-21 reinelt - * [r165] trunk/T6963.c, trunk/udelay.c: + * [r165] [lcd4linux @ 2002-08-21 06:09:53 by reinelt] some T6963 fixes, ndelay wrap 2002-08-19 reinelt - * [r164] trunk/BeckmannEgle.c, trunk/M50530.c: + * [r164] [lcd4linux @ 2002-08-19 10:51:06 by reinelt] M50530 driver using new generic bar functions - * [r163] trunk/BeckmannEgle.c: + * [r163] [lcd4linux @ 2002-08-19 09:43:43 by reinelt] BeckmannEgle using new generic bar functions - * [r162] trunk/MatrixOrbital.c: + * [r162] [lcd4linux @ 2002-08-19 09:30:18 by reinelt] MatrixOrbital uses generic bar funnctions - * [r161] trunk/HD44780.c, trunk/USBLCD.c: + * [r161] [lcd4linux @ 2002-08-19 09:11:34 by reinelt] changed HD44780 to use generic bar functions - * [r160] trunk/USBLCD.c, trunk/bar.c, trunk/bar.h: + * [r160] [lcd4linux @ 2002-08-19 07:52:19 by reinelt] corrected type declaration of (*defchar)() - * [r159] trunk/BeckmannEgle.c, trunk/HD44780.c, trunk/M50530.c, - trunk/MatrixOrbital.c, trunk/USBLCD.c, trunk/bar.c, trunk/bar.h: + * [r159] [lcd4linux @ 2002-08-19 07:36:29 by reinelt] finished bar.c, USBLCD is the first driver that uses the generic bar functions - * [r158] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/HD44780.c, trunk/M50530.c, trunk/Makefile.am, - trunk/Makefile.in, trunk/MatrixOrbital.c, trunk/PalmPilot.c, - trunk/Raster.c, trunk/T6963.c, trunk/Text.c, trunk/USBLCD.c, - trunk/XWindow.c, trunk/bar.c, trunk/bar.h, trunk/display.c, - trunk/display.h, trunk/parser.c, trunk/pixmap.c, - trunk/processor.c: + * [r158] [lcd4linux @ 2002-08-19 04:41:20 by reinelt] introduced bar.c, moved bar stuff from display.h to bar.h 2002-08-18 reinelt - * [r157] trunk/USBLCD.c: + * [r157] [lcd4linux @ 2002-08-18 08:11:11 by reinelt] USBLCD buffered I/O 2002-08-17 reinelt - * [r156] trunk/HD44780.c, trunk/USBLCD.c, trunk/udelay.c: + * [r156] [lcd4linux @ 2002-08-17 14:14:21 by reinelt] USBLCD fixes - * [r155] trunk/Makefile.am, trunk/Makefile.in, trunk/USBLCD.c, - trunk/acconfig.h, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/display.c, trunk/lcd4linux.conf.sample: + * [r155] [lcd4linux @ 2002-08-17 13:10:22 by reinelt] USBLCD driver added - * [r154] trunk/T6963.c: + * [r154] [lcd4linux @ 2002-08-17 12:54:08 by reinelt] minor T6963 changes 2002-04-30 reinelt - * [r153] trunk/HD44780.c, trunk/M50530.c: + * [r153] [lcd4linux @ 2002-04-30 07:20:15 by reinelt] implemented the new ndelay(nanoseconds) in all parallel port drivers 2002-04-29 reinelt - * [r152] trunk/Makefile.in, trunk/README, trunk/T6963.c, - trunk/TODO, trunk/acconfig.h, trunk/aclocal.m4, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/display.c, trunk/exec.c, trunk/lcd4linux.c, trunk/udelay.c, - trunk/udelay.h: + * [r152] [lcd4linux @ 2002-04-29 11:00:25 by reinelt] added Toshiba T6963 driver added ndelay() with nanosecond resolution 2001-09-14 reinelt - * [r151] trunk/TODO: + * [r151] [lcd4linux @ 2001-09-14 05:57:06 by reinelt] 2001-09-13 reinelt - * [r150] trunk/TODO: + * [r150] [lcd4linux @ 2001-09-13 07:40:57 by reinelt] TODO update 2001-09-12 reinelt - * [r149] trunk/TODO, trunk/mail2.c: + * [r149] [lcd4linux @ 2001-09-12 06:17:22 by reinelt] - * [r148] trunk/mail.c, trunk/mail2.c, trunk/socket.c: + * [r148] [lcd4linux @ 2001-09-12 05:58:16 by reinelt] fixed bug in mail2.c - * [r147] trunk/debug.h, trunk/mail.c, trunk/seti.c, trunk/socket.c: + * [r147] [lcd4linux @ 2001-09-12 05:37:22 by reinelt] fixed a bug in seti.c (file was never closed, lcd4linux run out of fd's @@ -4544,74 +4136,68 @@ 2001-09-11 reinelt - * [r146] trunk/TODO: + * [r146] [lcd4linux @ 2001-09-11 06:43:43 by reinelt] TODO items - * [r145] trunk/M50530.c: + * [r145] [lcd4linux @ 2001-09-11 05:31:37 by reinelt] M50530 driver 2001-09-10 reinelt - * [r144] trunk/Makefile.in, trunk/Raster.c, trunk/acconfig.h, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/display.c: + * [r144] [lcd4linux @ 2001-09-10 13:55:53 by reinelt] M50530 driver 2001-09-09 reinelt - * [r143] trunk/HD44780.c: + * [r143] [lcd4linux @ 2001-09-09 12:26:03 by reinelt] GPO bug: INIT is _not_ inverted 2001-09-07 reinelt - * [r142] trunk/README.HD44780.GPO: + * [r142] [lcd4linux @ 2001-09-07 05:58:44 by reinelt] wrong Pin numbers 2001-09-05 reinelt - * [r141] trunk/NEWS, trunk/README: + * [r141] [lcd4linux @ 2001-09-05 09:38:52 by reinelt] 2001-08-08 reinelt - * [r140] trunk/udelay.c: + * [r140] [lcd4linux @ 2001-08-08 05:40:24 by reinelt] renamed CLK_TCK to CLOCKS_PER_SEC 2001-08-05 reinelt - * [r139] trunk/XWindow.c, trunk/battery.c, trunk/filter.c, - trunk/mail.c, trunk/seti.c, trunk/system.c: + * [r139] [lcd4linux @ 2001-08-05 17:13:29 by reinelt] cleaned up inlude of sys/time.h and time.h 2001-06-04 reinelt - * [r138] trunk/configure, trunk/configure.in: + * [r138] [lcd4linux @ 2001-06-04 07:49:58 by reinelt] configure for X11 modified 2001-05-31 ltoetsch - * [r137] trunk/Makefile.in, trunk/TODO, trunk/acconfig.h, - trunk/config.h.in, trunk/configure, trunk/configure.in, - trunk/curses.m4: + * [r137] [lcd4linux @ 2001-05-31 10:26:41 by ltoetsch] added tests for X and ncurses 2001-05-27 reinelt - * [r136] trunk/README: + * [r136] [lcd4linux @ 2001-05-27 17:32:35 by reinelt] updated README with the seti@home client stuff - * [r135] trunk/configure, trunk/configure.in, trunk/isdn.c, - trunk/pixmap.c: + * [r135] [lcd4linux @ 2001-05-27 07:19:28 by reinelt] fixed a warning in pixmap.c temporarily fixed a bug in isdn.c (ISDN_MAX_CHANNELS is no longer @@ -4620,22 +4206,20 @@ 2001-05-26 reinelt - * [r134] trunk/TODO: + * [r134] [lcd4linux @ 2001-05-26 06:51:28 by reinelt] added TODO entry 2001-05-06 reinelt - * [r133] trunk/processor.c: + * [r133] [lcd4linux @ 2001-05-06 10:01:27 by reinelt] fixed a bug which prevented extendet tokens to be used for GPO's many thanks to Carsten Nau! 2001-04-27 reinelt - * [r132] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/MatrixOrbital.c, trunk/PalmPilot.c, trunk/SIN.c, - trunk/configure, trunk/lcd4linux.c, trunk/lock.c, trunk/pixmap.c: + * [r132] [lcd4linux @ 2001-04-27 05:04:57 by reinelt] replaced OPEN_MAX with sysconf() replaced mktemp() with mkstemp() @@ -4643,276 +4227,239 @@ 2001-03-24 reinelt - * [r131] trunk/TODO: + * [r131] [lcd4linux @ 2001-03-24 09:26:25 by reinelt] new TODO item - * [r130] trunk/TODO: + * [r130] [lcd4linux @ 2001-03-24 09:04:19 by reinelt] new TODO item 2001-03-17 ltoetsch - * [r129] trunk/pixmap.c: + * [r129] [lcd4linux @ 2001-03-17 11:44:10 by ltoetsch] allow more then 1 BAR_T - * [r128] trunk/processor.c: + * [r128] [lcd4linux @ 2001-03-17 11:11:31 by ltoetsch] bugfix: max for BAR_T 2001-03-16 ltoetsch - * [r127] trunk/NEWS, trunk/PalmPilot.c, trunk/README, - trunk/Raster.c, trunk/TODO, trunk/Text.c, trunk/XWindow.c, - trunk/display.c, trunk/display.h, trunk/parser.c, trunk/pixmap.c, - trunk/processor.c: + * [r127] [lcd4linux @ 2001-03-16 16:40:17 by ltoetsch] implemented time bar - * [r126] trunk/README.Text, trunk/TODO, trunk/Text.c, - trunk/mail2.c, trunk/processor.c: + * [r126] [lcd4linux @ 2001-03-16 09:28:08 by ltoetsch] bugfixes 2001-03-15 ltoetsch - * [r125] trunk/HD44780.c, trunk/mail.c, trunk/processor.c: + * [r125] [lcd4linux @ 2001-03-15 15:49:22 by ltoetsch] fixed compile HD44780.c, cosmetics - * [r124] trunk/CREDITS, trunk/NEWS, trunk/README, trunk/TODO, - trunk/configure, trunk/display.c, trunk/lcd4linux.conf.sample, - trunk/mail.c, trunk/mail.h, trunk/mail2.c, trunk/socket.c: + * [r124] [lcd4linux @ 2001-03-15 14:25:05 by ltoetsch] added unread/total news - * [r123] trunk/mail2.c: + * [r123] [lcd4linux @ 2001-03-15 11:10:53 by ltoetsch] added quit/logout to pop/imap 2001-03-15 reinelt - * [r122] trunk/HD44780.c, trunk/lcd4linux.conf.sample, - trunk/processor.c: + * [r122] [lcd4linux @ 2001-03-15 09:47:13 by reinelt] some fixes to ppdef off-by-one bug in processor.c fixed 2001-03-15 ltoetsch - * [r121] trunk/exec.c: + * [r121] [lcd4linux @ 2001-03-15 09:13:22 by ltoetsch] delay first exec for faster start 2001-03-14 reinelt - * [r120] trunk/CREDITS, trunk/HD44780.c, trunk/TODO: + * [r120] [lcd4linux @ 2001-03-14 16:47:41 by reinelt] minor cleanups - * [r119] trunk/HD44780.c: + * [r119] [lcd4linux @ 2001-03-14 15:30:53 by reinelt] make ppdev compatible to earlier kernels - * [r118] trunk/HD44780.c, trunk/NEWS, trunk/README.HD44780, - trunk/TODO, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/lcd4linux.conf.sample: + * [r118] [lcd4linux @ 2001-03-14 15:14:59 by reinelt] added ppdev parallel port access 2001-03-14 ltoetsch - * [r117] trunk/Makefile.am, trunk/Makefile.in, trunk/NEWS, - trunk/README, trunk/TODO, trunk/configure, trunk/debug.h, - trunk/lcd4linux.conf.sample, trunk/mail.c, trunk/mail.h, - trunk/mail2.c, trunk/parser.c, trunk/parser.h, trunk/processor.c, - trunk/socket.c, trunk/socket.h: + * [r117] [lcd4linux @ 2001-03-14 13:19:29 by ltoetsch] Added pop3/imap4 mail support 2001-03-13 reinelt - * [r116] trunk/exec.c, trunk/lcd4linux.conf.sample, trunk/mail.c, - trunk/parser.c, trunk/processor.c, trunk/system.c: + * [r116] [lcd4linux @ 2001-03-13 08:34:15 by reinelt] corrected a off-by-one bug with sensors - * [r115] trunk/Makefile.am, trunk/Makefile.in, trunk/acconfig.h: + * [r115] [lcd4linux @ 2001-03-13 08:03:41 by reinelt] added missing autoheader files - * [r114] trunk/Makefile.am, trunk/Makefile.in: + * [r114] [lcd4linux @ 2001-03-13 07:53:00 by reinelt] added several files for the distribution - * [r113] trunk/NEWS, trunk/README, trunk/lcd4linux.c: + * [r113] [lcd4linux @ 2001-03-13 07:41:22 by reinelt] added NEWS file 2001-03-12 reinelt - * [r112] trunk/HD44780.c, trunk/TODO, trunk/config.h.in, - trunk/configure, trunk/configure.in, trunk/lcd4linux.conf.sample, - trunk/udelay.c, trunk/udelay.h: + * [r112] [lcd4linux @ 2001-03-12 13:44:58 by reinelt] new udelay() using Time Stamp Counters - * [r111] trunk/configure, trunk/configure.in: + * [r111] [lcd4linux @ 2001-03-12 12:49:24 by reinelt] even better configure handling... - * [r110] trunk/HD44780.c, trunk/Makefile.in, trunk/Raster.c, - trunk/TODO, trunk/aclocal.m4, trunk/config.h.in, trunk/configure, - trunk/configure.in, trunk/debug.c, trunk/display.c, - trunk/lcd4linux.c, trunk/system.c, trunk/udelay.c, - trunk/udelay.h: + * [r110] [lcd4linux @ 2001-03-12 12:39:36 by reinelt] reworked autoconf a lot: drivers may be excluded, #define's went to config.h 2001-03-09 ltoetsch - * [r109] trunk/configure, trunk/configure.in: + * [r109] [lcd4linux @ 2001-03-09 16:24:30 by ltoetsch] disable driver in configure 2001-03-09 reinelt - * [r108] trunk/TODO, trunk/Text.c, trunk/configure: + * [r108] [lcd4linux @ 2001-03-09 15:04:53 by reinelt] rename 'raster' to 'Text in Text.c added TOTO item - * [r107] trunk/TODO: + * [r107] [lcd4linux @ 2001-03-09 14:30:01 by reinelt] new ideas for TODO 2001-03-09 ltoetsch - * [r106] trunk/README, trunk/exec.c, trunk/lcd4linux.conf.sample: + * [r106] [lcd4linux @ 2001-03-09 14:24:49 by ltoetsch] exec: Scale_x ->Min/Max_x - * [r105] trunk/Makefile.am, trunk/Makefile.in, trunk/README, - trunk/README.Drivers, trunk/README.Text, trunk/Skeleton.c, - trunk/Text.c, trunk/configure, trunk/configure.in, trunk/debug.c, - trunk/display.c, trunk/lcd4linux.conf.sample: + * [r105] [lcd4linux @ 2001-03-09 13:08:11 by ltoetsch] Added Text driver 2001-03-09 reinelt - * [r104] trunk/TODO, trunk/cfg.c, trunk/lcd4linux.conf.sample, - trunk/system.c: + * [r104] [lcd4linux @ 2001-03-09 12:14:24 by reinelt] minor cleanups 2001-03-08 ltoetsch - * [r103] trunk/README, trunk/TODO, trunk/cfg.c, trunk/exec.c, - trunk/exec.h, trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, - trunk/parser.c, trunk/processor.c: + * [r103] [lcd4linux @ 2001-03-08 15:25:38 by ltoetsch] improved exec 2001-03-08 reinelt - * [r102] trunk/mail.c, trunk/mail.h, trunk/seti.c, trunk/seti.h: + * [r102] [lcd4linux @ 2001-03-08 09:02:04 by reinelt] seti client cleanup - * [r101] trunk/exec.c, trunk/processor.c: + * [r101] [lcd4linux @ 2001-03-08 08:39:54 by reinelt] fixed two typos 2001-03-07 ltoetsch - * [r100] trunk/Makefile.am, trunk/Makefile.in, trunk/README, - trunk/cfg.c, trunk/configure, trunk/exec.c, trunk/exec.h, - trunk/parser.c, trunk/parser.h, trunk/processor.c: + * [r100] [lcd4linux @ 2001-03-07 18:10:21 by ltoetsch] added e(x)ec commands 2001-03-05 reinelt - * [r99] trunk/TODO, trunk/lcd4linux.conf.sample: + * [r99] [lcd4linux @ 2001-03-05 18:20:21 by reinelt] TOTO list update 2001-03-04 ltoetsch - * [r98] trunk/README.Raster: + * [r98] [lcd4linux @ 2001-03-04 15:01:12 by ltoetsch] Added PNG 2001-03-02 reinelt - * [r97] trunk/configure, trunk/configure.in, trunk/system.c: + * [r97] [lcd4linux @ 2001-03-02 20:18:12 by reinelt] allow compile on systems without net/if_ppp.h - * [r96] trunk/README.Png: + * [r96] [lcd4linux @ 2001-03-02 18:06:18 by reinelt] README for PNG added - * [r95] trunk/Raster.c, trunk/configure, trunk/configure.in: + * [r95] [lcd4linux @ 2001-03-02 17:18:52 by reinelt] let configure find gd.h - * [r94] trunk/battery.c, trunk/battery.h: + * [r94] [lcd4linux @ 2001-03-02 11:04:08 by reinelt] cosmetic cleanups (comment headers) 2001-03-02 ltoetsch - * [r93] trunk/Makefile.am, trunk/Makefile.in, trunk/README, - trunk/Raster.c, trunk/TODO, trunk/battery.c, trunk/battery.h, - trunk/lcd4linux.conf.sample, trunk/parser.c, trunk/parser.h, - trunk/processor.c: + * [r93] [lcd4linux @ 2001-03-02 10:18:03 by ltoetsch] added /proc/apm battery stat 2001-03-01 reinelt - * [r92] trunk/Raster.c, trunk/lcd4linux.conf.sample, - trunk/udelay.c: + * [r92] [lcd4linux @ 2001-03-01 22:33:50 by reinelt] renamed Raster_flush() to PPM_flush() 2001-03-01 ltoetsch - * [r91] trunk/README.Webinterface, trunk/Raster.c, trunk/nph-png, - trunk/png.html: + * [r91] [lcd4linux @ 2001-03-01 15:11:30 by ltoetsch] added PNG,Webinterface 2001-03-01 reinelt - * [r90] trunk/Makefile.am, trunk/Makefile.in, trunk/Raster.c, - trunk/XWindow.c, trunk/aclocal.m4, trunk/configure, - trunk/configure.in, trunk/display.c: + * [r90] [lcd4linux @ 2001-03-01 11:08:16 by reinelt] reworked configure to allow selection of drivers 2001-02-26 herp - * [r89] trunk/XWindow.c: + * [r89] [lcd4linux @ 2001-02-26 00:33:37 by herp] fixed X11 signal handler 2001-02-21 reinelt - * [r88] trunk/mail.c: + * [r88] [lcd4linux @ 2001-02-21 04:48:13 by reinelt] big mailbox patch from Axel Ehnert thanks to herp for his idea to check mtime of mailbox 2001-02-19 reinelt - * [r87] trunk/Makefile.am, trunk/Makefile.in, - trunk/lcd4linux.conf.sample, trunk/mail.c, trunk/parser.c, - trunk/parser.h, trunk/processor.c, trunk/seti.c, trunk/seti.h: + * [r87] [lcd4linux @ 2001-02-19 00:15:46 by reinelt] integrated mail and seti client major rewrite of parser and tokenizer to support double-byte @@ -4920,60 +4467,53 @@ 2001-02-18 reinelt - * [r86] trunk/mail.c, trunk/mail.h: + * [r86] [lcd4linux @ 2001-02-18 22:11:34 by reinelt] - * [r85] trunk/seti.c: + * [r85] [lcd4linux @ 2001-02-18 21:16:06 by reinelt] - * [r84] trunk/Makefile.am, trunk/Makefile.in, trunk/TODO, - trunk/seti.c, trunk/seti.h: + * [r84] [lcd4linux @ 2001-02-18 21:15:15 by reinelt] added setiathome client - * [r83] trunk/CREDITS, trunk/Makefile.am, trunk/Makefile.in: + * [r83] [lcd4linux @ 2001-02-18 20:16:13 by reinelt] 2001-02-16 reinelt - * [r82] trunk/README.HD44780.GPO, trunk/processor.c: + * [r82] [lcd4linux @ 2001-02-16 14:15:11 by reinelt] fixed type in processor.c GPO documentation update from Carsten - * [r81] trunk/README, trunk/parser.c, trunk/parser.h, - trunk/processor.c, trunk/system.c: + * [r81] [lcd4linux @ 2001-02-16 08:23:09 by reinelt] new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de> 2001-02-14 reinelt - * [r80] trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/display.c, - trunk/display.h, trunk/lcd4linux.c, trunk/parser.c, - trunk/parser.h, trunk/processor.c: + * [r80] [lcd4linux @ 2001-02-14 07:40:16 by reinelt] first (incomplete) GPO implementation - * [r79] trunk/README.HD44780.GPO: + * [r79] [lcd4linux @ 2001-02-14 05:22:42 by reinelt] added README from Carsten Nau 2001-02-13 reinelt - * [r78] trunk/HD44780.c: + * [r78] [lcd4linux @ 2001-02-13 12:43:24 by reinelt] HD_gpo() was missing - * [r77] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/PalmPilot.c, - trunk/Raster.c, trunk/SIN.c, trunk/Skeleton.c, trunk/XWindow.c, - trunk/display.c, trunk/display.h, trunk/processor.c: + * [r77] [lcd4linux @ 2001-02-13 09:00:13 by reinelt] prepared framework for GPO's (general purpose outputs) 2001-02-11 reinelt - * [r76] trunk/TODO, trunk/processor.c: + * [r76] [lcd4linux @ 2001-02-11 23:34:07 by reinelt] fixed a small bug where the throughput of an offline ISDN connection is displayed as '----', but the @@ -4982,63 +4522,62 @@ 2000-12-07 reinelt - * [r75] trunk/SIN.c, trunk/TODO, trunk/lcd4linux.conf.sample: + * [r75] [lcd4linux @ 2000-12-07 20:47:54 by reinelt] first try for SIN bars 2000-12-01 reinelt - * [r74] trunk/SIN.c, trunk/lcd4linux.conf.sample: + * [r74] [lcd4linux @ 2000-12-01 20:42:37 by reinelt] added debugging of SIN driver output, probably found the positioning bug (format %02x instead of %2x) - * [r73] trunk/SIN.c: + * [r73] [lcd4linux @ 2000-12-01 07:20:26 by reinelt] modified text positioning: row starts with 0, column is hexadecimal 2000-11-28 reinelt - * [r72] trunk/debug.c: + * [r72] [lcd4linux @ 2000-11-28 20:20:38 by reinelt] added debug.c things like that should not hapen. debug.c exists for a few months now, but was never added to CVS. Shit happens.... - * [r71] trunk/SIN.c: + * [r71] [lcd4linux @ 2000-11-28 17:27:19 by reinelt] changed decimal values for screen, row, column to ascii values (shame on you!) - * [r70] trunk/Makefile.am, trunk/Makefile.in, trunk/README, - trunk/SIN.c, trunk/display.c: + * [r70] [lcd4linux @ 2000-11-28 16:46:11 by reinelt] first try to support display of SIN router 2000-11-17 reinelt - * [r69] trunk/system.c: + * [r69] [lcd4linux @ 2000-11-17 10:36:23 by reinelt] fixed parsing of /proc/net/dev for 2.0 kernels 2000-10-25 reinelt - * [r68] trunk/lcd4linux.c: + * [r68] [lcd4linux @ 2000-10-25 08:10:48 by reinelt] added restart funnctionality (lots of this code was stolen from sendmail.c) 2000-10-20 reinelt - * [r67] trunk/HD44780.c: + * [r67] [lcd4linux @ 2000-10-20 07:17:07 by reinelt] corrected a bug in HD_goto() Thanks to Gregor Szaktilla <gregor@szaktilla.de> 2000-10-08 reinelt - * [r66] trunk/system.c: + * [r66] [lcd4linux @ 2000-10-08 09:16:40 by reinelt] Linux-2.4.0-test9 changed the layout of /proc/stat (especially the disk_io line) @@ -5047,40 +4586,29 @@ 2000-08-10 reinelt - * [r65] trunk/XWindow.c, trunk/configure, trunk/configure.in, - trunk/isdn.c, trunk/lcd4linux.c: + * [r65] [lcd4linux @ 2000-08-10 18:42:20 by reinelt] fixed some bugs with the new syslog code - * [r64] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/PalmPilot.c, trunk/README, - trunk/Raster.c, trunk/Skeleton.c, trunk/XWindow.c, trunk/cfg.c, - trunk/debug.h, trunk/display.c, trunk/fontmap.c, trunk/isdn.c, - trunk/lcd4linux.c, trunk/lock.c, trunk/parser.c, - trunk/processor.c, trunk/system.c: + * [r64] [lcd4linux @ 2000-08-10 09:44:09 by reinelt] new debugging scheme: error(), info(), debug() uses syslog if in daemon mode 2000-08-09 reinelt - * [r63] trunk/README, trunk/lcd4linux.c: + * [r63] [lcd4linux @ 2000-08-09 14:14:11 by reinelt] new switch -F (do not fork) added automatic forking if -F not specified - * [r62] trunk/system.c: + * [r62] [lcd4linux @ 2000-08-09 11:03:07 by reinelt] fixed a bug in system.c where the format of /proc/net/dev was not correctly detected and parsed with different kernels - * [r61] trunk/BeckmannEgle.c, trunk/Crystalfontz.c, - trunk/HD44780.c, trunk/MatrixOrbital.c, trunk/PalmPilot.c, - trunk/README, trunk/XWindow.c, trunk/configure, - trunk/configure.in, trunk/display.c, trunk/display.h, - trunk/lcd4linux.c, trunk/system.c: + * [r61] [lcd4linux @ 2000-08-09 09:50:29 by reinelt] opened 0.98 development removed driver-specific signal-handlers @@ -5089,29 +4617,24 @@ 2000-07-31 reinelt - * [r60] trunk/HD44780.c, trunk/configure, trunk/configure.in, - trunk/lcd4linux.conf.sample, trunk/processor.c, trunk/system.c, - trunk/system.h, trunk/udelay.c: + * [r60] [lcd4linux @ 2000-07-31 10:43:44 by reinelt] some changes to support kernel-2.4 (different layout of various files in /proc) - * [r59] trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/cfg.c: + * [r59] [lcd4linux @ 2000-07-31 06:46:35 by reinelt] eliminated some compiler warnings with glibc 2000-06-04 herp - * [r58] trunk/Crystalfontz.c: + * [r58] [lcd4linux @ 2000-06-04 21:43:50 by herp] minor bugfix (zero length) 2000-05-21 reinelt - * [r57] trunk/README.Drivers, trunk/lcd4linux.conf.sample, - trunk/parser.c, trunk/parser.h, trunk/processor.c, - trunk/system.c, trunk/system.h: + * [r57] [lcd4linux @ 2000-05-21 06:20:35 by reinelt] added ppp throughput token is '%t[iomt]' at the moment, but this will change in the @@ -5119,64 +4642,58 @@ 2000-05-03 herp - * [r56] trunk/Crystalfontz.c: + * [r56] [lcd4linux @ 2000-05-03 17:14:51 by herp] - * [r55] trunk/Crystalfontz.c, trunk/Crystalfontz.h, - trunk/README.Crystalfontz: + * [r55] [lcd4linux @ 2000-05-03 09:37:32 by herp] 2000-05-02 herp - * [r54] trunk/Makefile.am, trunk/Makefile.in, trunk/XWindow.c, - trunk/display.c: + * [r54] [lcd4linux @ 2000-05-02 23:07:48 by herp] Crystalfontz initial coding 2000-05-02 reinelt - * [r53] trunk/Makefile.am, trunk/Makefile.in, trunk/PalmPilot.c, - trunk/display.c, trunk/lcd4linux.conf.sample: + * [r53] [lcd4linux @ 2000-05-02 06:05:00 by reinelt] driver for 3Com Palm Pilot added 2000-04-30 reinelt - * [r52] trunk/BeckmannEgle.c, trunk/lcd4linux.conf.sample: + * [r52] [lcd4linux @ 2000-04-30 06:40:42 by reinelt] bars for Beckmann+Egle driver 2000-04-28 reinelt - * [r51] trunk/BeckmannEgle.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/TODO, trunk/display.c: + * [r51] [lcd4linux @ 2000-04-28 05:19:55 by reinelt] first release of the Beckmann+Egle driver 2000-04-20 reinelt - * [r50] trunk/Makefile.am, trunk/Makefile.in: + * [r50] [lcd4linux @ 2000-04-20 05:48:42 by reinelt] added documentation to EXTRA_DIST so that they go into the tarball 2000-04-19 reinelt - * [r49] trunk/README.HD44780: + * [r49] [lcd4linux @ 2000-04-19 04:44:20 by reinelt] README for HD44780 driver 2000-04-17 reinelt - * [r48] trunk/README.HD44780, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample: + * [r48] [lcd4linux @ 2000-04-17 05:14:27 by reinelt] added README.44780 2000-04-15 reinelt - * [r47] trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/README, trunk/lcd4linux.c, trunk/udelay.c, trunk/udelay.h: + * [r47] [lcd4linux @ 2000-04-15 16:56:52 by reinelt] moved delay loops to udelay.c renamed -d (debugging) switch to -v (verbose) @@ -5185,14 +4702,11 @@ delay loops will not calibrate automatically, because this will fail with hich CPU load - * [r46] trunk/isdn.c, trunk/lcd4linux.c, trunk/processor.c, - trunk/system.c: + * [r46] [lcd4linux @ 2000-04-15 11:56:35 by reinelt] more debug messages - * [r45] trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/README, trunk/cfg.c, trunk/debug.h, - trunk/lcd4kde.conf, trunk/lcd4linux.c, trunk/processor.c: + * [r45] [lcd4linux @ 2000-04-15 11:13:54 by reinelt] added '-d' (debugging) switch added several debugging messages @@ -5201,8 +4715,7 @@ 2000-04-13 reinelt - * [r44] trunk/HD44780.c, trunk/MatrixOrbital.c, - trunk/lcd4linux.conf.sample, trunk/system.c, trunk/system.h: + * [r44] [lcd4linux @ 2000-04-13 06:09:52 by reinelt] added BogoMips() to system.c (not used by now, maybe sometimes we can @@ -5214,125 +4727,108 @@ 2000-04-12 reinelt - * [r43] trunk/HD44780.c, trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/display.c, - trunk/lcd4linux.conf.sample: + * [r43] [lcd4linux @ 2000-04-12 08:05:45 by reinelt] first version of the HD44780 driver 2000-04-10 reinelt - * [r42] trunk/MatrixOrbital.c, trunk/README, trunk/configure, - trunk/configure.in, trunk/lcd4linux.c: + * [r42] [lcd4linux @ 2000-04-10 04:40:53 by reinelt] minor changes and cleanups 2000-04-07 reinelt - * [r41] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/lcd4linux.c, trunk/lock.c, - trunk/lock.h: + * [r41] [lcd4linux @ 2000-04-07 05:42:20 by reinelt] UUCP style lockfiles for the serial port 2000-04-05 reinelt - * [r40] trunk/Makefile.in, trunk/XWindow.c, trunk/configure, - trunk/configure.in: + * [r40] [lcd4linux @ 2000-04-05 05:58:36 by reinelt] fixed bug in XWindow.c: union semun isn't defined with glibc-2.1 - * [r39] trunk/TODO: + * [r39] [lcd4linux @ 2000-04-05 04:12:00 by reinelt] TODO added 2000-04-03 herp - * [r38] trunk/XWindow.c: + * [r38] [lcd4linux @ 2000-04-03 23:53:23 by herp] fixed a bug that caused pixel-errors ("fliegendreck") under high load 2000-04-03 reinelt - * [r37] trunk/display.c, trunk/lcd4linux.c, trunk/lcd4linux.kdelnk, - trunk/lcd4linux.xpm: + * [r37] [lcd4linux @ 2000-04-03 17:31:52 by reinelt] suppress welcome message if display is smaller than 20x2 change lcd4linux.ppm to 32 pixel high so KDE won't stretch the icon - * [r36] trunk/lcd4linux.kdelnk: + * [r36] [lcd4linux @ 2000-04-03 06:54:03 by reinelt] KDE application link - * [r35] trunk/README.KDE, trunk/lcd4kde.conf, - trunk/lcd4linux.conf.sample, trunk/lcd4linux.xpm: + * [r35] [lcd4linux @ 2000-04-03 06:53:09 by reinelt] releasing 0.96 annoying X11 bugs hopefully fixed KDE integration - * [r34] trunk/README, trunk/README.Raster, trunk/README.X11, - trunk/cfg.c, trunk/cfg.h, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample: + * [r34] [lcd4linux @ 2000-04-03 04:46:38 by reinelt] added '-c key=val' option - * [r33] trunk/Raster.c, trunk/XWindow.c, - trunk/lcd4linux.conf.sample: + * [r33] [lcd4linux @ 2000-04-03 04:01:31 by reinelt] if 'gap' is specified as -1, a gap of (pixelsize+pixelgap) is selected automatically 2000-04-02 herp - * [r32] trunk/XWindow.c: + * [r32] [lcd4linux @ 2000-04-02 22:07:10 by herp] fixded a bug that occasionally caused Xlib errors 2000-04-01 herp - * [r31] trunk/XWindow.c, trunk/lcd4linux.c: + * [r31] [lcd4linux @ 2000-04-01 22:40:42 by herp] geometric correction (too many pixelgaps) lcd4linux main should return int, not void - * [r30] trunk/XWindow.c: + * [r30] [lcd4linux @ 2000-04-01 19:33:45 by herp] colors in format \#RRGGBB in config-file now understood 2000-04-01 reinelt - * [r29] trunk/XWindow.c, trunk/configure, trunk/configure.in, - trunk/lcd4linux.conf.sample, trunk/processor.c: + * [r29] [lcd4linux @ 2000-04-01 16:22:38 by reinelt] bug that caused a segfault in processor.c fixed (thanks to herp) 2000-03-31 reinelt - * [r28] trunk/XWindow.c: + * [r28] [lcd4linux @ 2000-03-31 04:41:22 by reinelt] X11 driver: semaphore bug fixed 2000-03-30 reinelt - * [r27] trunk/Makefile.am, trunk/Makefile.in, trunk/XWindow.c, - trunk/aclocal.m4, trunk/configure, trunk/configure.in, - trunk/display.c, trunk/lcd4linux.conf.sample, - trunk/lcd4linux.lsm: + * [r27] [lcd4linux @ 2000-03-30 16:46:57 by reinelt] configure now handles '--with-x' and '--without-x' correct 2000-03-28 reinelt - * [r26] trunk/README.X11, trunk/XWindow.c: + * [r26] [lcd4linux @ 2000-03-28 08:48:33 by reinelt] README.X11 added - * [r25] trunk/Makefile.am, trunk/Makefile.in, trunk/Raster.c, - trunk/XWindow.c, trunk/cfg.c, trunk/configure, - trunk/configure.in, trunk/lcd4linux.conf.sample, trunk/system.c: + * [r25] [lcd4linux @ 2000-03-28 07:22:15 by reinelt] version 0.95 released X11 driver up and running @@ -5340,49 +4836,38 @@ 2000-03-26 reinelt - * [r24] trunk/README.Raster, trunk/Raster.c, trunk/cfg.c, - trunk/lcd4linux.conf.sample: + * [r24] [lcd4linux @ 2000-03-26 20:00:44 by reinelt] README.Raster added - * [r23] trunk/README, trunk/Raster.c, trunk/XWindow.c, trunk/cfg.c, - trunk/pixmap.h: + * [r23] [lcd4linux @ 2000-03-26 19:03:52 by reinelt] more Pixmap renaming quoting of '#' in config file - * [r22] trunk/MatrixOrbital.c, trunk/README.Drivers, - trunk/Raster.c, trunk/Skeleton.c, trunk/XWindow.c, - trunk/display.c, trunk/display.h, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/pixmap.c: + * [r22] [lcd4linux @ 2000-03-26 18:46:28 by reinelt] bug in pixmap.c that leaded to empty bars fixed name conflicts with X11 resolved - * [r21] trunk/Raster.c, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample: + * [r21] [lcd4linux @ 2000-03-26 12:55:03 by reinelt] enhancements to the PPM driver 2000-03-25 reinelt - * [r20] trunk/MatrixOrbital.c, trunk/Raster.c, trunk/Skeleton.c, - trunk/XWindow.c, trunk/display.c, trunk/display.h, - trunk/fontmap.c, trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, - trunk/pixmap.c: + * [r20] [lcd4linux @ 2000-03-25 05:50:43 by reinelt] memory leak in Raster_flush closed driver family logic changed 2000-03-24 reinelt - * [r19] trunk/fontmap.h: + * [r19] [lcd4linux @ 2000-03-24 11:37:43 by reinelt] fontmap.h added - * [r18] trunk/Raster.c, trunk/XWindow.c, trunk/fontmap.c, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, trunk/parser.c, - trunk/pixmap.c, trunk/pixmap.h: + * [r18] [lcd4linux @ 2000-03-24 11:36:56 by reinelt] new syntax for raster configuration changed XRES and YRES to be configurable @@ -5390,41 +4875,26 @@ 2000-03-23 reinelt - * [r17] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/Raster.c, trunk/XWindow.c, - trunk/display.c, trunk/filter.c, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/pixmap.c, trunk/processor.c, - trunk/system.c: + * [r17] [lcd4linux @ 2000-03-23 07:24:48 by reinelt] PPM driver up and running (but slow!) 2000-03-22 reinelt - * [r16] trunk/Makefile.am, trunk/Makefile.in, trunk/XWindow.c, - trunk/display.c, trunk/display.h, trunk/fontmap.c, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, trunk/pixmap.c, - trunk/pixmap.h: + * [r16] [lcd4linux @ 2000-03-22 15:36:21 by reinelt] added '-l' switch (list drivers) generic pixmap driver added X11 Framework done - * [r15] trunk/FAQ, trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/README.MatrixOrbital, - trunk/Skeleton.c, trunk/configure, trunk/configure.in, - trunk/filter.c, trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, - trunk/processor.c, trunk/processor.h: + * [r15] [lcd4linux @ 2000-03-22 07:33:50 by reinelt] FAQ added new modules 'processor.c' contains all data processing 2000-03-19 reinelt - * [r14] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/README, trunk/README.Drivers, - trunk/README.MatrixOrbital, trunk/Skeleton.c, trunk/display.c, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, trunk/parser.c, - trunk/parser.h: + * [r14] [lcd4linux @ 2000-03-19 08:41:28 by reinelt] documentation available! README, README.MatrixOrbital, README.Drivers @@ -5432,16 +4902,14 @@ 2000-03-18 reinelt - * [r13] trunk/configure, trunk/configure.in, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/parser.c, trunk/parser.h: + * [r13] [lcd4linux @ 2000-03-18 10:31:06 by reinelt] added sensor handling (for temperature etc.) made data collecting happen only if data is used (reading /proc/meminfo takes a lot of CPU!) released lcd4linux-0.92 - * [r12] trunk/MatrixOrbital.c, trunk/display.c, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/system.c: + * [r12] [lcd4linux @ 2000-03-18 08:07:04 by reinelt] vertical bars implemented bar compaction improved @@ -5449,20 +4917,13 @@ 2000-03-17 reinelt - * [r11] trunk/MatrixOrbital.c, trunk/configure, trunk/configure.in, - trunk/display.c, trunk/display.h, trunk/lcd4linux.c, - trunk/lcd4linux.conf.sample, trunk/parser.c, trunk/parser.h, - trunk/system.c, trunk/system.h: + * [r11] [lcd4linux @ 2000-03-17 09:21:42 by reinelt] various memory statistics added 2000-03-13 reinelt - * [r10] trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/configure, trunk/configure.in, - trunk/display.c, trunk/display.h, trunk/isdn.c, trunk/isdn.h, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, - trunk/lcd4linux.h, trunk/parser.c, trunk/parser.h: + * [r10] [lcd4linux @ 2000-03-13 15:58:24 by reinelt] release 0.9 moved row parsing to parser.c @@ -5470,62 +4931,44 @@ 2000-03-10 reinelt - * [r9] trunk/Makefile, trunk/Makefile.am, trunk/Makefile.in, - trunk/MatrixOrbital.c, trunk/cfg.c, trunk/configure, - trunk/display.c, trunk/display.h, trunk/isdn.c, trunk/isdn.h, - trunk/lcd4linux.c, trunk/lcd4linux.conf.sample, trunk/system.c, - trunk/system.h: + * [r9] [lcd4linux @ 2000-03-10 17:36:02 by reinelt] first unstable but running release - * [r8] trunk/COPYING, trunk/INSTALL, trunk/Makefile.am, - trunk/Makefile.in, trunk/aclocal.m4, trunk/configure.in, - trunk/install-sh, trunk/lcd2041.c, trunk/lcd2041.h, - trunk/missing, trunk/mkinstalldirs: + * [r8] [lcd4linux @ 2000-03-10 12:02:43 by reinelt] autoconf/automake - * [r7] trunk/Makefile, trunk/cfg.c, trunk/cfg.h, trunk/config.c, - trunk/config.h: + * [r7] [lcd4linux @ 2000-03-10 11:40:47 by reinelt] - * [r6] trunk/Makefile, trunk/MatrixOrbital.c, trunk/display.c, - trunk/display.h, trunk/system.c: + * [r6] [lcd4linux @ 2000-03-10 10:49:53 by reinelt] MatrixOrbital driver finished 2000-03-07 reinelt - * [r5] trunk/Makefile, trunk/config.c, trunk/isdn.c, trunk/isdn.h, - trunk/lcd4linux.conf.sample, trunk/lcd4linux.h, trunk/system.c, - trunk/system.h: + * [r5] [lcd4linux @ 2000-03-07 11:01:34 by reinelt] system.c cleanup 2000-03-06 reinelt - * [r4] trunk/MatrixOrbital.c, trunk/config.c, trunk/config.h, - trunk/display.c, trunk/display.h, trunk/filter.c, trunk/filter.h, - trunk/isdn.c, trunk/isdn.h, trunk/lcd2041.c, trunk/lcd4linux.h, - trunk/system.c, trunk/system.h: + * [r4] [lcd4linux @ 2000-03-06 06:04:06 by reinelt] minor cleanups 2000-01-16 reinelt - * [r3] trunk/display.h: + * [r3] [lcd4linux @ 2000-01-16 16:58:50 by reinelt] - * [r2] trunk/Makefile, trunk/MatrixOrbital.c, trunk/config.c, - trunk/config.h, trunk/display.c, trunk/display.h, trunk/filter.c, - trunk/filter.h, trunk/isdn.c, trunk/isdn.h, trunk/lcd2041.c, - trunk/lcd2041.h, trunk/lcd4linux.c, trunk/lcd4linux.h, - trunk/system.c, trunk/system.h: + * [r2] [lcd4linux @ 2000-01-16 12:17:59 by reinelt] Initial revision 2000-01-16 root - * [r1] branches, tags, trunk: + * [r1] initial import diff --git a/CodingStyle b/CodingStyle new file mode 100644 index 0000000..c59d91e --- /dev/null +++ b/CodingStyle @@ -0,0 +1,25 @@ +$Id: CodingStyle 730 2007-01-14 13:50:28Z michael $ +$URL: https://ssl.bulix.org/svn/lcd4linux/trunk/CodingStyle $ + + +LCD4Linux Coding Style + +We decided to use a common coding style to make patches and diffs +easier to read and apply. + +The style we use is based on Kernighan & Ritchie and the coding style +of the linux kernel (see /usr/src/linux/Documentation/CodingStyle), +with some differences: + +- we use a indentation level of 4 spaces (Linus prefers 8) +- we allow lines up to 150 chars (Linus uses 80) + +The resulting indent command is: +indent -kr -l150 + +There's a script called 'indent.sh' that comes with the LCD4Linux +source package; all it does is call indent with all .c and .h files. + +It is always a good idea to call 'indent.sh' before any SVN operation, +this ensures that diffs and updates won't get mixed up because of +cosmetic changes. @@ -1,42 +1,54 @@ -$Id: INSTALL 730 2007-01-14 13:50:28Z michael $ -$URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/INSTALL $ +Installation Instructions +************************* +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. Basic Installation ================== - These are generic installation instructions. +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. @@ -55,52 +67,55 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. + 6. Often, you can also type `make uninstall' to remove the installed + files again. + Compilers and Options ===================== - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== - You can compile the package for more than one kind of computer at the +You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the +own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. Installation Names ================== - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular +options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. @@ -111,7 +126,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= - Some packages pay attention to `--enable-FEATURE' options to +Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -126,48 +141,86 @@ you can use the `configure' options `--x-includes=DIR' and Specifying the System Type ========================== - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + CPU-COMPANY-SYSTEM -See the file `config.sub' for the possible values of each field. If +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't -need to know the host type. +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. -Operation Controls +Defining Variables ================== - `configure' recognizes the following options to control how it -operates. +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. `--help' +`-h' Print a summary of the options to `configure', and exit. +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + `--quiet' `--silent' `-q' @@ -179,8 +232,6 @@ operates. Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. -`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am index 6469f9a..ed5a4e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ -# $Id: Makefile.am 773 2007-02-25 12:39:09Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/Makefile.am $ +# $Id: Makefile.am 1137 2011-01-02 00:39:10Z michael $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/Makefile.am $ # Process this file with automake to produce Makefile.in @@ -11,12 +11,14 @@ PLUGINS=@PLUGINS@ bin_PROGRAMS = lcd4linux # Fixme: -W should be renamed to -Wextra someday... -AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing +AM_CFLAGS = -D_GNU_SOURCE -Wall -Wextra -fno-strict-aliasing +LIBTOOL=libtool +ACLOCAL_AMFLAGS=-I m4 # use this for lots of warnings -#AM_CFLAGS = -D_GNU_SOURCE -std=c90 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing +#AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing -lcd4linux_LDFLAGS = +lcd4linux_LDFLAGS = lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@ lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@ @@ -32,10 +34,12 @@ hash.c hash.h \ layout.c layout.h \ pid.c pid.h \ timer.c timer.h \ +timer_group.c timer_group.h \ thread.c thread.h \ udelay.c udelay.h \ qprintf.c qprintf.h \ rgb.c rgb.h \ +event.c event.h \ \ widget.c widget.h \ widget_text.c widget_text.h \ @@ -67,35 +71,51 @@ drv_generic_i2c.c \ drv_generic_i2c.h \ drv_generic_keypad.c \ drv_generic_keypad.h \ +drv_ASTUSB.c \ drv_BeckmannEgle.c \ drv_BWCT.c \ drv_Crystalfontz.c \ drv_Curses.c \ drv_Cwlinux.c \ +drv_D4D.c \ drv_EA232graphic.c \ +drv_EFN.c \ +drv_FW8888.c \ drv_G15.c \ +drv_GLCD2USB.c glcd2usb.h \ drv_HD44780.c \ drv_Image.c \ +drv_IRLCD.c \ drv_LCD2USB.c \ drv_LCDLinux.c \ drv_LCDTerm.c \ drv_LEDMatrix.c \ drv_LPH7508.c \ drv_LUIse.c \ +drv_LW_ABP.c \ drv_M50530.c \ drv_MatrixOrbital.c \ +drv_MatrixOrbitalGX.c \ drv_MilfordInstruments.c \ drv_Noritake.c \ drv_NULL.c \ +drv_Pertelian.c \ +drv_PHAnderson.c \ +drv_PICGraphic.c \ drv_picoLCD.c \ +drv_picoLCDGraphic.c \ drv_RouterBoard.c \ drv_Sample.c \ +drv_st2205.c \ drv_serdisplib.c \ +drv_ShuttleVFD.c \ drv_SimpleLCD.c \ drv_T6963.c \ drv_Trefon.c \ +drv_ula200.c \ drv_USBHUB.c \ drv_USBLCD.c \ +drv_vnc.c \ drv_WincorNixdorf.c \ drv_X11.c \ \ @@ -106,11 +126,18 @@ widget_image.c widget_image.h \ lcd4linux_i2c.h \ \ plugin_apm.c \ +plugin_asterisk.c \ +plugin_button_exec.c \ plugin_cpuinfo.c \ +plugin_dbus.c \ plugin_diskstats.c \ plugin_dvb.c \ plugin_exec.c \ +plugin_fifo.c \ plugin_file.c \ +plugin_gps.c \ +plugin_hddtemp.c \ +plugin_huawei.c \ plugin_i2c_sensors.c \ plugin_iconv.c \ plugin_imon.c \ @@ -119,17 +146,21 @@ plugin_kvv.c \ plugin_loadavg.c \ plugin_meminfo.c \ plugin_mpd.c \ +plugin_mpris_dbus.c \ plugin_mysql.c \ plugin_netdev.c \ +plugin_netinfo.c \ plugin_pop3.c \ plugin_ppp.c \ plugin_proc_stat.c \ plugin_python.c \ +plugin_qnaplog.c \ plugin_sample.c \ plugin_seti.c \ plugin_statfs.c \ plugin_uname.c \ plugin_uptime.c \ +plugin_w1retap.c \ plugin_wireless.c \ plugin_xmms.c @@ -141,7 +172,7 @@ lcd4kde.conf \ lcd4linux.kdelnk \ lcd4linux.xpm \ lcd4linux.lsm \ -ac_python_devel.m4 \ +ax_python_devel.m4 \ curses.m4 \ drivers.m4 \ plugins.m4 \ diff --git a/Makefile.in b/Makefile.in index 4d7cacb..b2e65c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,8 +15,8 @@ @SET_MAKE@ -# $Id: Makefile.am 773 2007-02-25 12:39:09Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/Makefile.am $ +# $Id: Makefile.in 1137 2011-01-02 00:39:10Z michael $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/Makefile.in $ # Process this file with automake to produce Makefile.in @@ -45,7 +45,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config.guess config.rpath config.sub depcomp install-sh \ - missing mkinstalldirs + ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/curses.m4 \ $(top_srcdir)/ax_python_devel.m4 $(top_srcdir)/drivers.m4 \ @@ -64,24 +64,31 @@ am_lcd4linux_OBJECTS = lcd4linux.$(OBJEXT) cfg.$(OBJEXT) \ debug.$(OBJEXT) drv.$(OBJEXT) drv_generic.$(OBJEXT) \ evaluator.$(OBJEXT) property.$(OBJEXT) hash.$(OBJEXT) \ layout.$(OBJEXT) pid.$(OBJEXT) timer.$(OBJEXT) \ - thread.$(OBJEXT) udelay.$(OBJEXT) qprintf.$(OBJEXT) \ - rgb.$(OBJEXT) widget.$(OBJEXT) widget_text.$(OBJEXT) \ - widget_bar.$(OBJEXT) widget_icon.$(OBJEXT) \ - widget_keypad.$(OBJEXT) widget_timer.$(OBJEXT) \ - widget_gpo.$(OBJEXT) plugin.$(OBJEXT) plugin_cfg.$(OBJEXT) \ - plugin_math.$(OBJEXT) plugin_string.$(OBJEXT) \ - plugin_test.$(OBJEXT) plugin_time.$(OBJEXT) + timer_group.$(OBJEXT) thread.$(OBJEXT) udelay.$(OBJEXT) \ + qprintf.$(OBJEXT) rgb.$(OBJEXT) event.$(OBJEXT) \ + widget.$(OBJEXT) widget_text.$(OBJEXT) widget_bar.$(OBJEXT) \ + widget_icon.$(OBJEXT) widget_keypad.$(OBJEXT) \ + widget_timer.$(OBJEXT) widget_gpo.$(OBJEXT) plugin.$(OBJEXT) \ + plugin_cfg.$(OBJEXT) plugin_math.$(OBJEXT) \ + plugin_string.$(OBJEXT) plugin_test.$(OBJEXT) \ + plugin_time.$(OBJEXT) lcd4linux_OBJECTS = $(am_lcd4linux_OBJECTS) -lcd4linux_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(lcd4linux_LDFLAGS) \ - $(LDFLAGS) -o $@ +lcd4linux_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(lcd4linux_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES) DIST_SOURCES = $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES) ETAGS = etags @@ -99,6 +106,7 @@ distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -111,31 +119,44 @@ CPPFLAGS = @CPPFLAGS@ CURSES_INCLUDEDIR = @CURSES_INCLUDEDIR@ CURSES_LIBS = @CURSES_LIBS@ CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DRIVERS = @DRIVERS@ DRVLIBS = @DRVLIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBTOOL = libtool +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -144,6 +165,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PLUGINLIBS = @PLUGINLIBS@ PLUGINS = @PLUGINS@ POW_LIB = @POW_LIB@ @@ -154,6 +178,8 @@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -168,6 +194,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -198,6 +225,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,10 +245,10 @@ AUTOMAKE_OPTIONS = gnu CLEANFILES = *~ # Fixme: -W should be renamed to -Wextra someday... -AM_CFLAGS = -D_GNU_SOURCE -Wall -W -fno-strict-aliasing - +AM_CFLAGS = -D_GNU_SOURCE -Wall -Wextra -fno-strict-aliasing +ACLOCAL_AMFLAGS = -I m4 # use this for lots of warnings -#AM_CFLAGS = -D_GNU_SOURCE -std=c90 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing +#AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing lcd4linux_LDFLAGS = lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@ lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@ @@ -236,10 +264,12 @@ hash.c hash.h \ layout.c layout.h \ pid.c pid.h \ timer.c timer.h \ +timer_group.c timer_group.h \ thread.c thread.h \ udelay.c udelay.h \ qprintf.c qprintf.h \ rgb.c rgb.h \ +event.c event.h \ \ widget.c widget.h \ widget_text.c widget_text.h \ @@ -271,35 +301,51 @@ drv_generic_i2c.c \ drv_generic_i2c.h \ drv_generic_keypad.c \ drv_generic_keypad.h \ +drv_ASTUSB.c \ drv_BeckmannEgle.c \ drv_BWCT.c \ drv_Crystalfontz.c \ drv_Curses.c \ drv_Cwlinux.c \ +drv_D4D.c \ drv_EA232graphic.c \ +drv_EFN.c \ +drv_FW8888.c \ drv_G15.c \ +drv_GLCD2USB.c glcd2usb.h \ drv_HD44780.c \ drv_Image.c \ +drv_IRLCD.c \ drv_LCD2USB.c \ drv_LCDLinux.c \ drv_LCDTerm.c \ drv_LEDMatrix.c \ drv_LPH7508.c \ drv_LUIse.c \ +drv_LW_ABP.c \ drv_M50530.c \ drv_MatrixOrbital.c \ +drv_MatrixOrbitalGX.c \ drv_MilfordInstruments.c \ drv_Noritake.c \ drv_NULL.c \ +drv_Pertelian.c \ +drv_PHAnderson.c \ +drv_PICGraphic.c \ drv_picoLCD.c \ +drv_picoLCDGraphic.c \ drv_RouterBoard.c \ drv_Sample.c \ +drv_st2205.c \ drv_serdisplib.c \ +drv_ShuttleVFD.c \ drv_SimpleLCD.c \ drv_T6963.c \ drv_Trefon.c \ +drv_ula200.c \ drv_USBHUB.c \ drv_USBLCD.c \ +drv_vnc.c \ drv_WincorNixdorf.c \ drv_X11.c \ \ @@ -310,11 +356,18 @@ widget_image.c widget_image.h \ lcd4linux_i2c.h \ \ plugin_apm.c \ +plugin_asterisk.c \ +plugin_button_exec.c \ plugin_cpuinfo.c \ +plugin_dbus.c \ plugin_diskstats.c \ plugin_dvb.c \ plugin_exec.c \ +plugin_fifo.c \ plugin_file.c \ +plugin_gps.c \ +plugin_hddtemp.c \ +plugin_huawei.c \ plugin_i2c_sensors.c \ plugin_iconv.c \ plugin_imon.c \ @@ -323,17 +376,21 @@ plugin_kvv.c \ plugin_loadavg.c \ plugin_meminfo.c \ plugin_mpd.c \ +plugin_mpris_dbus.c \ plugin_mysql.c \ plugin_netdev.c \ +plugin_netinfo.c \ plugin_pop3.c \ plugin_ppp.c \ plugin_proc_stat.c \ plugin_python.c \ +plugin_qnaplog.c \ plugin_sample.c \ plugin_seti.c \ plugin_statfs.c \ plugin_uname.c \ plugin_uptime.c \ +plugin_w1retap.c \ plugin_wireless.c \ plugin_xmms.c @@ -344,7 +401,7 @@ lcd4kde.conf \ lcd4linux.kdelnk \ lcd4linux.xpm \ lcd4linux.lsm \ -ac_python_devel.m4 \ +ax_python_devel.m4 \ curses.m4 \ drivers.m4 \ plugins.m4 \ @@ -359,7 +416,7 @@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .c .o .obj +.SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @@ -417,7 +474,7 @@ install-binPROGRAMS: $(bin_PROGRAMS) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p; \ + while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ @@ -431,8 +488,8 @@ install-binPROGRAMS: $(bin_PROGRAMS) while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done @@ -447,7 +504,13 @@ uninstall-binPROGRAMS: cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list lcd4linux$(EXEEXT): $(lcd4linux_OBJECTS) $(lcd4linux_DEPENDENCIES) @rm -f lcd4linux$(EXEEXT) $(lcd4linux_LINK) $(lcd4linux_OBJECTS) $(lcd4linux_LDADD) $(LIBS) @@ -461,14 +524,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_ASTUSB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_BWCT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_BeckmannEgle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Crystalfontz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Curses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Cwlinux.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_D4D.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_EA232graphic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_EFN.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_FW8888.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_G15.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_GLCD2USB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_HD44780.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_IRLCD.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LCD2USB.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LCDLinux.Po@am__quote@ @@ -476,13 +545,19 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LEDMatrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LPH7508.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LUIse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_LW_ABP.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_M50530.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_MatrixOrbital.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_MatrixOrbitalGX.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_MilfordInstruments.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_NULL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Noritake.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_PHAnderson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_PICGraphic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Pertelian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_RouterBoard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Sample.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_ShuttleVFD.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_SimpleLCD.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_T6963.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_Trefon.Po@am__quote@ @@ -499,20 +574,32 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_generic_serial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_generic_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_picoLCD.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_picoLCDGraphic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_serdisplib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_st2205.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_ula200.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_vnc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evaluator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lcd4linux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_apm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_asterisk.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_button_exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_cfg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_cpuinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_dbus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_diskstats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_dvb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_exec.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_fifo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_gps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_hddtemp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_huawei.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_i2c_sensors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_iconv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_imon.Po@am__quote@ @@ -522,12 +609,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_math.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_meminfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_mpd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_mpris_dbus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_mysql.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_netdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_netinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_pop3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_ppp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_proc_stat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_python.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_qnaplog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_sample.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_seti.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_statfs.Po@am__quote@ @@ -536,6 +626,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_time.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_uname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_uptime.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_w1retap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_wireless.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_xmms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Po@am__quote@ @@ -543,6 +634,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rgb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_group.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udelay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widget_bar.Po@am__quote@ @@ -567,6 +659,22 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -801,14 +909,14 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-tags + distclean-hdr distclean-libtool distclean-tags dvi: dvi-am @@ -859,7 +967,8 @@ maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-compile mostlyclean-generic +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-am @@ -874,20 +983,21 @@ uninstall-am: uninstall-binPROGRAMS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS + clean-binPROGRAMS clean-generic clean-libtool ctags dist \ + dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS # create subversion version @@ -1,5 +1,5 @@ # $Id: NEWS 730 2007-01-14 13:50:28Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/NEWS $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/NEWS $ Sorry, there is no NEWS anymore. Go to http://lcd4linux.bulix.org for all the documentation. @@ -1,5 +1,5 @@ # $Id: README 730 2007-01-14 13:50:28Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/README $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/README $ Sorry, there is no README anymore. Go to http://lcd4linux.bulix.org for all the documentation. @@ -1,5 +1,5 @@ # $Id: TODO 730 2007-01-14 13:50:28Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/TODO $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/TODO $ Sorry, there is no TODO anymore. Go to http://lcd4linux.bulix.org for all the documentation. @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,8 +11,16 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# iconv.m4 serial AM4 (gettext-0.11.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# iconv.m4 serial 11 (gettext-0.18.1) +dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -34,6 +42,7 @@ AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. @@ -46,7 +55,7 @@ AC_DEFUN([AM_ICONV_LINK], am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) - AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include <stdlib.h> @@ -54,7 +63,7 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_func_iconv=yes) + [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" @@ -63,13 +72,110 @@ AC_DEFUN([AM_ICONV_LINK], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then - AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + AC_TRY_RUN([ +#include <iconv.h> +#include <string.h> +int main () +{ + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + return 1; + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + if (/* Try standardized names. */ + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) + /* Try IRIX, OSF/1 names. */ + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) + /* Try AIX names. */ + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) + /* Try HP-UX names. */ + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) + return 1; + return 0; +}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + LIBS="$am_save_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) @@ -81,16 +187,31 @@ AC_DEFUN([AM_ICONV_LINK], LIBICONV= LTLIBICONV= fi - AC_SUBST(LIBICONV) - AC_SUBST(LTLIBICONV) + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) ]) -AC_DEFUN([AM_ICONV], +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to +dnl avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +dnl This is tricky because of the way 'aclocal' is implemented: +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. +dnl Otherwise aclocal's initial scan pass would miss the macro definition. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1" +dnl warnings. +m4_define([gl_iconv_AC_DEFUN], + m4_version_prereq([2.64], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])) +gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include <stdlib.h> #include <iconv.h> @@ -103,18 +224,18 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") +], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([$]{ac_t:- - }[$]am_cv_proto_iconv) - AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + AC_MSG_RESULT([ + $am_cv_proto_iconv]) + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -125,7 +246,7 @@ dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) @@ -138,7 +259,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld dnl From libtool-1.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, +[AC_ARG_WITH([gnu-ld], [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl @@ -174,7 +295,7 @@ if test "$GCC" = yes; then # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -192,7 +313,7 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(acl_cv_path_LD, +AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do @@ -204,9 +325,9 @@ AC_CACHE_VAL(acl_cv_path_LD, # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; + test "$with_gnu_ld" != no && break ;; *) - test "$with_gnu_ld" != yes && break ;; + test "$with_gnu_ld" != yes && break ;; esac fi done @@ -216,69 +337,77 @@ else fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then - AC_MSG_RESULT($LD) + AC_MSG_RESULT([$LD]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) -# lib-link.m4 serial 9 (gettext-0.16) -dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. +# lib-link.m4 serial 21 (gettext-0.18) +dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ(2.50) +AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([Name],[translit([$1],[./-], [___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) + AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) + popdef([NAME]) + popdef([Name]) ]) -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl the ability to compile and link the specified testcode. The missing-message +dnl defaults to 'no' and may contain additional hints for the user. +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([Name],[translit([$1],[./-], [___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. @@ -292,13 +421,25 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, + dnl because these -l options might require -L options that are present in + dnl LIBS. -l options benefit only from the -L options listed before it. + dnl Otherwise, add it to the front of LIBS, because it may be a static + dnl library that depends on another static library that is present in LIBS. + dnl Static libraries benefit only from the static libraries listed after + dnl it. + case " $LIB[]NAME" in + *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; + *) LIBS="$LIB[]NAME $LIBS" ;; + esac + AC_TRY_LINK([$3], [$4], + [ac_cv_lib[]Name=yes], + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else @@ -308,17 +449,23 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= + LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) + AC_SUBST([LIB]NAME[_PREFIX]) + popdef([NAME]) + popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. +dnl acl_libext, +dnl acl_shlibext, +dnl acl_hardcode_libdir_flag_spec, +dnl acl_hardcode_libdir_separator, +dnl acl_hardcode_direct, +dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. @@ -327,7 +474,7 @@ AC_DEFUN([AC_LIB_RPATH], AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh @@ -335,35 +482,66 @@ AC_DEFUN([AC_LIB_RPATH], acl_cv_rpath=done ]) wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl Autoconf >= 2.61 supports dots in --with options. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], + AC_ARG_WITH(P_A_C_K[-prefix], +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no @@ -376,6 +554,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi ]) @@ -384,6 +566,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LIB[]NAME= LTLIB[]NAME= INC[]NAME= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= @@ -423,27 +609,53 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], found_la= found_so= found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi if test $use_additional = yes; then - if test -n "$shlibext" \ - && { test -f "$additional_libdir/lib$name.$shlibext" \ - || { test "$shlibext" = dll \ - && test -f "$additional_libdir/lib$name.dll.a"; }; }; then - found_dir="$additional_libdir" - if test -f "$additional_libdir/lib$name.$shlibext"; then - found_so="$additional_libdir/lib$name.$shlibext" + dir="$additional_libdir" + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" else - found_so="$additional_libdir/lib$name.dll.a" + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi fi - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" fi fi fi @@ -453,26 +665,44 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" \ - && { test -f "$dir/lib$name.$shlibext" \ - || { test "$shlibext" = dll \ - && test -f "$dir/lib$name.dll.a"; }; }; then - found_dir="$dir" - if test -f "$dir/lib$name.$shlibext"; then - found_so="$dir/lib$name.$shlibext" + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" else - found_so="$dir/lib$name.dll.a" - fi - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi fi - else - if test -f "$dir/lib$name.$libext"; then + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" fi fi ;; @@ -489,7 +719,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else @@ -508,12 +740,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then + if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" @@ -544,13 +776,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi - if test "$hardcode_minus_L" != no; then + if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. @@ -577,6 +809,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -637,9 +879,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -738,18 +982,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], done done if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then + if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else @@ -757,7 +1001,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done @@ -770,6 +1014,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi + popdef([P_A_C_K]) + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, @@ -806,7 +1055,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= @@ -815,7 +1064,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= @@ -824,7 +1074,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. - if test "X$dir" != "X/usr/$acl_libdirstem"; then + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; @@ -840,16 +1091,16 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], done else dnl The linker is used for linking directly. - if test -n "$hardcode_libdir_separator"; then + if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else @@ -857,7 +1108,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" - eval flag=\"$hardcode_libdir_flag_spec\" + eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done @@ -869,8 +1120,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], AC_SUBST([$1]) ]) -# lib-prefix.m4 serial 5 (gettext-0.15) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +# lib-prefix.m4 serial 7 (gettext-0.18) +dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -1024,38 +1275,8201 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], prefix="$acl_save_prefix" ]) -dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing -dnl the basename of the libdir, either "lib" or "lib64". +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a variable acl_libdirstem, containing the basename of the libdir, either +dnl "lib" or "lib64" or "lib/64", +dnl - a variable acl_libdirstem2, as a secondary possible value for +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or +dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ - dnl There is no formal standard regarding lib and lib64. The current - dnl practice is that on a system supporting 32-bit and 64-bit instruction - dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit - dnl libraries go under $prefix/lib. We determine the compiler's default - dnl mode by looking at the compiler's library search path. If at least - dnl of its elements ends in /lib64 or points to a directory whose absolute - dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the - dnl default, namely "lib". + dnl There is no formal standard regarding lib and lib64. + dnl On glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine + dnl the compiler's default mode by looking at the compiler's library search + dnl path. If at least one of its elements ends in /lib64 or points to a + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. + dnl Otherwise we use the default, namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + acl_libdirstem2= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>. + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], + [AC_EGREP_CPP([sixtyfour bits], [ +#ifdef _LP64 +sixtyfour bits +#endif + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) + ]) + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" +]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to <bug-libtool@gnu.org>." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +_LT_PATH_LD_GNU +AC_SUBST([LD]) + +_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) +])# LT_PATH_LD + +# Old names: +AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) +AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_LD], []) +dnl AC_DEFUN([AC_PROG_LD], []) + + +# _LT_PATH_LD_GNU +#- -------------- +m4_defun([_LT_PATH_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac]) +with_gnu_ld=$lt_cv_prog_gnu_ld +])# _LT_PATH_LD_GNU + + +# _LT_CMD_RELOAD +# -------------- +# find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +m4_defun([_LT_CMD_RELOAD], +[AC_CACHE_CHECK([for $LD option to reload object files], + lt_cv_ld_reload_flag, + [lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac +_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_DECL([], [reload_cmds], [2])dnl +])# _LT_CMD_RELOAD + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done - IFS="$acl_save_IFS" + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac ]) -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1065,14 +9479,31 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB], # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -1129,14 +9560,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 7 +# serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -1145,8 +9576,11 @@ AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -1160,15 +9594,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 8 +# serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -1196,6 +9629,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -1224,6 +9658,16 @@ AC_CACHE_CHECK([dependency style of $depcc], if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and @@ -1241,7 +9685,17 @@ AC_CACHE_CHECK([dependency style of $depcc], done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested @@ -1251,18 +9705,23 @@ AC_CACHE_CHECK([dependency style of $depcc], break fi ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; none) break ;; esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message @@ -1313,61 +9772,74 @@ if test "x$enable_dependency_tracking" != xno; then AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -1426,14 +9898,14 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -1450,16 +9922,20 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -1479,6 +9955,9 @@ m4_ifval([$2], AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -1494,8 +9973,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -1503,20 +9982,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header @@ -1527,18 +10023,19 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1549,7 +10046,14 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -1575,13 +10079,13 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MAKE_INCLUDE() # ----------------- @@ -1590,7 +10094,7 @@ AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: - @echo done + @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. @@ -1600,24 +10104,24 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) @@ -1627,14 +10131,14 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -1650,7 +10154,15 @@ AC_SUBST($1)]) # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " @@ -1660,7 +10172,7 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1668,70 +10180,33 @@ fi # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -1748,7 +10223,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- @@ -1758,14 +10233,14 @@ AC_DEFUN([_AM_IF_OPTION], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # AM_SANITY_CHECK # --------------- @@ -1774,16 +10249,29 @@ AC_DEFUN([AM_SANITY_CHECK], # Just in case sleep 1 echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` + set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ @@ -1833,9 +10321,28 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff --git a/ax_python_devel.m4 b/ax_python_devel.m4 index 8365d2b..0740c64 100644 --- a/ax_python_devel.m4 +++ b/ax_python_devel.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html +# http://www.nongnu.org/autoconf-archive/ax_python_devel.html # =========================================================================== # # SYNOPSIS @@ -66,8 +66,6 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 4 - AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) AC_DEFUN([AX_PYTHON_DEVEL],[ # @@ -266,7 +264,7 @@ EOD` if test -z "$PYTHON_EXTRA_LIBS"; then PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ - print (conf('LIBS'))"` + print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"` fi AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) AC_SUBST(PYTHON_EXTRA_LIBS) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..93723b7 --- /dev/null +++ b/bootstrap @@ -0,0 +1,18 @@ +#!/bin/sh + +# $Id: bootstrap 1044 2009-09-23 04:34:38Z michael $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/bootstrap $ + +# exit on errors +set -e + +# set nicer prompt for tracing +PS4="$0:\$LINENO> " +set -x + +aclocal +libtoolize --copy --force +autoheader +automake --add-missing --copy --foreign +autoconf + @@ -1,11 +1,11 @@ -/* $Id: cfg.c 750 2007-01-20 06:58:56Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/cfg.c $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/cfg.c $ +/* $Id: cfg.c 1109 2010-02-12 13:16:27Z mjona $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/cfg.c $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/cfg.c $ * * config file stuff * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> - * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. * @@ -48,6 +48,9 @@ * This list was allocated be cfg_list() and must be * freed by the caller! * + * cfg_rename (section, old, new) + * changes the key of a existing entry + * * cfg_get_raw (section, key, defval) * return the a value for a given key in a given section * or <defval> if key does not exist. Does NOT evaluate @@ -132,15 +135,19 @@ static char *strip(char *s, const int strip_comments) if (*p == '"') do p++; - while (*p && *p != '\n' && *p != '"'); + while (*p && *p != '\n' && *p != '\r' && *p != '"'); if (*p == '\'') do p++; - while (*p && *p != '\n' && *p != '\''); + while (*p && *p != '\n' && *p != '\r' && *p != '\''); if (*p == '\n' || (strip_comments && *p == '#' && (p == s || *(p - 1) != '\\'))) { *p = '\0'; break; } + if (*p == '\r' && *(p + 1) == '\n') { + /* replace <CR> from DOS <CR><LF> with blank */ + *p = ' '; + } } for (p--; p > s && isblank(*p); p--) @@ -150,41 +157,6 @@ static char *strip(char *s, const int strip_comments) } -/* unquote a string */ -static char *dequote(char *string) -{ - int quote = 0; - char *s = string; - char *p = string; - - do { - if (*s == '\'') { - quote = !quote; - *p++ = *s; - } else if (quote && *s == '\\') { - s++; - if (*s >= '0' && *s <= '7') { - int n; - unsigned int c = 0; - sscanf(s, "%3o%n", &c, &n); - if (c == 0 || c > 255) { - error("WARNING: illegal '\\' in <%s>", string); - } else { - *p++ = c; - s += n - 1; - } - } else { - *p++ = *s; - } - } else { - *p++ = *s; - } - } while (*s++); - - return string; -} - - /* which if a string contains only valid chars */ /* i.e. start with a char and contains chars and nums */ static int validchars(const char *string, const int numstart) @@ -233,14 +205,14 @@ static void cfg_add(const char *section, const char *key, const char *val, const free(buffer); if (entry->val) free(entry->val); - entry->val = dequote(strdup(val)); + entry->val = strdup(val); return; } nConfig++; Config = realloc(Config, nConfig * sizeof(ENTRY)); Config[nConfig - 1].key = buffer; - Config[nConfig - 1].val = dequote(strdup(val)); + Config[nConfig - 1].val = strdup(val); Config[nConfig - 1].lock = lock; qsort(Config, nConfig, sizeof(ENTRY), c_sort); @@ -310,6 +282,58 @@ char *cfg_list(const char *section) } +int cfg_rename(const char *section, const char *old, const char *new) +{ + char *buffer; + ENTRY *old_entry, *new_entry; + + /* prepare old section.key */ + buffer = malloc(strlen(section) + strlen(old) + 2); + *buffer = '\0'; + if (section != NULL && *section != '\0') { + strcpy(buffer, section); + strcat(buffer, "."); + } + strcat(buffer, old); + + /* lookup old entry */ + old_entry = bsearch(buffer, Config, nConfig, sizeof(ENTRY), c_lookup); + free(buffer); + + if (old_entry == NULL) { + error("internal error: cfg_rename(%s, %s, %s) failed: entry not found!", section, old, new); + return -1; + } + + /* prepare new section.key */ + buffer = malloc(strlen(section) + strlen(new) + 2); + *buffer = '\0'; + if (section != NULL && *section != '\0') { + strcpy(buffer, section); + strcat(buffer, "."); + } + strcat(buffer, new); + + /* lookup new entry */ + new_entry = bsearch(buffer, Config, nConfig, sizeof(ENTRY), c_lookup); + + if (new_entry != NULL) { + info("cfg_rename(%s, %s, %s) failed: entry already exists!", section, old, new); + free(buffer); + return -1; + } + + /* replace key */ + free(old_entry->key); + old_entry->key = buffer; + + /* sort table again */ + qsort(Config, nConfig, sizeof(ENTRY), c_sort); + + return 0; +} + + static char *cfg_lookup(const char *section, const char *key) { int len; @@ -367,7 +391,7 @@ char *cfg_get(const char *section, const char *key, const char *defval) if (expression != NULL) { if (*expression == '\0') - return ""; + return strdup(""); if (Compile(expression, &tree) == 0 && Eval(tree, &result) == 0) { retval = strdup(R2S(&result)); DelTree(tree); @@ -461,10 +485,12 @@ static int cfg_check_source(const char *file) error("security error: owner and/or group of '%s' don't match", file); error = -1; } +#if ! defined(__CYGWIN__) if (stbuf.st_mode & S_IRWXG || stbuf.st_mode & S_IRWXO) { error("security error: group or other have access to '%s'", file); error = -1; } +#endif return error; } @@ -614,6 +640,26 @@ static int cfg_read(const char *file) } +static void cfg_dump(void) +{ + int i, len; + + /* find longest key for pretty output */ + len = 1; + for (i = 0; i < nConfig; i++) { + int l = strlen(Config[i].key); + if (l > len) + len = l; + } + + info("Dump of %s:", Config_File); + for (i = 0; i < nConfig; i++) { + info(" %-*s %s", len, Config[i].key, Config[i].val); + } + info(" "); +} + + int cfg_init(const char *file) { if (cfg_check_source(file) == -1) { @@ -625,8 +671,12 @@ int cfg_init(const char *file) if (Config_File) free(Config_File); + Config_File = strdup(file); + if (verbose_level > 1) + cfg_dump(); + return 0; } @@ -1,10 +1,10 @@ -/* $Id: cfg.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/cfg.h $ +/* $Id: cfg.h 967 2009-01-15 15:15:24Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/cfg.h $ * * config file stuff * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> - * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. * @@ -31,6 +31,7 @@ int cfg_init(const char *file); char *cfg_source(void); int cfg_cmd(const char *arg); char *cfg_list(const char *section); +int cfg_rename(const char *section, const char *old, const char *new); char *cfg_get_raw(const char *section, const char *key, const char *defval); char *cfg_get(const char *section, const char *key, const char *defval); int cfg_number(const char *section, const char *key, const int defval, const int min, const int max, int *value); diff --git a/config.guess b/config.guess index e3a2116..f32079a 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2009-06-10' +timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ + | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -324,9 +324,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -334,20 +331,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -656,7 +640,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ + grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -812,7 +796,7 @@ EOF x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -822,9 +806,6 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -885,17 +866,40 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:* | mips64:Linux:*:*) + mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 #else CPU= #endif @@ -927,13 +931,10 @@ EOF EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -981,6 +982,17 @@ EOF elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -1046,7 +1058,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1090,11 +1102,8 @@ EOF pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1132,16 +1141,6 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1154,7 +1153,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1217,9 +1216,6 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1328,9 +1324,6 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.h.in b/config.h.in index 76abc47..3cd728a 100644 --- a/config.h.in +++ b/config.h.in @@ -3,6 +3,15 @@ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID +/* DBus Major Version */ +#undef DBUS_VERSION_MAJOR + +/* DBus Micro Version */ +#undef DBUS_VERSION_MICRO + +/* DBus Minor Version */ +#undef DBUS_VERSION_MINOR + /* Found some version of curses that we're going to use */ #undef HAS_CURSES @@ -12,10 +21,19 @@ /* Define to 1 if you have the <asm/io.h> header file. */ #undef HAVE_ASM_IO_H +/* Define to 1 if you have the <asm/types.h> header file. */ +#undef HAVE_ASM_TYPES_H + +/* Define to 1 if you have the <dbus/dbus.h> header file. */ +#undef HAVE_DBUS_DBUS_H + /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 @@ -28,6 +46,9 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define to 1 if you have the <ftdi.h> header file. */ +#undef HAVE_FTDI_H + /* Define to 1 if you have the <gd/gd.h> header file. */ #undef HAVE_GD_GD_H @@ -40,7 +61,7 @@ /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY -/* Define if you have the iconv() function. */ +/* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the <inttypes.h> header file. */ @@ -49,12 +70,12 @@ /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM -/* Define to 1 if you have the <libmpd/libmpd.h> header file. */ -#undef HAVE_LIBMPD_LIBMPD_H - /* Define to 1 if you have the <linux/dvb/frontend.h> header file. */ #undef HAVE_LINUX_DVB_FRONTEND_H +/* Define to 1 if you have the <linux/errno.h> header file. */ +#undef HAVE_LINUX_ERRNO_H + /* Define to 1 if you have the <linux/hd44780.h> header file. */ #undef HAVE_LINUX_HD44780_H @@ -70,6 +91,9 @@ /* Define to 1 if you have the <linux/ppdev.h> header file. */ #undef HAVE_LINUX_PPDEV_H +/* Define to 1 if you have the <linux/wireless.h> header file. */ +#undef HAVE_LINUX_WIRELESS_H + /* Define to 1 if you have the <luise.h> header file. */ #undef HAVE_LUISE_H @@ -97,15 +121,24 @@ /* Define to 1 if you have the <net/if_ppp.h> header file. */ #undef HAVE_NET_IF_PPP_H +/* Define to 1 if you have the <nmeap.h> header file. */ +#undef HAVE_NMEAP_H + /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV +/* If available, contains the Python version number currently in use. */ +#undef HAVE_PYTHON + /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP +/* Define to 1 if you have the <rfb/rfb.h> header file. */ +#undef HAVE_RFB_RFB_H + /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT @@ -115,9 +148,15 @@ /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET +/* Define to 1 if you have the <sqlite3.h> header file. */ +#undef HAVE_SQLITE3_H + /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT +/* Define to 1 if you have the <st2205.h> header file. */ +#undef HAVE_ST2205_H + /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG @@ -245,6 +284,10 @@ slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Set to reflect version of ncurses */ #undef NCURSES_970530 @@ -266,27 +309,54 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION /* apm plugin */ #undef PLUGIN_APM +/* asterisk plugin */ +#undef PLUGIN_ASTERISK + +/* button_exec plugin */ +#undef PLUGIN_BUTTON_EXEC + /* cpuinfo plugin */ #undef PLUGIN_CPUINFO +/* dbus plugin */ +#undef PLUGIN_DBUS + /* diskstats plugin */ #undef PLUGIN_DISKSTATS /* dvb plugin */ #undef PLUGIN_DVB +/* event plugin */ +#undef PLUGIN_EVENT + /* exec plugin */ #undef PLUGIN_EXEC +/* fifo plugin */ +#undef PLUGIN_FIFO + /* file plugin */ #undef PLUGIN_FILE +/* gps plugin */ +#undef PLUGIN_GPS + +/* hddtemp plugin */ +#undef PLUGIN_HDDTEMP + +/* huawei plugin */ +#undef PLUGIN_HUAWEI + /* i2c sensors plugin */ #undef PLUGIN_I2C_SENSORS @@ -311,12 +381,18 @@ /* mpd plugin */ #undef PLUGIN_MPD +/* mpris_dbus plugin */ +#undef PLUGIN_MPRIS_DBUS + /* mysql plugin */ #undef PLUGIN_MYSQL /* netdev plugin */ #undef PLUGIN_NETDEV +/* netinfo plugin */ +#undef PLUGIN_NETINFO + /* POP3 plugin */ #undef PLUGIN_POP3 @@ -329,6 +405,9 @@ /* python plugin */ #undef PLUGIN_PYTHON +/* qnaplog plugin */ +#undef PLUGIN_QNAPLOG + /* sample plugin */ #undef PLUGIN_SAMPLE @@ -344,6 +423,9 @@ /* uptime plugin */ #undef PLUGIN_UPTIME +/* w1retap plugin */ +#undef PLUGIN_W1RETAP + /* wireless plugin */ #undef PLUGIN_WIRELESS @@ -383,6 +465,9 @@ /* Version number of package */ #undef VERSION +/* ASTUSB driver */ +#undef WITH_ASTUSB + /* Beckmann&Egle driver */ #undef WITH_BECKMANNEGLE @@ -398,15 +483,30 @@ /* CwLinux driver */ #undef WITH_CWLINUX +/* D4D driver */ +#undef WITH_D4D + /* Define if using the dmalloc debugging malloc package */ #undef WITH_DMALLOC /* Electronic Assembly RS232 graphic driver */ #undef WITH_EA232graphic +/* Driver for EFN LED modules and EUG 100 ethernet to serial converter */ +#undef WITH_EFN + +/* Allnet FW8888 driver */ +#undef WITH_FW8888 + /* G-15 driver */ #undef WITH_G15 +/* GD library */ +#undef WITH_GD + +/* GLCD2USB driver */ +#undef WITH_GLCD2USB + /* HD44780 driver */ #undef WITH_HD44780 @@ -416,6 +516,9 @@ /* image widget */ #undef WITH_IMAGE +/* IRLCD driver */ +#undef WITH_IRLCD + /* LCD2USB driver */ #undef WITH_LCD2USB @@ -434,12 +537,18 @@ /* LUIse driver */ #undef WITH_LUISE +/* LW ABP driver */ +#undef WITH_LW_ABP + /* M50530 driver */ #undef WITH_M50530 /* MatrixOrbital driver */ #undef WITH_MATRIXORBITAL +/* MatrixOrbitalGX driver */ +#undef WITH_MATRIXORBITALGX + /* Milford Instruments driver */ #undef WITH_MILINST @@ -452,6 +561,21 @@ /* parport bus driver */ #undef WITH_PARPORT +/* Pertelian driver */ +#undef WITH_PERTELIAN + +/* PHAnderson driver */ +#undef WITH_PHANDERSON + +/* PICGraphic driver */ +#undef WITH_PICGRAPHIC + +/* picoLCD driver */ +#undef WITH_PICOLCD + +/* picoLCDGraphic driver */ +#undef WITH_PICOLCDGRAPHIC + /* PNG driver */ #undef WITH_PNG @@ -470,30 +594,39 @@ /* serial bus driver */ #undef WITH_SERIAL +/* ShuttleVFD driver */ +#undef WITH_SHUTTLEVFD + /* SimpleLCD driver */ #undef WITH_SIMPLELCD +/* st2205 driver */ +#undef WITH_ST2205 + /* T6963 driver */ #undef WITH_T6963 /* TREFON driver */ #undef WITH_TREFON +/* ULA200 driver */ +#undef WITH_ULA200 + /* USBHUB driver */ #undef WITH_USBHUB /* USBLCD driver */ #undef WITH_USBLCD +/* vnc driver */ +#undef WITH_VNC + /* WincorNixdorf driver */ #undef WITH_WINCORNIXDORF /* X11 driver */ #undef WITH_X11 -/* picoLCD driver */ -#undef WITH_picoLCD - /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING diff --git a/config.rpath b/config.rpath new file mode 100644 index 0000000..c547c68 --- /dev/null +++ b/config.rpath @@ -0,0 +1,666 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2007 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix4* | aix5*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF + +# How to pass a linker flag through the compiler. +wl="$escaped_wl" + +# Static library suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally "so"). +shlibext="$shlibext" + +# Format of library name prefix. +libname_spec="$escaped_libname_spec" + +# Library names that the linker finds when passed -lNAME. +library_names_spec="$escaped_library_names_spec" + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec" + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator="$hardcode_libdir_separator" + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct="$hardcode_direct" + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L="$hardcode_minus_L" + +EOF @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2009-06-11' +timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,7 +122,6 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -153,9 +152,6 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk - ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -253,16 +249,13 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -275,7 +268,6 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -285,7 +277,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -294,7 +286,7 @@ case $basic_machine in | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) + | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -337,17 +329,14 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -369,20 +358,20 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-* | z80-*) + | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -450,10 +439,6 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; - aros) - basic_machine=i386-pc - os=-aros - ;; aux) basic_machine=m68k-apple os=-aux @@ -470,18 +455,10 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -549,10 +526,6 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -1155,10 +1128,6 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1197,7 +1166,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1267,11 +1236,10 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1280,7 +1248,7 @@ case $os in | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1420,9 +1388,6 @@ case $os in -zvmoe) os=-zvmoe ;; - -dicos*) - os=-dicos - ;; -none) ;; *) @@ -1620,7 +1585,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -cnk*|-aix*) + -aix*) vendor=ibm ;; -beos*) @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for LCD4Linux 0.10.1-RC2. +# Generated by GNU Autoconf 2.67 for LCD4Linux 0.11.0-SVN. # # Report bugs to <lcd4linux-users@lists.sourceforge.net>. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -319,7 +319,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -359,19 +359,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -529,11 +529,160 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -552,8 +701,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='LCD4Linux' PACKAGE_TARNAME='lcd4linux' -PACKAGE_VERSION='0.10.1-RC2' -PACKAGE_STRING='LCD4Linux 0.10.1-RC2' +PACKAGE_VERSION='0.11.0-SVN' +PACKAGE_STRING='LCD4Linux 0.11.0-SVN' PACKAGE_BUGREPORT='lcd4linux-users@lists.sourceforge.net' PACKAGE_URL='' @@ -594,7 +743,23 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='am__EXEEXT_FALSE +ac_subst_vars='OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +OBJDUMP +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS POW_LIB @@ -611,6 +776,8 @@ build_os build_vendor build_cpu build +DBUS_LIBS +DBUS_CFLAGS DRVLIBS DRIVERS PYTHON_EXTRA_LDFLAGS @@ -629,6 +796,9 @@ EGREP GREP CURSES_INCLUDEDIR CURSES_LIBS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG LN_S CPP am__fastdepCC_FALSE @@ -725,6 +895,11 @@ with_plugins with_gnu_ld enable_rpath with_libiconv_prefix +enable_shared +enable_static +with_pic +enable_fast_install +enable_libtool_lock ' ac_precious_vars='build_alias host_alias @@ -735,8 +910,13 @@ LDFLAGS LIBS CPPFLAGS CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR XMKMF -PYTHON_VERSION' +PYTHON_VERSION +DBUS_CFLAGS +DBUS_LIBS' # Initialize some variables set by options. @@ -799,8 +979,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -845,7 +1026,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -871,7 +1052,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1075,7 +1256,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1091,7 +1272,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1121,8 +1302,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1130,7 +1311,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1148,13 +1329,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1177,7 +1358,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1191,8 +1372,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1207,9 +1388,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1248,11 +1429,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1278,7 +1459,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LCD4Linux 0.10.1-RC2 to adapt to many kinds of systems. +\`configure' configures LCD4Linux 0.11.0-SVN to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1292,7 +1473,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1352,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LCD4Linux 0.10.1-RC2:";; + short | recursive ) echo "Configuration of LCD4Linux 0.11.0-SVN:";; esac cat <<\_ACEOF @@ -1363,6 +1544,11 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-rpath do not hardcode runtime library paths + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1382,18 +1568,25 @@ Optional Packages: drivers may be excluded with 'all,!<driver>', (try 'all,\!<driver>' if your shell complains...) possible drivers are: - BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux, - G15, HD44780, LCD2USB LCDLinux, LCDTerm, LPH7508, - LUIse, M50530, MatrixOrbital, MilfordInstruments, - Noritake, NULL, PNG, PPM, picoLCD, RouterBoard, Sample, - serdisplib, SimpleLCD, T6963, Trefon, USBLCD, - USBHUB, WincorNixdorf, X11 + ASTUSB, BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux, D4D, + EA232Graphic, EFN, FW8888, G15, GLCD2USB, HD44780, HD44780-I2C, + IRLCD, LCD2USB, LCDLinux, LEDMatrix, LCDTerm, LPH7508, LUIse, + LW_ABP, M50530, MatrixOrbital, MatrixOrbitalGX, + MilfordInstruments, Noritake, NULL, Pertelian, PHAnderson, + PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard, + Sample, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963, + Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11 --with-plugins=<list> choose which plugins to compile. type --with-plugins=list for a list of avaible plugins + plugins may be excluded with 'all,!<plugin>', + (try 'all,\!<plugin>' if your shell complains...) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CC C compiler command @@ -1404,11 +1597,18 @@ Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path XMKMF Path to xmkmf, Makefile generator for X Window System PYTHON_VERSION The installed Python version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name. + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config + DBUS_LIBS linker flags for DBUS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1476,10 +1676,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LCD4Linux configure 0.10.1-RC2 -generated by GNU Autoconf 2.65 +LCD4Linux configure 0.11.0-SVN +generated by GNU Autoconf 2.67 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1549,7 +1749,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1619,7 +1819,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1686,10 +1886,10 @@ $as_echo "$ac_res" >&6; } ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1725,7 +1925,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1748,17 +1948,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## ---------------------------------------------------- ## +( $as_echo "## ---------------------------------------------------- ## ## Report this to lcd4linux-users@lists.sourceforge.net ## -## ---------------------------------------------------- ## -_ASBOX +## ---------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1822,7 +2020,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1853,7 +2051,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1901,8 +2099,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LCD4Linux $as_me 0.10.1-RC2, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by LCD4Linux $as_me 0.11.0-SVN, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2012,11 +2210,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2050,11 +2246,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2067,11 +2261,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2085,11 +2277,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2144,7 +2334,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2159,7 +2354,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2235,7 +2434,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2253,16 +2452,22 @@ am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2378,11 +2583,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2404,7 +2609,7 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -2414,7 +2619,7 @@ then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -2652,7 +2857,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2660,7 +2865,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -2694,7 +2899,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2710,7 +2915,7 @@ fi # Define the identity of the package. PACKAGE=lcd4linux - VERSION=0.10.1-RC2 + VERSION=0.11.0-SVN cat >>confdefs.h <<_ACEOF @@ -3054,8 +3259,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3169,9 +3374,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3213,8 +3417,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3271,9 +3475,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3324,8 +3528,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3776,7 +3980,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3792,11 +3996,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -3835,7 +4039,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3851,18 +4055,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -3887,7 +4091,7 @@ fi $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3895,7 +4099,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3915,6 +4119,125 @@ $as_echo "no" >&6; } fi + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + # dmalloc { $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5 $as_echo_n "checking if malloc debugging is wanted... " >&6; } @@ -4065,7 +4388,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4131,7 +4454,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4498,7 +4821,7 @@ $as_echo "Please note that some screen refreshs may fail" >&6; } $as_echo_n "checking for ncurses version... " >&6; } ncurses_version=unknown cat > conftest.$ac_ext <<EOF -#line 4501 "configure" +#line 4824 "configure" #include "confdefs.h" #ifdef RENAMED_NCURSES #include <curses.h> @@ -4555,7 +4878,7 @@ if test "x$with_x" = xno; then have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -4573,7 +4896,7 @@ libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done @@ -4659,7 +4982,7 @@ else fi done fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -5344,8 +5667,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5359,8 +5681,7 @@ for ac_header in X11/Xlib.h X11/Xutil.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5384,8 +5705,7 @@ for ac_header in gd/gd.h gd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5397,6 +5717,22 @@ fi done +# check for sys/io.h (RouterBoard driver) +for ac_header in sys/io.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/io.h" "ac_cv_header_sys_io_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_io_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_IO_H 1 +_ACEOF + has_io_h="true" +else + has_io_h="false" +fi + +done + + # check for usb.h for ac_header in usb.h do : @@ -5445,13 +5781,44 @@ fi done +# check for st2205 libs +for ac_header in st2205.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "st2205.h" "ac_cv_header_st2205_h" "$ac_includes_default" +if test "x$ac_cv_header_st2205_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ST2205_H 1 +_ACEOF + has_st2205="true" +else + has_st2205="false" +fi + +done + + +# check for vncserver libs +for ac_header in rfb/rfb.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "rfb/rfb.h" "ac_cv_header_rfb_rfb_h" "$ac_includes_default" +if test "x$ac_cv_header_rfb_rfb_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RFB_RFB_H 1 +_ACEOF + has_vncserverlib="true" +else + has_vncserverlib="false" +fi + +done + + # check for LCD-Linux for ac_header in linux/lcd-linux.h linux/hd44780.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5463,6 +5830,22 @@ fi done +# check for ftdi.h (ULA200) +for ac_header in ftdi.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ftdi.h" "ac_cv_header_ftdi_h" "$ac_includes_default" +if test "x$ac_cv_header_ftdi_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FTDI_H 1 +_ACEOF + has_ftdi="true" +else + has_ftdi="false"; break +fi + +done + + # check for python { $as_echo "$as_me:${as_lineno-$LINENO}: checking if python support is wanted" >&5 $as_echo_n "checking if python support is wanted... " >&6; } @@ -5476,9 +5859,10 @@ else $as_echo "no" >&6; } fi + if test "$with_python" = "yes"; then - # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html + # =========================================================================== +# http://www.nongnu.org/autoconf-archive/ax_python_devel.html # =========================================================================== # # SYNOPSIS @@ -5545,8 +5929,6 @@ if test "$with_python" = "yes"; then # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 4 - # This is what autoupdate's m4 run will expand. It fires # the warning (with _au_warn_XXX), outputs it into the # updated configure.ac (with AC_DIAGNOSE), and then outputs @@ -5615,7 +5997,7 @@ fi if test -z "$PYTHON"; then - as_fn_error "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 + as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 PYTHON_VERSION="" fi @@ -5633,7 +6015,7 @@ $as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error " +as_fn_error $? " This version of the AC_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the @@ -5642,7 +6024,7 @@ PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5 $as_echo "skip at user request" >&6; } @@ -5667,7 +6049,7 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error "this package requires Python . + as_fn_error $? "this package requires Python . If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See \`\`configure --help'' for reference. @@ -5688,7 +6070,7 @@ $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error "cannot import Python module \"distutils\". + as_fn_error $? "cannot import Python module \"distutils\". Please check your Python installation. The error was: $ac_distutils_result" "$LINENO" 5 PYTHON_VERSION="" @@ -5793,7 +6175,7 @@ EOD` fi if test -z "PYTHON_LDFLAGS"; then - as_fn_error " + as_fn_error $? " Cannot determine location of your Python DSO. Please check it was installed with dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. " "$LINENO" 5 @@ -5824,7 +6206,7 @@ $as_echo_n "checking python extra libraries... " >&6; } if test -z "$PYTHON_EXTRA_LIBS"; then PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ - print (conf('LIBS'))"` + print (conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5 $as_echo "$PYTHON_EXTRA_LIBS" >&6; } @@ -5896,7 +6278,7 @@ $as_echo "$pythonexists" >&6; } if test ! "x$pythonexists" = "xyes"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error " +as_fn_error $? " Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. @@ -5907,7 +6289,7 @@ as_fn_error " for your distribution. The exact name of this package varies among them. ============================================================================ -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } PYTHON_VERSION="" fi @@ -5917,6 +6299,24 @@ See \`config.log' for more details." "$LINENO" 5; } fi +# check for parport +#AC_CHECK_HEADERS(asm/io.h) +for ac_header in asm/io.h linux/parport.h linux/ppdev.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + has_parport="true" +else + has_parport="false" +fi + +done + + # drivers @@ -5949,39 +6349,59 @@ for driver in $drivers; do case "$driver" in all) + ASTUSB="yes" BECKMANNEGLE="yes" BWCT="yes" CRYSTALFONTZ="yes" CURSES="yes" CWLINUX="yes" + D4D="yes" EA232graphic="yes" + EFN="yes" + FW8888="yes" G15="yes" + GLCD2USB="yes" HD44780="yes" + HD44780_I2C="yes" + IRLCD="yes" LCD2USB="yes" LCDLINUX="yes" LCDTERM="yes" LEDMATRIX="yes" LPH7508="yes" LUISE="yes" + LW_ABP="yes" M50530="yes" MATRIXORBITAL="yes" + MATRIXORBITALGX="yes" MILINST="yes" NORITAKE="yes" NULL="yes" - picoLCD="yes" + PERTELIAN="yes" + PHANDERSON="yes" + PICGRAPHIC="yes" + PICOLCD="yes" + PICOLCDGRAPHIC="yes" PNG="yes" PPM="yes" ROUTERBOARD="yes" SAMPLE="yes" + ST2205="yes" SERDISPLIB="yes" + SHUTTLEVFD="yes" SIMPLELCD="yes" T6963="yes" Trefon="yes" + ULA200="yes" USBHUB="yes" USBLCD="yes" + VNC="yes" WINCORNIXDORF="yes" X11="yes" ;; + ASTUSB) + ASTUSB=$val + ;; BeckmannEgle) BECKMANNEGLE=$val ;; @@ -5997,18 +6417,33 @@ for driver in $drivers; do Cwlinux) CWLINUX=$val ;; + D4D) + D4D=$val + ;; EA232graphic) EA232graphic=$val ;; + EFN) + EFN=$val + ;; + FW8888) + FW8888=$val + ;; G15) G15=$val ;; + GLCD2USB) + GLCD2USB=$val + ;; HD44780) HD44780=$val ;; HD44780-I2C) HD44780_I2C=$val ;; + IRLCD) + IRLCD=$val + ;; LCD2USB) LCD2USB=$val ;; @@ -6027,12 +6462,18 @@ for driver in $drivers; do LUIse) LUISE=$val ;; + LW_ABP) + LW_ABP=$val + ;; M50530) M50530=$val ;; MatrixOrbital) MATRIXORBITAL=$val ;; + MatrixOrbitalGX) + MATRIXORBITALGX=$val + ;; MilfordInstruments) MILINST=$val ;; @@ -6042,8 +6483,20 @@ for driver in $drivers; do NULL) NULL=$val; ;; + Pertelian) + PERTELIAN=$val + ;; + PHAnderson) + PHANDERSON=$val + ;; + PICGraphic) + PICGRAPHIC=$val + ;; picoLCD) - picoLCD=$val + PICOLCD=$val + ;; + picoLCDGraphic) + PICOLCDGRAPHIC=$val ;; PNG) PNG=$val @@ -6060,21 +6513,33 @@ for driver in $drivers; do serdisplib) SERDISPLIB=$val; ;; + ShuttleVFD) + SHUTTLEVFD=$val + ;; SimpleLCD) SIMPLELCD=$val ;; + st2205) + ST2205=$val + ;; T6963) T6963=$val ;; Trefon) Trefon=$val ;; + ULA200) + ULA200=$val + ;; USBHUB) USBHUB=$val ;; USBLCD) USBLCD=$val ;; + VNC) + VNC=$val + ;; WincorNixdorf) WINCORNIXDORF=$val ;; @@ -6082,7 +6547,7 @@ for driver in $drivers; do X11=$val ;; *) - as_fn_error "Unknown driver '$driver'" "$LINENO" 5 + as_fn_error $? "Unknown driver '$driver'" "$LINENO" 5 ;; esac done @@ -6105,6 +6570,22 @@ KEYPAD="no" # generic libraries LIBUSB="no" +LIBFTDI="no" + +if test "$ASTUSB" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_ASTUSB.o" + LIBUSB="yes" + +$as_echo "#define WITH_ASTUSB 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: ASTUSB driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: ASTUSB driver disabled" >&2;} + fi +fi if test "$BECKMANNEGLE" = "yes"; then TEXT="yes" @@ -6168,6 +6649,16 @@ $as_echo "#define WITH_CWLINUX 1" >>confdefs.h fi +if test "$D4D" = "yes"; then + TEXT="yes" + GRAPHIC="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_D4D.o" + +$as_echo "#define WITH_D4D 1" >>confdefs.h + +fi + if test "$EA232graphic" = "yes"; then GRAPHIC="yes" SERIAL="yes" @@ -6178,6 +6669,24 @@ $as_echo "#define WITH_EA232graphic 1" >>confdefs.h fi +if test "$EFN" = "yes"; then + TEXT="yes" + DRIVERS="$DRIVERS drv_EFN.o" + +$as_echo "#define WITH_EFN 1" >>confdefs.h + +fi + + +if test "$FW8888" = "yes"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_FW8888.o" + +$as_echo "#define WITH_FW8888 1" >>confdefs.h + +fi + if test "$G15" = "yes"; then if test "$has_usb" = "true"; then GRAPHIC="yes" @@ -6192,15 +6701,19 @@ $as_echo "$as_me: WARNING: usb.h not found: G15 driver disabled" >&2;} fi fi -if test "$HD44780" = "yes"; then - TEXT="yes" - PARPORT="yes" - I2C="yes" - GPIO="yes" - DRIVERS="$DRIVERS drv_HD44780.o" +if test "$GLCD2USB" = "yes"; then + if test "$has_usb" = "true"; then + GRAPHIC="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_GLCD2USB.o" + LIBUSB="yes" -$as_echo "#define WITH_HD44780 1" >>confdefs.h +$as_echo "#define WITH_GLCD2USB 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: GLCD2USB driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: GLCD2USB driver disabled" >&2;} + fi fi if test "$HD44780_I2C" = "yes"; then @@ -6213,6 +6726,44 @@ $as_echo "#define WITH_HD44780 1" >>confdefs.h fi +if test "$HD44780" = "yes"; then + if test "$HD44780_I2C" != "yes"; then + if test "$has_parport" = "true"; then + TEXT="yes" + PARPORT="yes" + I2C="yes" + GPIO="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_HD44780.o" + +$as_echo "#define WITH_HD44780 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: HD44780 driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: HD44780 driver disabled" >&2;} + fi + else + HD44780="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HD44780-i2c enabled disabling HD44780" >&5 +$as_echo "$as_me: WARNING: HD44780-i2c enabled disabling HD44780" >&2;} + fi +fi + +if test "$IRLCD" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_IRLCD.o" + LIBUSB="yes" + +$as_echo "#define WITH_IRLCD 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: IRLCD driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: IRLCD driver disabled" >&2;} + fi +fi + if test "$LCD2USB" = "yes"; then if test "$has_usb" = "true"; then TEXT="yes" @@ -6260,13 +6811,18 @@ $as_echo "#define WITH_LEDMATRIX 1" >>confdefs.h fi if test "$LPH7508" = "yes"; then - GRAPHIC="yes" - GPIO="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_LPH7508.o" + if test "$has_parport" = "true"; then + GRAPHIC="yes" + GPIO="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_LPH7508.o" $as_echo "#define WITH_LPH7508 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: LPH7508 driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: LPH7508 driver disabled" >&2;} + fi fi if test "$LUISE" = "yes"; then @@ -6283,14 +6839,29 @@ $as_echo "$as_me: WARNING: luise.h not found: LUIse driver disabled" >&2;} fi fi -if test "$M50530" = "yes"; then +if test "$LW_ABP" = "yes"; then TEXT="yes" - GPIO="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_M50530.o" + SERIAL="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_LW_ABP.o" + +$as_echo "#define WITH_LW_ABP 1" >>confdefs.h + +fi + +if test "$M50530" = "yes"; then + if test "$has_parport" = "true"; then + TEXT="yes" + GPIO="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_M50530.o" $as_echo "#define WITH_M50530 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: M50530 driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: M50530 driver disabled" >&2;} + fi fi if test "$MATRIXORBITAL" = "yes"; then @@ -6303,6 +6874,21 @@ $as_echo "#define WITH_MATRIXORBITAL 1" >>confdefs.h fi +if test "$MATRIXORBITALGX" = "yes"; then + if test "$has_usb" = "true"; then + GRAPHIC="yes" + SERIAL="yes" + LIBUSB="yes" + DRIVERS="$DRIVERS drv_MatrixOrbitalGX.o" + +$as_echo "#define WITH_MATRIXORBITALGX 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: MatrixOrbitalGX driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: MatrixOrbitalGX driver disabled" >&2;} + fi +fi + if test "$MILINST" = "yes"; then TEXT="yes" SERIAL="yes" @@ -6313,13 +6899,18 @@ $as_echo "#define WITH_MILINST 1" >>confdefs.h fi if test "$NORITAKE" = "yes"; then - TEXT="yes" - GRAPHIC="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_Noritake.o" + if test "$has_parport" = "true"; then + TEXT="yes" + GRAPHIC="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_Noritake.o" $as_echo "#define WITH_NORITAKE 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: NORITAKE driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: NORITAKE driver disabled" >&2;} + fi fi if test "$NULL" = "yes"; then @@ -6330,7 +6921,37 @@ $as_echo "#define WITH_NULL 1" >>confdefs.h fi -if test "$picoLCD" = "yes"; then +if test "$PERTELIAN" = "yes"; then + # select either text or graphics mode + TEXT="yes" + # select bus: serial (including USB), parallel or i2c + SERIAL="yes" + DRIVERS="$DRIVERS drv_Pertelian.o" + +$as_echo "#define WITH_PERTELIAN 1" >>confdefs.h + +fi + +if test "$PHANDERSON" = "yes"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_PHAnderson.o" + +$as_echo "#define WITH_PHANDERSON 1" >>confdefs.h + +fi + +if test "$PICGRAPHIC" = "yes"; then + GRAPHIC="yes" + GPIO="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_PICGraphic.o" + +$as_echo "#define WITH_PICGRAPHIC 1" >>confdefs.h + +fi + +if test "$PICOLCD" = "yes"; then if test "$has_usb" = "true"; then TEXT="yes" GPIO="yes" @@ -6338,7 +6959,7 @@ if test "$picoLCD" = "yes"; then LIBUSB="yes" DRIVERS="$DRIVERS drv_picoLCD.o" -$as_echo "#define WITH_picoLCD 1" >>confdefs.h +$as_echo "#define WITH_PICOLCD 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: picoLCD driver disabled" >&5 @@ -6346,6 +6967,23 @@ $as_echo "$as_me: WARNING: usb.h not found: picoLCD driver disabled" >&2;} fi fi +if test "$PICOLCDGRAPHIC" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + GRAPHIC="yes" + GPIO="yes" + SERIAL="yes" + LIBUSB="yes" + DRIVERS="$DRIVERS drv_picoLCDGraphic.o" + +$as_echo "#define WITH_PICOLCDGRAPHIC 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: picoLCDGraphic driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: picoLCDGraphic driver disabled" >&2;} + fi +fi + if test "$PNG" = "yes"; then if test "$has_gd" = "true"; then IMAGE="yes" @@ -6366,28 +7004,38 @@ $as_echo "#define WITH_PPM 1" >>confdefs.h fi if test "$ROUTERBOARD" = "yes"; then - TEXT="yes" - GPIO="yes" - DRIVERS="$DRIVERS drv_RouterBoard.o" + if test "$has_io_h" = "true"; then + TEXT="yes" + GPIO="yes" + DRIVERS="$DRIVERS drv_RouterBoard.o" $as_echo "#define WITH_ROUTERBOARD 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sys/io.h not found: RouterBoard driver disabled" >&5 +$as_echo "$as_me: WARNING: sys/io.h not found: RouterBoard driver disabled" >&2;} + fi fi if test "$SAMPLE" = "yes"; then - # select either text or graphics mode - TEXT="yes" - GRAPHIC="yes" - # support for GPIO's - GPIO="yes" - # select bus: serial (including USB), parallel or i2c - SERIAL="yes" - PARPORT="yes" - #I2C="yes" - DRIVERS="$DRIVERS drv_Sample.o" + if test "$has_parport" = "true"; then + # select either text or graphics mode + TEXT="yes" + GRAPHIC="yes" + # support for GPIO's + GPIO="yes" + # select bus: serial (including USB), parallel or i2c + SERIAL="yes" + PARPORT="yes" + #I2C="yes" + DRIVERS="$DRIVERS drv_Sample.o" $as_echo "#define WITH_SAMPLE 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: SAMPLE driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: SAMPLE driver disabled" >&2;} + fi fi if test "$SERDISPLIB" = "yes"; then @@ -6407,6 +7055,21 @@ $as_echo "$as_me: WARNING: serdisp.h not found: serdisplib driver disabled" >&2; fi fi +if test "$SHUTTLEVFD" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + GPIO="yes" + DRIVERS="$DRIVERS drv_ShuttleVFD.o" + LIBUSB="yes" + +$as_echo "#define WITH_SHUTTLEVFD 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: usb.h not found: ShuttleVFD driver disabled" >&5 +$as_echo "$as_me: WARNING: usb.h not found: ShuttleVFD driver disabled" >&2;} + fi +fi + if test "$SIMPLELCD" = "yes"; then TEXT="yes" SERIAL="yes" @@ -6416,13 +7079,32 @@ $as_echo "#define WITH_SIMPLELCD 1" >>confdefs.h fi +if test "$ST2205" = "yes"; then + if test "$has_st2205" = "true"; then + GRAPHIC="yes" + DRIVERS="$DRIVERS drv_st2205.o" + DRVLIBS="$DRVLIBS -L/usr/local/lib -lst2205" + +$as_echo "#define WITH_ST2205 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: st2205.h not found: st2205 driver disabled" >&5 +$as_echo "$as_me: WARNING: st2205.h not found: st2205 driver disabled" >&2;} + fi +fi + if test "$T6963" = "yes"; then - GRAPHIC="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_T6963.o" + if test "$has_parport" = "true"; then + GRAPHIC="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_T6963.o" $as_echo "#define WITH_T6963 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: T6963 driver disabled" >&5 +$as_echo "$as_me: WARNING: asm/io.h or {linux/parport.h and linux/ppdev.h} not found: T6963 driver disabled" >&2;} + fi fi if test "$Trefon" = "yes"; then @@ -6439,6 +7121,21 @@ $as_echo "$as_me: WARNING: usb.h not found: Trefon driver disabled" >&2;} fi fi +if test "$ULA200" = "yes"; then + if test "$has_ftdi" = "true"; then + TEXT="yes" + LIBUSB="yes" + LIBFTDI="yes" + DRIVERS="$DRIVERS drv_ula200.o" + +$as_echo "#define WITH_ULA200 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ftdi.h not found: ULA200 driver disabled" >&5 +$as_echo "$as_me: WARNING: ftdi.h not found: ULA200 driver disabled" >&2;} + fi +fi + if test "$USBHUB" = "yes"; then if test "$has_usb" = "true"; then GPIO="yes" @@ -6465,6 +7162,21 @@ $as_echo "#define WITH_USBLCD 1" >>confdefs.h fi +if test "$VNC" = "yes"; then + if test "$has_vncserverlib" = "true"; then + GRAPHIC="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_vnc.o" + DRVLIBS="$DRVLIBS -L/usr/local/lib -lvncserver -lz" + +$as_echo "#define WITH_VNC 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libvncserver not found: vnc driver disabled" >&5 +$as_echo "$as_me: WARNING: libvncserver not found: vnc driver disabled" >&2;} + fi +fi + if test "$WINCORNIXDORF" = "yes"; then TEXT="yes" SERIAL="yes" @@ -6480,6 +7192,7 @@ if test "$X11" = "yes"; then $as_echo "$as_me: WARNING: X11 headers or libraries not available: X11 driver disabled" >&2;} else GRAPHIC="yes" + KEYPAD="yes" DRIVERS="$DRIVERS drv_X11.o" if test "x$ac_x_libraries" = "x"; then DRVLIBS="$DRVLIBS -lX11" @@ -6501,7 +7214,7 @@ if test "$IMAGE" = "yes"; then fi if test "$DRIVERS" = ""; then - as_fn_error "You should activate at least one driver..." "$LINENO" 5 + as_fn_error $? "You should activate at least one driver..." "$LINENO" 5 fi # generic text driver @@ -6516,6 +7229,9 @@ if test "$GRAPHIC" = "yes"; then DRIVERS="$DRIVERS widget_image.o" DRVLIBS="$DRVLIBS -lgd" +$as_echo "#define WITH_GD 1" >>confdefs.h + + $as_echo "#define WITH_IMAGE 1" >>confdefs.h fi @@ -6560,6 +7276,15 @@ if test "$LIBUSB" = "yes"; then DRVLIBS="$DRVLIBS -lusb" fi +# libftdi +if test "$LIBFTDI" = "yes"; then + DRVLIBS="$DRVLIBS -lftdi" +fi + +if test "$DRIVERS" = ""; then + as_fn_error $? "You should include at least one driver..." "$LINENO" 5 +fi + @@ -6596,17 +7321,35 @@ for plugin in $plugins; do case "$plugin" in list) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: TO BE DONE..." >&5 -$as_echo "TO BE DONE..." >&6; } - as_fn_error "run ./configure --with-plugins=..." "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: available plugins: + apm,asterisk,button_exec,cpuinfo,dbus,diskstats,dvb,exec,event, + fifo,file,gps,hddtemp,huawei,i2c_sensors,iconv,imon,isdn,kvv, + loadavg,meminfo,mpd,mpris_dbus,mysql,netdev,netinfo,pop3,ppp, + proc_stat,python,qnaplog,sample,seti,statfs,uname,uptime, + w1retap,wireless,xmms" >&5 +$as_echo "available plugins: + apm,asterisk,button_exec,cpuinfo,dbus,diskstats,dvb,exec,event, + fifo,file,gps,hddtemp,huawei,i2c_sensors,iconv,imon,isdn,kvv, + loadavg,meminfo,mpd,mpris_dbus,mysql,netdev,netinfo,pop3,ppp, + proc_stat,python,qnaplog,sample,seti,statfs,uname,uptime, + w1retap,wireless,xmms" >&6; } + as_fn_error $? "run ./configure --with-plugins=..." "$LINENO" 5 ;; all) PLUGIN_APM="yes" + PLUGIN_ASTERISK="yes" + PLUGIN_BUTTON_EXEC="yes" PLUGIN_CPUINFO="yes" + PLUGIN_DBUS="yes" PLUGIN_DISKSTATS="yes" PLUGIN_DVB="yes" PLUGIN_EXEC="yes" + PLUGIN_EVENT="yes" + PLUGIN_FIFO="yes" PLUGIN_FILE="yes" + PLUGIN_GPS="yes" + PLUGIN_HDDTEMP="yes" + PLUGIN_HUAWEI="yes" PLUGIN_I2C_SENSORS="yes" PLUGIN_ICONV="yes" PLUGIN_IMON="yes" @@ -6615,26 +7358,39 @@ $as_echo "TO BE DONE..." >&6; } PLUGIN_LOADAVG="yes" PLUGIN_MEMINFO="yes" PLUGIN_MPD="yes" + PLUGIN_MPRIS_DBUS="yes" PLUGIN_MYSQL="yes" PLUGIN_NETDEV="yes" + PLUGIN_NETINFO="yes" PLUGIN_POP3="yes" PLUGIN_PPP="yes" PLUGIN_PROC_STAT="yes" PLUGIN_PYTHON=$with_python + PLUGIN_QNAPLOG="yes" PLUGIN_SAMPLE="yes" PLUGIN_SETI="yes" PLUGIN_STATFS="yes" PLUGIN_UNAME="yes" PLUGIN_UPTIME="yes" + PLUGIN_W1RETAP="yes" PLUGIN_WIRELESS="yes" PLUGIN_XMMS="yes" ;; apm) PLUGIN_APM=$val ;; + button_exec) + PLUGIN_BUTTON_EXEC=$val + ;; + asterisk) + PLUGIN_ASTERISK=$val + ;; cpuinfo) PLUGIN_CPUINFO=$val ;; + dbus) + PLUGIN_DBUS=$val + ;; diskstats) PLUGIN_DISKSTATS=$val ;; @@ -6644,9 +7400,24 @@ $as_echo "TO BE DONE..." >&6; } exec) PLUGIN_EXEC=$val ;; + event) + PLUGIN_EVENT=$val + ;; + fifo) + PLUGIN_FIFO=$val + ;; file) PLUGIN_FILE=$val ;; + gps) + PLUGIN_GPS=$val + ;; + hddtemp) + PLUGIN_HDDTEMP=$val + ;; + huawei) + PLUGIN_HUAWEI=$val + ;; i2c_sensors) PLUGIN_I2C_SENSORS=$val ;; @@ -6671,12 +7442,18 @@ $as_echo "TO BE DONE..." >&6; } mpd) PLUGIN_MPD=$val ;; + mpris_dbus) + PLUGIN_MPRIS_DBUS=$val + ;; mysql) PLUGIN_MYSQL=$val ;; netdev) PLUGIN_NETDEV=$val ;; + netinfo) + PLUGIN_NETINFO=$val + ;; pop3) PLUGIN_POP3=$val ;; @@ -6689,6 +7466,9 @@ $as_echo "TO BE DONE..." >&6; } python) PLUGIN_PYTHON=$val ;; + qnaplog) + PLUGIN_QNAPLOG=$val + ;; sample) PLUGIN_SAMPLE=$val ;; @@ -6704,6 +7484,9 @@ $as_echo "TO BE DONE..." >&6; } uptime) PLUGIN_UPTIME=$val ;; + w1retap) + PLUGIN_W1RETAP=$val + ;; wireless) PLUGIN_WIRELESS=$val ;; @@ -6711,33 +7494,194 @@ $as_echo "TO BE DONE..." >&6; } PLUGIN_XMMS=$val ;; *) - as_fn_error "Unknown plugin '$plugin'" "$LINENO" 5 + as_fn_error $? "Unknown plugin '$plugin'" "$LINENO" 5 ;; esac done { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } + +# Advanced Power Management if test "$PLUGIN_APM" = "yes"; then - PLUGINS="$PLUGINS plugin_apm.o" + for ac_header in asm/types.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_types_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ASM_TYPES_H 1 +_ACEOF + has_asm_types="true" +else + has_asm_types="false" +fi + +done + + if test "$has_asm_types" = "true"; then + PLUGINS="$PLUGINS plugin_apm.o" $as_echo "#define PLUGIN_APM 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/types.h header not found: apm plugin disabled" >&5 +$as_echo "$as_me: WARNING: asm/types.h header not found: apm plugin disabled" >&2;} + fi fi + +if test "$PLUGIN_BUTTON_EXEC" = "yes"; then + PLUGINS="$PLUGINS plugin_button_exec.o" + +$as_echo "#define PLUGIN_BUTTON_EXEC 1" >>confdefs.h + +fi + +if test "$PLUGIN_ASTERISK" = "yes"; then + PLUGINS="$PLUGINS plugin_asterisk.o" + +$as_echo "#define PLUGIN_ASTERISK 1" >>confdefs.h + +fi + +# /proc/cpuinfo if test "$PLUGIN_CPUINFO" = "yes"; then PLUGINS="$PLUGINS plugin_cpuinfo.o" $as_echo "#define PLUGIN_CPUINFO 1" >>confdefs.h fi + +#DBus +if test "$PLUGIN_DBUS" = "yes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 +$as_echo_n "checking for DBUS... " >&6; } + +if test -n "$DBUS_CFLAGS"; then + pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS_LIBS"; then + pkg_cv_DBUS_LIBS="$DBUS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbus-1 >= 1.0.0" 2>&1` + else + DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbus-1 >= 1.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS_PKG_ERRORS" >&5 + + HAVE_DBUS="no" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_DBUS="no" +else + DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS + DBUS_LIBS=$pkg_cv_DBUS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_DBUS="yes" +fi + if test "x$HAVE_DBUS" == "xyes"; then + PLUGINS="$PLUGINS plugin_dbus.o" + PLUGINLIBS="$PLUGINLIBS $DBUS_LIBS" + CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" + +$as_echo "#define PLUGIN_DBUS 1" >>confdefs.h + + + DBUS_VERSION=$($PKG_CONFIG --modversion dbus-1) + DBUS_VERSION_MAJOR=$(echo $DBUS_VERSION | cut -d . -f 1) + DBUS_VERSION_MINOR=$(echo $DBUS_VERSION | cut -d . -f 2) + DBUS_VERSION_MICRO=$(echo $DBUS_VERSION | cut -d . -f 3) + + +cat >>confdefs.h <<_ACEOF +#define DBUS_VERSION_MAJOR $DBUS_VERSION_MAJOR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBUS_VERSION_MINOR $DBUS_VERSION_MINOR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DBUS_VERSION_MICRO $DBUS_VERSION_MICRO +_ACEOF + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dbus-1 not found check that PKG_CONFIG_PATH is set correctly: dbus plugin disabled" >&5 +$as_echo "$as_me: WARNING: dbus-1 not found check that PKG_CONFIG_PATH is set correctly: dbus plugin disabled" >&2;} + fi +fi + +# /proc/diskstat if test "$PLUGIN_DISKSTATS" = "yes"; then PLUGINS="$PLUGINS plugin_diskstats.o" $as_echo "#define PLUGIN_DISKSTATS 1" >>confdefs.h fi + +# Digital Video Broadcasting if test "$PLUGIN_DVB" = "yes"; then - for ac_header in linux/dvb/frontend.h + for ac_header in asm/types.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_types_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ASM_TYPES_H 1 +_ACEOF + has_asm_types="true" +else + has_asm_types="false" +fi + +done + + if test "$has_asm_types" = "true"; then + for ac_header in linux/dvb/frontend.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/dvb/frontend.h" "ac_cv_header_linux_dvb_frontend_h" "$ac_includes_default" if test "x$ac_cv_header_linux_dvb_frontend_h" = x""yes; then : @@ -6751,39 +7695,158 @@ fi done - if test "$has_dvb_header" = "true"; then - PLUGINS="$PLUGINS plugin_dvb.o" + if test "$has_dvb_header" = "true"; then + PLUGINS="$PLUGINS plugin_dvb.o" $as_echo "#define PLUGIN_DVB 1" >>confdefs.h - else - PLUGINS="$PLUGINS plugin_dvb.o" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/dvb/frontend.h header not found: using ioctl" >&5 + else + PLUGINS="$PLUGINS plugin_dvb.o" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/dvb/frontend.h header not found: using ioctl" >&5 $as_echo "$as_me: WARNING: linux/dvb/frontend.h header not found: using ioctl" >&2;} + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asm/types.h header not found: dvb plugin disabled" >&5 +$as_echo "$as_me: WARNING: asm/types.h header not found: dvb plugin disabled" >&2;} fi fi + +# start external commands (exec) if test "$PLUGIN_EXEC" = "yes"; then PLUGINS="$PLUGINS plugin_exec.o" $as_echo "#define PLUGIN_EXEC 1" >>confdefs.h fi + +# event +if test "$PLUGIN_EVENT" = "yes"; then + PLUGINS="$PLUGINS plugin_event.o" + +$as_echo "#define PLUGIN_EVENT 1" >>confdefs.h + +fi + +# file if test "$PLUGIN_FILE" = "yes"; then PLUGINS="$PLUGINS plugin_file.o" $as_echo "#define PLUGIN_FILE 1" >>confdefs.h fi + +# FIFO +if test "$PLUGIN_FIFO" = "yes"; then + PLUGINS="$PLUGINS plugin_fifo.o" + +$as_echo "#define PLUGIN_FIFO 1" >>confdefs.h + +fi + +# GPS +if test "$PLUGIN_GPS" = "yes"; then + for ac_header in nmeap.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "nmeap.h" "ac_cv_header_nmeap_h" "$ac_includes_default" +if test "x$ac_cv_header_nmeap_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NMEAP_H 1 +_ACEOF + has_nmeap_header="true" +else + has_nmeap_header="false" +fi + +done + + if test "$has_nmeap_header" = "true"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nmeap_init in -lnmeap" >&5 +$as_echo_n "checking for nmeap_init in -lnmeap... " >&6; } +if test "${ac_cv_lib_nmeap_nmeap_init+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnmeap $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nmeap_init (); +int +main () +{ +return nmeap_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nmeap_nmeap_init=yes +else + ac_cv_lib_nmeap_nmeap_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nmeap_nmeap_init" >&5 +$as_echo "$ac_cv_lib_nmeap_nmeap_init" >&6; } +if test "x$ac_cv_lib_nmeap_nmeap_init" = x""yes; then : + has_libnmeap_lib="true" +else + has_libnmeap_lib="false" +fi + + if test "$has_libnmeap_lib" = "true"; then + PLUGINS="$PLUGINS plugin_gps.o" + PLUGINLIBS="$PLUGINLIBS -lnmeap" + +$as_echo "#define PLUGIN_GPS 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libnmeap lib not found: gps plugin disabled" >&5 +$as_echo "$as_me: WARNING: libnmeap lib not found: gps plugin disabled" >&2;} + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: nmeap.h header not found: gps plugin disabled" >&5 +$as_echo "$as_me: WARNING: nmeap.h header not found: gps plugin disabled" >&2;} + fi +fi + +# hddtemp +if test "$PLUGIN_HDDTEMP" = "yes"; then + PLUGINS="$PLUGINS plugin_hddtemp.o" + +$as_echo "#define PLUGIN_HDDTEMP 1" >>confdefs.h + +fi + +# Huawei +if test "$PLUGIN_HUAWEI" = "yes"; then + PLUGINS="$PLUGINS plugin_huawei.o" + +$as_echo "#define PLUGIN_HUAWEI 1" >>confdefs.h + +fi + +# I2C if test "$PLUGIN_I2C_SENSORS" = "yes"; then PLUGINS="$PLUGINS plugin_i2c_sensors.o" $as_echo "#define PLUGIN_I2C_SENSORS 1" >>confdefs.h fi + +# IConv if test "$PLUGIN_ICONV" = "yes"; then # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } @@ -6794,16 +7857,16 @@ else test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -6828,7 +7891,7 @@ else ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -6836,7 +7899,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -6908,7 +7971,7 @@ $as_echo_n "checking for ld used by GCC... " >&6; } # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; @@ -6942,9 +8005,9 @@ else # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; + test "$with_gnu_ld" != no && break ;; *) - test "$with_gnu_ld" != yes && break ;; + test "$with_gnu_ld" != yes && break ;; esac fi done @@ -6962,7 +8025,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then : @@ -7016,23 +8079,70 @@ fi - acl_libdirstem=lib - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; + + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 +$as_echo_n "checking for 64-bit host... " >&6; } +if test "${gl_cv_solaris_64bit+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef _LP64 +sixtyfour bits +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sixtyfour bits" >/dev/null 2>&1; then : + gl_cv_solaris_64bit=yes +else + gl_cv_solaris_64bit=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 +$as_echo "$gl_cv_solaris_64bit" >&6; } + if test $gl_cv_solaris_64bit = yes; then + acl_libdirstem=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi - done - IFS="$acl_save_IFS" - fi + ;; + *) + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + + + @@ -7078,6 +8188,10 @@ if test "${with_libiconv_prefix+set}" = set; then : else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" + if test "$acl_libdirstem2" != "$acl_libdirstem" \ + && ! test -d "$withval/$acl_libdirstem"; then + additional_libdir="$withval/$acl_libdirstem2" + fi fi fi @@ -7087,6 +8201,7 @@ fi LTLIBICONV= INCICONV= LIBICONV_PREFIX= + HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= @@ -7229,7 +8344,9 @@ fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= @@ -7296,7 +8413,16 @@ fi case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBICONV_PREFIX="$basedir" + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi additional_includedir="$basedir/include" ;; esac @@ -7345,9 +8471,11 @@ fi case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -7479,6 +8607,11 @@ fi + + + + + am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do @@ -7603,6 +8736,25 @@ int main () return 1; } } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static const char input[] = "\263"; + char buf[10]; + const char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + (char **) &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + return 1; + } + } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { @@ -7716,10 +8868,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- - }$am_cv_proto_iconv" >&5 -$as_echo "${ac_t:- - }$am_cv_proto_iconv" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: + $am_cv_proto_iconv" >&5 +$as_echo " + $am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 @@ -7738,12 +8890,35 @@ $as_echo "#define PLUGIN_ICONV 1" >>confdefs.h $as_echo "$as_me: WARNING: iconv not found: iconv plugin disabled" >&2;} fi fi + +# ISDN monitor if test "$PLUGIN_IMON" = "yes"; then - PLUGINS="$PLUGINS plugin_imon.o" + for ac_header in linux/errno.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/errno.h" "ac_cv_header_linux_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_errno_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_ERRNO_H 1 +_ACEOF + has_linux_errno="true" +else + has_linux_errno="false" +fi + +done + + if test "$has_linux_errno" = "true"; then + PLUGINS="$PLUGINS plugin_imon.o" $as_echo "#define PLUGIN_IMON 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/errno.h header not found: imon plugin disabled" >&5 +$as_echo "$as_me: WARNING: linux/errno.h header not found: imon plugin disabled" >&2;} + fi fi + +# ISDN if test "$PLUGIN_ISDN" = "yes"; then for ac_header in linux/isdn.h do : @@ -7768,47 +8943,116 @@ $as_echo "$as_me: WARNING: linux/isdn.h header not found: isdn plugin CPS disabl $as_echo "#define PLUGIN_ISDN 1" >>confdefs.h fi + +# Karlsruher Verkehrsverbund if test "$PLUGIN_KVV" = "yes"; then PLUGINS="$PLUGINS plugin_kvv.o" $as_echo "#define PLUGIN_KVV 1" >>confdefs.h fi + +# load average if test "$PLUGIN_LOADAVG" = "yes"; then PLUGINS="$PLUGINS plugin_loadavg.o" $as_echo "#define PLUGIN_LOADAVG 1" >>confdefs.h fi + +# meminfo if test "$PLUGIN_MEMINFO" = "yes"; then PLUGINS="$PLUGINS plugin_meminfo.o" $as_echo "#define PLUGIN_MEMINFO 1" >>confdefs.h fi + +# MPD if test "$PLUGIN_MPD" = "yes"; then - for ac_header in libmpd/libmpd.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpd_newConnection in -llibmpd" >&5 +$as_echo_n "checking for mpd_newConnection in -llibmpd... " >&6; } +if test "${ac_cv_lib_libmpd_mpd_newConnection+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llibmpd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mpd_newConnection (); +int +main () +{ +return mpd_newConnection (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_libmpd_mpd_newConnection=yes +else + ac_cv_lib_libmpd_mpd_newConnection=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_libmpd_mpd_newConnection" >&5 +$as_echo "$ac_cv_lib_libmpd_mpd_newConnection" >&6; } +if test "x$ac_cv_lib_libmpd_mpd_newConnection" = x""yes; then : + has_mpd_header="true" +else + has_mpd_header="false" +fi + + if test "$has_mpd_header" = "true"; then + PLUGINS="$PLUGINS plugin_mpd.o" + PLUGINLIBS="$PLUGINLIBS `pkg-config libmpd --libs`" + CPPFLAGS="$CPPFLAGS `pkg-config libmpd --cflags`" + +$as_echo "#define PLUGIN_MPD 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libmpdclient.h header not found: mpd plugin disabled" >&5 +$as_echo "$as_me: WARNING: libmpdclient.h header not found: mpd plugin disabled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: get libmpdclient.h from http://www.musicpd.org/libmpdclient.shtml" >&5 +$as_echo "$as_me: WARNING: get libmpdclient.h from http://www.musicpd.org/libmpdclient.shtml" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: and copy those 2 files in the lcd4linux directory." >&5 +$as_echo "$as_me: WARNING: and copy those 2 files in the lcd4linux directory." >&2;} + fi +fi + +# MPRIS D-Bus +if test "$PLUGIN_MPRIS_DBUS" = "yes"; then + for ac_header in dbus/dbus.h do : - ac_fn_c_check_header_mongrel "$LINENO" "libmpd/libmpd.h" "ac_cv_header_libmpd_libmpd_h" "$ac_includes_default" -if test "x$ac_cv_header_libmpd_libmpd_h" = x""yes; then : + ac_fn_c_check_header_mongrel "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default" +if test "x$ac_cv_header_dbus_dbus_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPD_LIBMPD_H 1 +#define HAVE_DBUS_DBUS_H 1 _ACEOF - has_libmpd_header="true" + has_dbus_header="true" else - has_libmpd_header="false" + has_dbus_header="false" fi done - if test "$has_libmpd_header" = "true"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpd_connect in -lmpd" >&5 -$as_echo_n "checking for mpd_connect in -lmpd... " >&6; } -if test "${ac_cv_lib_mpd_mpd_connect+set}" = set; then : + if test "$has_dbus_header" = "true"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus_bus_get in -ldbus-1" >&5 +$as_echo_n "checking for dbus_bus_get in -ldbus-1... " >&6; } +if test "${ac_cv_lib_dbus_1_dbus_bus_get+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpd $LIBS" +LIBS="-ldbus-1 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7818,47 +9062,50 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char mpd_connect (); +char dbus_bus_get (); int main () { -return mpd_connect (); +return dbus_bus_get (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mpd_mpd_connect=yes + ac_cv_lib_dbus_1_dbus_bus_get=yes else - ac_cv_lib_mpd_mpd_connect=no + ac_cv_lib_dbus_1_dbus_bus_get=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpd_mpd_connect" >&5 -$as_echo "$ac_cv_lib_mpd_mpd_connect" >&6; } -if test "x$ac_cv_lib_mpd_mpd_connect" = x""yes; then : - has_libmpd_lib="true" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbus_1_dbus_bus_get" >&5 +$as_echo "$ac_cv_lib_dbus_1_dbus_bus_get" >&6; } +if test "x$ac_cv_lib_dbus_1_dbus_bus_get" = x""yes; then : + has_libdbus1_lib="true" else - has_libmpd_lib="false" + has_libdbus1_lib="false" fi - if test "$has_libmpd_lib" = "true"; then - PLUGINS="$PLUGINS plugin_mpd.o" - PLUGINLIBS="$PLUGINLIBS -lmpd" + if test "$has_libdbus1_lib" = "true"; then + PLUGINS="$PLUGINS plugin_mpris_dbus.o" + PLUGINLIBS="$PLUGINLIBS -ldbus-1" -$as_echo "#define PLUGIN_MPD 1" >>confdefs.h +$as_echo "#define PLUGIN_MPRIS_DBUS 1" >>confdefs.h else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libmpd lib not found: mpd plugin disabled" >&5 -$as_echo "$as_me: WARNING: libmpd lib not found: mpd plugin disabled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdbus-1 lib not found: mpris_dbus plugin disabled" >&5 +$as_echo "$as_me: WARNING: libdbus-1 lib not found: mpris_dbus plugin disabled" >&2;} fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libmpd/libmpd.h header not found: mpd plugin disabled" >&5 -$as_echo "$as_me: WARNING: libmpd/libmpd.h header not found: mpd plugin disabled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dbus/dbus.h header not found: mpris_dbus plugin disabled" >&5 +$as_echo "$as_me: WARNING: dbus/dbus.h header not found: mpris_dbus plugin disabled" >&2;} fi fi + + +# MySQL if test "$PLUGIN_MYSQL" = "yes"; then for ac_header in mysql/mysql.h do : @@ -7932,18 +9179,32 @@ $as_echo "$as_me: WARNING: mysqlclient lib not found: mysql plugin disabled" >&2 $as_echo "$as_me: WARNING: mysql/mysql.h header not found: mysql plugin disabled" >&2;} fi fi + +# /proc/net/dev if test "$PLUGIN_NETDEV" = "yes"; then PLUGINS="$PLUGINS plugin_netdev.o" $as_echo "#define PLUGIN_NETDEV 1" >>confdefs.h fi + +# configuration of network devices +if test "$PLUGIN_NETINFO" = "yes"; then + PLUGINS="$PLUGINS plugin_netinfo.o" + +$as_echo "#define PLUGIN_NETINFO 1" >>confdefs.h + +fi + +# POP3 if test "$PLUGIN_POP3" = "yes"; then PLUGINS="$PLUGINS plugin_pop3.o" $as_echo "#define PLUGIN_POP3 1" >>confdefs.h fi + +# PPP if test "$PLUGIN_PPP" = "yes"; then for ac_header in net/if_ppp.h do : @@ -7969,12 +9230,16 @@ $as_echo "#define PLUGIN_PPP 1" >>confdefs.h $as_echo "$as_me: WARNING: net/if_ppp.h header not found: ppp plugin disabled" >&2;} fi fi + +# /proc/stat if test "$PLUGIN_PROC_STAT" = "yes"; then PLUGINS="$PLUGINS plugin_proc_stat.o" $as_echo "#define PLUGIN_PROC_STAT 1" >>confdefs.h fi + +# python if test "$PLUGIN_PYTHON" = "yes"; then if test "$with_python" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: python support not enabled: python plugin disabled (use --with-python to enable)" >&5 @@ -7993,42 +9258,176 @@ $as_echo "#define PLUGIN_PYTHON 1" >>confdefs.h fi fi fi + +# Qnaplog +if test "$PLUGIN_QNAPLOG" = "yes"; then + for ac_header in sqlite3.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlite3_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SQLITE3_H 1 +_ACEOF + has_sqlite3_header="true" +else + has_sqlite3_header="false" +fi + +done + + if test "$has_sqlite3_header" = "true"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_initialize in -lsqlite3" >&5 +$as_echo_n "checking for sqlite3_initialize in -lsqlite3... " >&6; } +if test "${ac_cv_lib_sqlite3_sqlite3_initialize+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsqlite3 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqlite3_initialize (); +int +main () +{ +return sqlite3_initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sqlite3_sqlite3_initialize=yes +else + ac_cv_lib_sqlite3_sqlite3_initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_initialize" >&5 +$as_echo "$ac_cv_lib_sqlite3_sqlite3_initialize" >&6; } +if test "x$ac_cv_lib_sqlite3_sqlite3_initialize" = x""yes; then : + has_sqlite3_lib="true" +else + has_sqlite3_lib="false" +fi + + if test "$has_sqlite3_lib" = "true"; then + PLUGINS="$PLUGINS plugin_qnaplog.o" + PLUGINLIBS="$PLUGINLIBS -lsqlite3" + +$as_echo "#define PLUGIN_QNAPLOG 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sqlite3 lib not found: qnaplog plugin disabled" >&5 +$as_echo "$as_me: WARNING: sqlite3 lib not found: qnaplog plugin disabled" >&2;} + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sqlite3.h header not found: qnaplog plugin disabled" >&5 +$as_echo "$as_me: WARNING: sqlite3.h header not found: qnaplog plugin disabled" >&2;} + fi +fi + +# sample if test "$PLUGIN_SAMPLE" = "yes"; then PLUGINS="$PLUGINS plugin_sample.o" $as_echo "#define PLUGIN_SAMPLE 1" >>confdefs.h fi + +# SETI if test "$PLUGIN_SETI" = "yes"; then PLUGINS="$PLUGINS plugin_seti.o" $as_echo "#define PLUGIN_SETI 1" >>confdefs.h fi + +# statfs() if test "$PLUGIN_STATFS" = "yes"; then - PLUGINS="$PLUGINS plugin_statfs.o" + for ac_header in sys/vfs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/vfs.h" "ac_cv_header_sys_vfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_vfs_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_VFS_H 1 +_ACEOF + has_vfs_header="true" +else + has_vfs_header="false" +fi + +done + + if test "$has_vfs_header" = "true"; then + PLUGINS="$PLUGINS plugin_statfs.o" $as_echo "#define PLUGIN_STATFS 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: sys/vfs.h header not found: statfs plugin disabled" >&5 +$as_echo "$as_me: WARNING: sys/vfs.h header not found: statfs plugin disabled" >&2;} + fi fi + +# uname if test "$PLUGIN_UNAME" = "yes"; then PLUGINS="$PLUGINS plugin_uname.o" $as_echo "#define PLUGIN_UNAME 1" >>confdefs.h fi + +# uptime if test "$PLUGIN_UPTIME" = "yes"; then PLUGINS="$PLUGINS plugin_uptime.o" $as_echo "#define PLUGIN_UPTIME 1" >>confdefs.h fi + +if test "$PLUGIN_W1RETAP" = "yes"; then + PLUGINS="$PLUGINS plugin_w1retap.o" + +$as_echo "#define PLUGIN_W1RETAP 1" >>confdefs.h + +fi + +# WLAN if test "$PLUGIN_WIRELESS" = "yes"; then - PLUGINS="$PLUGINS plugin_wireless.o" + for ac_header in linux/wireless.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/wireless.h" "ac_cv_header_linux_wireless_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_wireless_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_WIRELESS_H 1 +_ACEOF + has_wireless_header="true" +else + has_wireless_header="false" +fi + +done + + if test "$has_wireless_header" = "true"; then + PLUGINS="$PLUGINS plugin_wireless.o" $as_echo "#define PLUGIN_WIRELESS 1" >>confdefs.h + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/wireless.h header not found: wireless plugin disabled" >&5 +$as_echo "$as_me: WARNING: linux/wireless.h header not found: wireless plugin disabled" >&2;} + fi fi + +# XMMS if test "$PLUGIN_XMMS" = "yes"; then PLUGINS="$PLUGINS plugin_xmms.o" @@ -8036,15 +9435,8 @@ $as_echo "#define PLUGIN_XMMS 1" >>confdefs.h fi -#if test "$PLUGIN_" = "yes"; then -# PLUGINS="$PLUGINS plugin_.o" -# AC_DEFINE(PLUGIN_,1,[plugin]) -#fi - if test "$PLUGINS" = ""; then - as_fn_error "You should include at least one plugin..." "$LINENO" 5 -#else -# AC_MSG_ERROR($PLUGINS) + as_fn_error $? "You should include at least one plugin..." "$LINENO" 5 fi @@ -8057,7 +9449,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$as_ac_Header+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8084,8 +9476,7 @@ fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF @@ -8327,36 +9718,7 @@ for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in sys/io.h asm/io.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in linux/parport.h linux/ppdev.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8694,8 +10056,7 @@ for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -8948,8 +10309,7 @@ for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -9333,8 +10693,7 @@ for ac_func in dup2 floor gethostbyname gettimeofday memmove memset pow putenv r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9428,6 +10787,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -9451,11 +10811,11 @@ else fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -9605,19 +10965,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -9813,7 +11173,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -9866,8 +11226,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LCD4Linux $as_me 0.10.1-RC2, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by LCD4Linux $as_me 0.11.0-SVN, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9932,11 +11292,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -LCD4Linux config.status 0.10.1-RC2 -configured by $0, generated by GNU Autoconf 2.65, +LCD4Linux config.status 0.11.0-SVN +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -9954,11 +11314,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -9980,6 +11345,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -9992,7 +11358,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -10001,7 +11367,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -10059,7 +11425,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -10097,7 +11463,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -10114,7 +11480,7 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi @@ -10128,18 +11494,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -10228,20 +11594,28 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -10269,7 +11643,7 @@ for ac_last_try in false false :; do if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -10354,7 +11728,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -10367,7 +11741,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -10395,7 +11769,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -10422,7 +11796,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -10559,22 +11933,22 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -10585,19 +11959,19 @@ which seems to be undefined. Please make sure it is defined." >&2;} $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -10747,7 +12121,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -10768,10 +12142,6172 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ----------------------------------------- +including drivers: + $DRIVERS +----------------------------------------- +including plugins: + $PLUGINS +----------------------------------------- +" >&5 +$as_echo "----------------------------------------- +including drivers: + $DRIVERS +----------------------------------------- +including plugins: + $PLUGINS +----------------------------------------- +" >&6; } + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6b' +macro_revision='1.3017' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:12650: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:12653: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:12656: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 13850 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15108: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15112: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15447: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15451: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15552: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15556: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15607: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15611: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 17991 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 18087 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + diff --git a/configure.in b/configure.in index 4142656..3e2ed42 100644 --- a/configure.in +++ b/configure.in @@ -2,13 +2,13 @@ # Process this file with autoconf to produce a configure script. -# $Id: configure.in 773 2007-02-25 12:39:09Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/configure.in $ +# $Id: configure.in 1069 2009-11-21 18:19:09Z edman007 $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/configure.in $ # LCD4Linux autoconf script # -# Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at> +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <michael@reinelt.co.at> # Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> # # This file is part of LCD4Linux. @@ -28,9 +28,9 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AC_PREREQ(2.59) -AC_INIT([LCD4Linux],[0.10.1-RC2],[lcd4linux-users@lists.sourceforge.net]) +AC_INIT([LCD4Linux],[0.11.0-SVN],[lcd4linux-users@lists.sourceforge.net]) AC_CONFIG_SRCDIR([lcd4linux.c]) -AM_INIT_AUTOMAKE([lcd4linux],0.10.1-RC2) +AM_INIT_AUTOMAKE([lcd4linux],0.11.0-SVN) AM_CONFIG_HEADER(config.h) # Checks for programs. @@ -39,6 +39,7 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG # dmalloc AM_WITH_DMALLOC @@ -65,6 +66,9 @@ fi # check for gd.h AC_CHECK_HEADERS(gd/gd.h gd.h, [has_gd="true"; break], [has_gd="false"]) +# check for sys/io.h (RouterBoard driver) +AC_CHECK_HEADERS(sys/io.h, [has_io_h="true"], [has_io_h="false"]) + # check for usb.h AC_CHECK_HEADERS(usb.h, [has_usb="true"], [has_usb="false"]) @@ -74,19 +78,33 @@ AC_CHECK_HEADERS(luise.h, [has_luise="true"], [has_luise="false"]) # check for serdisplib AC_CHECK_HEADERS(serdisplib/serdisp.h, [has_serdisplib="true"], [has_serdisplib="false"]) +# check for st2205 libs +AC_CHECK_HEADERS(st2205.h, [has_st2205="true"], [has_st2205="false"]) + +# check for vncserver libs +AC_CHECK_HEADERS(rfb/rfb.h, [has_vncserverlib="true"], [has_vncserverlib="false"]) + # check for LCD-Linux AC_CHECK_HEADERS(linux/lcd-linux.h linux/hd44780.h, [has_lcd_linux="true"], [has_lcd_linux="false"; break]) +# check for ftdi.h (ULA200) +AC_CHECK_HEADERS(ftdi.h, [has_ftdi="true"], [has_ftdi="false"; break]) + # check for python AC_MSG_CHECKING(if python support is wanted) AC_ARG_WITH(python, [ --with-python enable python support [[default=no]]], [AC_MSG_RESULT($withval)], [AC_MSG_RESULT(no)]) + if test "$with_python" = "yes"; then - sinclude(ax_python_devel.m4) - AC_PYTHON_DEVEL + sinclude(ax_python_devel.m4) + AC_PYTHON_DEVEL fi +# check for parport +#AC_CHECK_HEADERS(asm/io.h) +AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"]) + # drivers sinclude(drivers.m4) @@ -97,8 +115,6 @@ sinclude(plugins.m4) AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h]) -AC_CHECK_HEADERS(sys/io.h asm/io.h) -AC_CHECK_HEADERS(linux/parport.h linux/ppdev.h) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -135,3 +151,16 @@ AC_CHECK_FUNCS([dup2 floor gethostbyname gettimeofday memmove memset pow putenv AC_CONFIG_FILES([Makefile]) AC_OUTPUT + +AC_MSG_RESULT( +[-----------------------------------------] +[including drivers:] +[ $DRIVERS] +[-----------------------------------------] +[including plugins:] +[ $PLUGINS] +[-----------------------------------------] +) + +AC_CONFIG_MACRO_DIR([m4]) +LT_INIT diff --git a/contrib/picoLCD/lcd4linux.conf b/contrib/picoLCD/lcd4linux.conf new file mode 100644 index 0000000..4b80e53 --- /dev/null +++ b/contrib/picoLCD/lcd4linux.conf @@ -0,0 +1,629 @@ +Display picoLCD { + Driver 'picoLCDGraphic' + Size '256x64' + Update 200 + Contrast 230 + Backlight 1 + Inverted 1 + Icons 1 +} + +Variables { + tick 500 + tack 100 + minute 60000 +} + + + + + +#Plugin MySQL { +# server 'gsmlandia.com' # if none, localhost assumed +# port 3306 # if none, MySQL default assumed +# user 'lcd4linux' # if none, lcd4linux unix owner assumed +# password 'lcd4linux' # if none, empty password assumed +# database 'lcd4linux' # MUST be specified +#} + +#Plugin Pop3 { +# server1 'localhost' +# port1 110 +# user1 'user' +# password1 'pass' +#} + + +Widget OS { + class 'Text' + expression '*** '.uname('sysname').' '.uname('release').' ***' + width 20 + align 'M' + style 'bold' + speed 50 + update tick +} + + + + +Widget HDDTemp { + class 'Text' + expression 'IDE Temp'.exec ('hddtemp /dev/sda | cut -f 3 -d :', 1000) + width 14 + align 'L' + update 1000 +} + +Widget FSSpace { + class 'Text' + expression a=((statfs('/', 'bavail')*statfs('/', 'bsize'))/1024/1024);b=((statfs('/media/disk', 'bavail')*statfs('/media/disk', 'bsize'))/1024/1024);c='/ '.' '.a.'MB /media/disk/ '.b.' MB' + prefix 'Free Space:' + postfix '' + width 42 + align 'M' + #precision 0 + update 1000 +} + + +Widget BottomTicker { + class 'Text' + expression uname('sysname').' '.uname('nodename').' '.uname('release').' '.uname('machine').' '.cpuinfo('model name') + #expression strftime('%A %d/%m %H:%M:%S',time()).' '.cpuinfo('model name').' '. uptime('%d days %H:%M:%S') + #expression strftime('%A %d/%m %H:%M:%S',time()) + prefix '' + width 42 + align 'M' + speed 1000 + update tick + style 'bold' +} + +#Widget CPU { +# class 'Text' +# expression uname('machine') +# prefix 'CPU ' +# width 9 +# align 'L' +# style test::onoff(7)>0?'bold':'norm' +# update tick +#} + + +Widget CPULabel { + class 'text' + expression 'CPU:' + width 4 + align 'L' + style 'bold' +} + +Widget CPU { + class 'Text' + expression proc_stat::cpu('busy', 500) + prefix '' + postfix '% ' + width 5 + precision 0 + align 'R' + update tick +} + +Widget CPUBar { + class 'Bar' + expression proc_stat::cpu('busy', 500) + expression2 proc_stat::cpu('system', 500) + length 10 + min 1 + max 100 + direction 'E' + style 'H' + update tick +} + + +Widget RAMLabel { + class 'text' + expression 'RAM:' + width 4 + align 'L' + style 'bold' +} + + +Widget RAMTotal { + class 'Text' + expression meminfo('MemTotal')/1024 + postfix 'MB FREE' + width 11 + precision 0 + align 'L' + update tick +} + +Widget RAMFree { + class 'Text' + expression meminfo('MemFree')/1024 + prefix '' + postfix '/' + width 5 + precision 0 + align 'R' + update tick +} + +Widget IDELabel { + class 'text' + expression 'IDE:' + width 4 + align 'L' + style 'bold' +} + +Widget IDEIn { + class 'text' + # In MB/s + expression (diskstats('sda', 'read_sectors', 500))/2048 + prefix 'OUT ' + postfix 'MB' + precision 2 + align 'R' + width 10 + update tick +} + +Widget IDEOut { + class 'text' + # In MB/s + expression (diskstats('sda', 'write_sectors', 500))/2048 + prefix 'IN ' + postfix 'MB' + precision 2 + align 'R' + width 10 + update tick +} + +Widget IDEBar { + class 'Bar' + expression diskstats('sda', 'read_sectors', 500) + expression2 diskstats('sda', 'write_sectors', 500) + length 14 + direction 'E' + style 'H' + update tick +} + +Widget ETHLabel { + class 'text' + expression 'ETH:' + width 4 + align 'L' + style 'bold' +} + + +Widget ETHIn { + class 'Text' + expression (netdev('eth0', 'Rx_bytes', 500))/1024 + prefix 'OUT' + postfix 'KB' + width 9 + precision 0 + align 'R' + update tick +} + +Widget ETHOut { + class 'Text' + expression (netdev('eth0', 'Tx_bytes', 500))/1024 + prefix 'IN' + postfix 'KB' + width 9 + precision 0 + align 'R' + update tick +} + +Widget ETHBar { + class 'Bar' + expression netdev('eth0', 'Rx_bytes', 500) + expression2 netdev('eth0', 'Tx_bytes', 500) + length 14 + direction 'E' + style 'H' + update tick +} + +Widget Time { + class 'Text' + expression strftime('%a,%d/%m %H:%M:%S',time()) + width 20 + align 'Left' + update 1000 +} + +Widget Uptime { + class 'Text' + expression uptime('%d d %H:%M:%S') + width 21 + align 'R' + prefix 'Uptime ' + update 1000 +} + + +#Widget Disk { +# class 'Text' +# # disk.[rw]blk return blocks, we assume a blocksize of 512 +# # to get the number in kB/s we would do blk*512/1024, which is blk/2 +# # expression (proc_stat::disk('.*', 'rblk', 500)+proc_stat::disk('.*', 'wblk', 500))/2 +# # with kernel 2.6, disk_io disappeared from /proc/stat but moved to /proc/diskstat +# # therefore you have to use another function called 'diskstats': +# expression diskstats('sda', 'read_sectors', 500) + diskstats('sda', 'write_sectors', 500) +# prefix '' +# postfix ' ' +# width 7 +# precision 0 +# align 'R' +# update tick +#} + +#Widget DiskBar { +# class 'Bar' +# #expression proc_stat::disk('.*', 'rblk', 500) +# #expression2 proc_stat::disk('.*', 'wblk', 500) +# # for kernel 2.6: +# expression diskstats('sda', 'read_sectors', 500) +# expression2 diskstats('sda', 'write_sectors', 500) +# length 14 +# direction 'E' +# update tack +#} + + +Widget PPP { + class 'Text' + expression (ppp('Rx:0', 500)+ppp('Tx:0', 500)) + prefix 'PPP' + width 9 + precision 0 + align 'R' + update tick +} + +Widget Temp { + class 'Text' + expression i2c_sensors('temp_input3')*1.0324-67 + prefix 'Temp' + width 9 + precision 1 + align 'R' + update tick +} + +Widget TempBar { + class 'Bar' + expression i2c_sensors('temp_input3')*1.0324-67 + min 40 + max 80 + length 10 + direction 'E' + update tack +} + +Widget MySQLtest1 { + class 'Text' + expression MySQL::query('SELECT id FROM table1') + width 20 + align 'R' + prefix 'MySQL test:' + update minute +} + +Widget MySQLtest2 { + class 'Text' + expression MySQL::status() + width 20 + align 'M' + prefix 'Status: ' + update minute +} + + + + +# Icons + +Widget Heartbeat { + class 'Icon' + speed 800 + Bitmap { + Row1 '.....|.....' + Row2 '.*.*.|.*.*.' + Row3 '*****|*.*.*' + Row4 '*****|*...*' + Row5 '.***.|.*.*.' + Row6 '.***.|.*.*.' + Row7 '..*..|..*..' + Row8 '.....|.....' + } +} + +Widget EKG { + class 'Icon' + speed 50 + Bitmap { + Row1 '.....|.....|.....|.....|.....|.....|.....|.....' + Row2 '.....|....*|...*.|..*..|.*...|*....|.....|.....' + Row3 '.....|....*|...*.|..*..|.*...|*....|.....|.....' + Row4 '.....|....*|...**|..**.|.**..|**...|*....|.....' + Row5 '.....|....*|...**|..**.|.**..|**...|*....|.....' + Row6 '.....|....*|...*.|..*.*|.*.*.|*.*..|.*...|*....' + Row7 '*****|*****|****.|***..|**..*|*..**|..***|.****' + Row8 '.....|.....|.....|.....|.....|.....|.....|.....' + } +} +Widget Karo { + class 'Icon' + speed 200 + Bitmap { + Row1 '.....|.....|.....|.....|..*..|.....|.....|.....' + Row2 '.....|.....|.....|..*..|.*.*.|..*..|.....|.....' + Row3 '.....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....' + Row4 '.....|..*..|.*.*.|*...*|.....|*...*|.*.*.|..*..' + Row5 '.....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....' + Row6 '.....|.....|.....|..*..|.*.*.|..*..|.....|.....' + Row7 '.....|.....|.....|.....|..*..|.....|.....|.....' + Row8 '.....|.....|.....|.....|.....|.....|.....|.....' + } +} +Widget Heart { + class 'Icon' + speed 250 + Bitmap { + Row1 '.....|.....|.....|.....|.....|.....' + Row2 '.*.*.|.....|.*.*.|.....|.....|.....' + Row3 '*****|.*.*.|*****|.*.*.|.*.*.|.*.*.' + Row4 '*****|.***.|*****|.***.|.***.|.***.' + Row5 '.***.|.***.|.***.|.***.|.***.|.***.' + Row6 '.***.|..*..|.***.|..*..|..*..|..*..' + Row7 '..*..|.....|..*..|.....|.....|.....' + Row8 '.....|.....|.....|.....|.....|.....' + } +} +Widget Blob { + class 'Icon' + speed 250 + Bitmap { + Row1 '.....|.....|.....' + Row2 '.....|.....|.***.' + Row3 '.....|.***.|*...*' + Row4 '..*..|.*.*.|*...*' + Row5 '.....|.***.|*...*' + Row6 '.....|.....|.***.' + Row7 '.....|.....|.....' + Row8 '.....|.....|.....' + } +} +Widget Wave { + class 'Icon' + speed 100 + Bitmap { + Row1 '..**.|.**..|**...|*....|.....|.....|.....|.....|....*|...**' + Row2 '.*..*|*..*.|..*..|.*...|*....|.....|.....|....*|...*.|..*..' + Row3 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...' + Row4 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...' + Row5 '*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...' + Row6 '.....|.....|....*|...*.|..*..|.*..*|*..*.|..*..|.*...|*....' + Row7 '.....|.....|.....|....*|...**|..**.|.**..|**...|*....|.....' + Row8 '.....|.....|.....|.....|.....|.....|.....|.....|.....|.....' + } +} +Widget Squirrel { + class 'Icon' + speed 100 + Bitmap { + Row1 '.....|.....|.....|.....|.....|.....' + Row2 '.....|.....|.....|.....|.....|.....' + Row3 '.....|.....|.....|.....|.....|.....' + Row4 '**...|.**..|..**.|...**|....*|.....' + Row5 '*****|*****|*****|*****|*****|*****' + Row6 '...**|..**.|.**..|**...|*....|.....' + Row7 '.....|.....|.....|.....|.....|.....' + Row8 '.....|.....|.....|.....|.....|.....' + } +} + +Widget IOIcon { + class 'Icon' + speed 100 + Bitmap { + Row1 '.....|.....|.....|.....|.....|.....' + Row2 '...*.|.....|...*.|.....|...*.|.....' + Row3 '*****|.....|*****|.....|*****|.....' + Row4 '...*.|.....|...*.|.....|...*.|.....' + Row5 '.*...|.....|.*...|.....|.*...|.....' + Row6 '*****|.....|*****|.....|*****|.....' + Row7 '.*...|.....|.*...|.....|.*...|.....' + Row8 '.....|.....|.....|.....|.....|.....' + } +} + +Widget Lightning { + class 'icon' + speed 100 + visible cpu('busy', 500)-50 + bitmap { + row1 '...***' + row2 '..***.' + row3 '.***..' + row4 '.****.' + row5 '..**..' + row6 '.**...' + row7 '**....' + row8 '*.....' + } +} + +Widget Rain { + class 'icon' + speed 200 + bitmap { + row1 '...*.|.....|.....|.*...|....*|..*..|.....|*....' + row2 '*....|...*.|.....|.....|.*...|....*|..*..|.....' + row3 '.....|*....|...*.|.....|.....|.*...|....*|..*..' + row4 '..*..|.....|*....|...*.|.....|.....|.*...|....*' + row5 '....*|..*..|.....|*....|...*.|.....|.....|.*...' + row6 '.*...|....*|..*..|.....|*....|...*.|.....|.....' + row7 '.....|.*...|....*|..*..|.....|*....|...*.|.....' + row8 '.....|.....|.*...|....*|..*..|.....|*....|...*.' + } +} + + +Widget GPO_Val1 { + class 'Text' + expression LCD::GPO(1) + prefix 'GPO#1' + width 10 + precision 0 + align 'R' + update tick +} + +Widget GPI_Val1 { + class 'Text' + expression LCD::GPI(1) + prefix 'GPI#1' + width 10 + precision 0 + align 'R' + update tick +} + +Widget GPO_Val4 { + class 'Text' + expression LCD::GPO(4) + prefix 'GPO#4' + width 10 + precision 0 + align 'R' + update tick +} + +Widget GPO_Test1 { + class 'GPO' + expression 255*test::onoff(1) + update 300 +} + +Widget GPO_Test255 { + class 'GPO' + expression test::bar(0,255, 0, 1) + update 100 +} + +Widget GPO_picolcd { + class 'GPO' + expression test::onoff(1) + update 300 +} + +Widget CpuImage { + class 'Image' + file '/etc/picoLCDGraphic/Images/cpu_a.png' + update 1000 + visible 1 + inverted 0 + reload 0 +} + +Widget HddImage { + class 'Image' + file '/etc/picoLCDGraphic/Images/hdd_a.png' + update 1000 + visible 1 + inverted 0 + reload 0 +} + +Widget RamImage { + class 'Image' + file '/etc/picoLCDGraphic/Images/ram_a.png' + update 1000 + visible 1 + inverted 0 + reload 0 +} + +Widget NetImage { + class 'Image' + file '/etc/picoLCDGraphic/Images/net_a.png' + update 1000 + visible 1 + inverted 0 + reload 0 +} + +Widget FanImage { + class 'Image' + file '/etc/picoLCDGraphic/Images/fan_a.png' + update 1000 + visible 1 + inverted 0 + reload 0 +} + + +Layout picoLCD { +# Layer 1 { +# X0.Y0 'BandwidthImage' +# } +# Layer 1 { +# X0.Y0 'CpuImage' +# } + Row1 { + Col1 'CPULabel' + Col6 'CPU' + Col11 'CPUBar' + Col21 'RAMLabel' + Col26 'RAMFree' + Col31 'RAMTotal' + } + Row2 { + Col1 'IDELabel' + Col6 'IDEIn' + Col17 'IDEOut' + Col28 'IDEBar' + } + Row3 { + Col1 'FSSpace' + } + Row4 { + Col1 'ETHLabel' + Col6 'ETHIn' + Col17 'ETHOut' + Col28 'ETHBar' + } + Row7 { + Col1 'Time' + Col22 'Uptime' + } + + Row8 { + Col1 'Uptime' + Col1 'BottomTicker' + } + #Layer 2 { + # X0.Y0 'ImageTest' + #} + +#GPO1 'GPO_picolcd' +#GPO2 'GPO_picolcd' +#GPO8 'GPO_picolcd' +} + +Display 'picoLCD' +Layout 'picoLCD' diff --git a/contrib/picoLCD/lcd4linux.conf.mrtg b/contrib/picoLCD/lcd4linux.conf.mrtg new file mode 100644 index 0000000..b74506b --- /dev/null +++ b/contrib/picoLCD/lcd4linux.conf.mrtg @@ -0,0 +1,92 @@ +Display picoLCD { + Driver 'picoLCDGraphic' + Size '256x64' + Update 200 + Contrast 230 + Backlight 1 + Inverted 1 + Icons 1 +} + + +Variables { + n 0 + nkey 0 + currentImage 'http://192.168.12.113/mrtg/127.0.0.1_2-month.png' + mrtgDayImageURL 'http://192.168.12.113/mrtg/127.0.0.1_2-day.png' + mrtgWeekImageURL 'http://192.168.12.113/mrtg/127.0.0.1_2-week.png' + #currentFile '/tmp/127.0.0.1_2-day.png' + currentFile ' ' + tick 500 + tack 100 + minute 60000 +} + +Widget TimerW { + class 'Timer' + expression n=LCD::GPI(1);nkey=n!=0?n:nkey + active 1 + update 100 +} + + +# export PYTHONPATH which should point to the scripts usually /etc/picoLCDGraphic/Scripts +Widget MRTGMinute { + class 'Text' + expression currentFile=python::exec('mrtg', 'saveimage', currentImage) + width 42 + #update minute + update 100 +} + +Widget test { + class 'Text' + expression currentFile + width 42 + #update minute + update 100 +} + +# Python script will save the filename as taken from the URL above in the /etc/picoLCDGraphic/Images path +# Modify mrtg.py to save in another path and also change file tag below +Widget BandwidthImage { + class 'Image' + file currentFile + visible 1 + inverted 0 + reload 1 + #update minute + update 100 + #update tick +} + +Widget GPO_kup { + class 'GPO' + expression currentImage=nkey==5?mrtgDayImageURL:currentImage;nkey==5?1:0 + update 300 +} + + Widget GPO_kdown { + class 'GPO' + expression currentImage=nkey==7?mrtgWeekImageURL:currentImage;nkey==7?1:0 + update 300 +} + + +Layout picoLCD { + Row1 { + Col1 'MRTGMinute' + } + + Layer 1 { + X0.Y0 'BandwidthImage' + } + + Timer1 'TimerW' + GPO2 'GPO_kup' + GPO3 'GPO_kdown' + +} + +Display 'picoLCD' +Layout 'picoLCD' diff --git a/contrib/picoLCD/lcd4linux.conf.rss b/contrib/picoLCD/lcd4linux.conf.rss new file mode 100644 index 0000000..95c58a8 --- /dev/null +++ b/contrib/picoLCD/lcd4linux.conf.rss @@ -0,0 +1,143 @@ +Display picoLCD { + Driver 'picoLCDGraphic' + Size '256x64' + Update 200 + Contrast 230 + Backlight 1 + Inverted 1 + Icons 1 +} + + +Variables { + n 0 + nkey 0 + page 0 + title 0 + rss1 'http://slashdot.org/slashdot.rdf' + rss2 'http://www.engadget.com/rss.xml' + rss 'http://www.linuxsecurity.com/static-content/debian.rss' + tick 500 + tack 100 + minute 60000 +} + +Widget TimerW { + class 'Timer' + expression n=LCD::GPI(1);nkey=n + active 1 + update 100 +} + + +# export PYTHONPATH which should point to the scripts usually /etc/picoLCDGraphic/Scripts + +Widget RSSFeedInfo { + class 'Text' + #expression title=1+page;param='!'.title;python::exec('rsstimer', 'getfeed', rss.param) + expression rss.' page:'.page + width 42 + align 'L' + style 'bold' + #update minute + update 500 +} + +Widget RSSFeedTitle1 { + class 'Text' + expression title=1+page;param='!'.title;python::exec('rsstimer', 'getfeed', rss.param) + width 42 + prefix '>' + align 'L' + #update minute + update 500 +} + + + +Widget RSSFeedTitle2 { + class 'Text' + expression title=2+page;param='!'.title;python::exec('rsstimer', 'getfeed', rss.param) + width 42 + prefix '>' + align 'L' + #update minute + update 500 +} + + +Widget RSSFeedTitle3 { + class 'Text' + expression title=3+page;param='!'.title;python::exec('rsstimer', 'getfeed', rss.param) + width 42 + prefix '>' + align 'L' + #update minute + update 500 +} + +Widget RSSFeedTitle4 { + class 'Text' + expression title=4+page;param='!'.title;python::exec('rsstimer', 'getfeed', rss.param) + width 42 + prefix '>' + align 'L' + #update minute + update 500 +} + + +Widget GPO_kback { + class 'GPO' + expression rss=nkey==1?rss1:rss + update 100 +} + +Widget GPO_khome { + class 'GPO' + expression rss=nkey==2?rss2:rss + update 100 +} + + +Widget GPO_kup { + class 'GPO' + expression page=nkey==5?page-1:page#;nkey==5?1:0 + update 100 +} + + Widget GPO_kdown { + class 'GPO' + expression page=nkey==7?page+1:page#;nkey==7?1:0 + update 100 +} + + +Layout picoLCD { + Row1 { + Col1 'RSSFeedInfo' + } + Row2 { + Col1 'RSSFeedTitle1' + } + Row4 { + Col1 'RSSFeedTitle2' + } + Row6 { + Col1 'RSSFeedTitle3' + } + Row8 { + Col1 'RSSFeedTitle4' + } + + Timer1 'TimerW' + + GPO1 'GPO_kback' + GPO2 'GPO_khome' + GPO3 'GPO_kup' + GPO4 'GPO_kdown' + +} + +Display 'picoLCD' +Layout 'picoLCD' diff --git a/contrib/picoLCD/lcd4linux.conf.rss.timers b/contrib/picoLCD/lcd4linux.conf.rss.timers new file mode 100644 index 0000000..8c9f32e --- /dev/null +++ b/contrib/picoLCD/lcd4linux.conf.rss.timers @@ -0,0 +1,128 @@ +Display picoLCD { + Driver 'picoLCDGraphic' + Size '256x64' + Update 200 + Contrast 230 + Backlight 1 + Inverted 1 + Icons 1 +} + + +Variables { + n 0 + nkey 0 + page 0 + t 0 + p ' ' + r1 ' ' + r2 ' ' + r3 ' ' + r4 ' ' + rss 'http://slashdot.org/slashdot.rdf' + + tick 500 + tack 100 + minute 60000 + #rssRefresh minute + rssRefresh 1000 +} + +Widget TimerW { + class 'Timer' + expression n=LCD::GPI(1);nkey=n!=0?n:nkey + active 1 + update 100 +} + +Widget TimerRSS { + class 'Timer' + expression t=1+page;p='!'.t;r1=python::exec('rss', 'pf', rss.p);t=2+page;p='!'.t;r2=python::exec('rss', 'pf', rss.p);t=3+page;p='!'.t;r3=python::exec('rss', 'pf', rss.p);t=4+page;p='!'.t;r4=python::exec('rss', 'pf', rss.p);rssRefresh=1000 + active 1 + update rssRefresh +} + + +# export PYTHONPATH which should point to the scripts usually /etc/picoLCDGraphic/Scripts +Widget RSSFeedTitle1 { + class 'Text' + #expression title=1+page;param='!'.title;python::exec('rss', 'parsefeed', slashdotRSS.param) + expression r1 + width 42 + prefix '- ' + align 'L' + #update minute + update 300 +} + + + +Widget RSSFeedTitle2 { + class 'Text' + expression r2 + width 42 + prefix '- ' + align 'L' + #update minute + update 300 +} + + +Widget RSSFeedTitle3 { + class 'Text' + expression r3 + width 42 + prefix '- ' + align 'L' + #update minute + update 300 +} + +Widget RSSFeedTitle4 { + class 'Text' + expression r4 + width 42 + prefix '- ' + align 'L' + #update minute + update 300 +} + + +Widget GPO_kup { + class 'GPO' + expression page=nkey==5?0:page;nkey==5?1:0#;rssRefresh=nkey==5?100:rssRefresh + update 100 +} + + Widget GPO_kdown { + class 'GPO' + expression page=nkey==7?4:page;nkey==7?1:0#;rssRefresh=nkey==7?100:rssRefresh + update 100 +} + + +Layout picoLCD { + Row1 { + Col1 'RSSFeedTitle1' + } + Row3 { + Col1 'RSSFeedTitle2' + } + Row5 { + Col1 'RSSFeedTitle3' + } + Row7 { + Col1 'RSSFeedTitle4' + } + + Timer1 'TimerW' + Timer2 'TimerRSS' + + GPO2 'GPO_kup' + GPO3 'GPO_kdown' + +} + +Display 'picoLCD' +Layout 'picoLCD' diff --git a/contrib/picoLCD/mrtg.py b/contrib/picoLCD/mrtg.py new file mode 100644 index 0000000..e501ca9 --- /dev/null +++ b/contrib/picoLCD/mrtg.py @@ -0,0 +1,21 @@ +import urllib +import shutil + +download_path = "/tmp/" + +def saveimage(imageurl): + filename = imageurl.split('/')[-1] + tmpname = filename + ".tmp" + try: + urllib.urlretrieve(imageurl, download_path + tmpname) + except IOError: + return "Error downloading file" + else: + shutil.move(download_path + tmpname, download_path + filename) + return download_path + filename + + +#saveimage("http://www.switch.ch/network/operation/statistics/geant2-day.png") +#saveimage("http://192.168.12.113/mrtg/127.0.0.1_2-day.png") + + diff --git a/contrib/picoLCD/rsstimer.py b/contrib/picoLCD/rsstimer.py new file mode 100644 index 0000000..5da92ea --- /dev/null +++ b/contrib/picoLCD/rsstimer.py @@ -0,0 +1,92 @@ +import feedparser +import time +import datetime +import tempfile +import linecache + +# temporary file used to store rss entries +filename = "/tmp/rsstimer.tmp" +# interval in seconds between rss updates +updateinterval = 60 + +# lcd4linux permits only 1 parameter passed to the function +# we send the rss title id with the ! spacer +def getfeed(rssfeed): + print rssfeed + idx = 0 + feed = rssfeed.split('!')[0] + idx = int(rssfeed.split('!')[-1]) + if (idx <= 0): idx = 1; + + oldfeed = fgetfeed() + + if (oldfeed != feed): + lastupdate = 0 + print "Feed changed refresing" + else: + lastupdate = fgetseconds() + + if (lastupdate <= 0): + saverss(feed) + else: + now = getseconds() + delta = now - lastupdate + if (delta > updateinterval): + print "Last update: " + str(delta) + " seconds ago. Updating the rss entries." + saverss(feed) + # first line in the file is the timestamp second is the feed url + output = linecache.getline(filename, idx + 2) + print output + return output + +def getseconds(): + ts = datetime.datetime.now() + return time.mktime(ts.timetuple()) + +def fgetseconds(): + try: + f = open(filename, "r") + except IOError: + print "Cannot get timestamp from file" + return 0 + else: + return float(f.readline()) + +def fgetfeed(): + try: + f = open(filename, "r") + except IOError: + print "Cannot get feed from file" + return ' ' + else: + # skip first line + f.readline() + return f.readline().rstrip("\n") + + +def saverss(rssfeed): + linecache.clearcache() + f = open(filename, "w") + # save timestamp + f.write(str(getseconds())) + f.write("\n") + # save feed url + f.write(rssfeed) + f.write("\n") + print "Downloading the rss feed from: " + rssfeed + feed = feedparser.parse(rssfeed) + for entry in feed.entries: + f.write(entry.title) + f.write("\n") + f.close + print "Done" + +def printrss(): + f = open(filename, "r") + f.readline() + for line in f: + print line + +#print getfeed("http://slashdot.org/slashdot.rdf!5") +print getfeed("http://www.linux.com/feed?theme=rss!1") + @@ -1,5 +1,5 @@ dnl $Id: curses.m4 729 2007-01-14 13:44:38Z michael $ -dnl $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/curses.m4 $ +dnl $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/curses.m4 $ dnl Curses detection: Munged from Midnight Commander's configure.in diff --git a/debian/changelog b/debian/changelog index ea91e9d..446ca1c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lcd4linux (0.11.0~svn1143-1) UNRELEASED; urgency=low + + * New upstream snapshot + + -- Reinhard Tartler <siretart@tauware.de> Wed, 27 Apr 2011 19:28:45 +0200 + lcd4linux (0.10.1~rc2-4) unstable; urgency=low * avoid LOCALMODLIBS for CFLAGS, only causes FTBFS in python 2.6 @@ -1,9 +1,9 @@ -/* $Id: debug.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/debug.c $ +/* $Id: debug.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/debug.c $ * * debug() and error() functions * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: debug.h 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/debug.h $ +/* $Id: debug.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/debug.h $ * * debug messages * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-07-09.11 +scriptversion=2007-03-29.01 -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -91,7 +92,20 @@ gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? if test $stat -eq 0; then : else @@ -201,34 +215,39 @@ aix) # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -M fi stat=$? - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - if test $stat -eq 0; then : else - rm -f "$tmpdepfile" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done if test -f "$tmpdepfile"; then - outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -276,6 +295,46 @@ icc) rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. @@ -288,13 +347,13 @@ tru64) if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to + # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and + # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is @@ -1,10 +1,10 @@ -dnl $Id: drivers.m4 792 2007-04-30 05:02:57Z michael $ -dnl $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drivers.m4 $ +dnl $Id: drivers.m4 1137 2011-01-02 00:39:10Z michael $ +dnl $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drivers.m4 $ dnl LCD4Linux Drivers conf part dnl -dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at> +dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <michael@reinelt.co.at> dnl Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> dnl dnl This file is part of LCD4Linux. @@ -25,20 +25,22 @@ dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AC_MSG_CHECKING([which drivers to compile]) AC_ARG_WITH( - drivers, + drivers, [ --with-drivers=<list> compile driver for displays in <list>,] - [ drivers may be separated with commas,] - [ 'all' (default) compiles all available drivers,] - [ drivers may be excluded with 'all,!<driver>',] - [ (try 'all,\!<driver>' if your shell complains...)] - [ possible drivers are:] - [ BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux,] - [ G15, HD44780, LCD2USB LCDLinux, LCDTerm, LPH7508,] - [ LUIse, M50530, MatrixOrbital, MilfordInstruments,] - [ Noritake, NULL, PNG, PPM, picoLCD, RouterBoard, Sample,] - [ serdisplib, SimpleLCD, T6963, Trefon, USBLCD,] - [ USBHUB, WincorNixdorf, X11], - drivers=$withval, + [ drivers may be separated with commas,] + [ 'all' (default) compiles all available drivers,] + [ drivers may be excluded with 'all,!<driver>',] + [ (try 'all,\!<driver>' if your shell complains...)] + [ possible drivers are:] + [ ASTUSB, BeckmannEgle, BWCT, CrystalFontz, Curses, Cwlinux, D4D,] + [ EA232Graphic, EFN, FW8888, G15, GLCD2USB, HD44780, HD44780-I2C,] + [ IRLCD, LCD2USB, LCDLinux, LEDMatrix, LCDTerm, LPH7508, LUIse,] + [ LW_ABP, M50530, MatrixOrbital, MatrixOrbitalGX,] + [ MilfordInstruments, Noritake, NULL, Pertelian, PHAnderson,] + [ PICGraphic, picoLCD, picoLCDGraphic, PNG, PPM, RouterBoard,] + [ Sample, serdisplib, ShuttleVFD, SimpleLCD, st2205, T6963,] + [ Trefon, ULA200, USBHUB, USBLCD, VNC, WincorNixdorf, X11], + drivers=$withval, drivers=all ) @@ -46,51 +48,71 @@ drivers=`echo $drivers|sed 's/,/ /g'` for driver in $drivers; do - case $driver in - !*) + case $driver in + !*) val="no" driver=`echo $driver|cut -c 2-` ;; - *) + *) val="yes" ;; esac - + case "$driver" in all) + ASTUSB="yes" BECKMANNEGLE="yes" BWCT="yes" CRYSTALFONTZ="yes" CURSES="yes" CWLINUX="yes" + D4D="yes" EA232graphic="yes" + EFN="yes" + FW8888="yes" G15="yes" + GLCD2USB="yes" HD44780="yes" + HD44780_I2C="yes" + IRLCD="yes" LCD2USB="yes" LCDLINUX="yes" LCDTERM="yes" LEDMATRIX="yes" LPH7508="yes" LUISE="yes" + LW_ABP="yes" M50530="yes" MATRIXORBITAL="yes" + MATRIXORBITALGX="yes" MILINST="yes" - NORITAKE="yes" - NULL="yes" - picoLCD="yes" + NORITAKE="yes" + NULL="yes" + PERTELIAN="yes" + PHANDERSON="yes" + PICGRAPHIC="yes" + PICOLCD="yes" + PICOLCDGRAPHIC="yes" PNG="yes" PPM="yes" ROUTERBOARD="yes" SAMPLE="yes" + ST2205="yes" SERDISPLIB="yes" + SHUTTLEVFD="yes" SIMPLELCD="yes" T6963="yes" Trefon="yes" + ULA200="yes" USBHUB="yes" USBLCD="yes" + VNC="yes" WINCORNIXDORF="yes" X11="yes" ;; + ASTUSB) + ASTUSB=$val + ;; BeckmannEgle) BECKMANNEGLE=$val ;; @@ -106,18 +128,33 @@ for driver in $drivers; do Cwlinux) CWLINUX=$val ;; + D4D) + D4D=$val + ;; EA232graphic) EA232graphic=$val ;; + EFN) + EFN=$val + ;; + FW8888) + FW8888=$val + ;; G15) G15=$val ;; + GLCD2USB) + GLCD2USB=$val + ;; HD44780) HD44780=$val ;; HD44780-I2C) HD44780_I2C=$val ;; + IRLCD) + IRLCD=$val + ;; LCD2USB) LCD2USB=$val ;; @@ -136,12 +173,18 @@ for driver in $drivers; do LUIse) LUISE=$val ;; + LW_ABP) + LW_ABP=$val + ;; M50530) M50530=$val ;; MatrixOrbital) MATRIXORBITAL=$val ;; + MatrixOrbitalGX) + MATRIXORBITALGX=$val + ;; MilfordInstruments) MILINST=$val ;; @@ -151,9 +194,21 @@ for driver in $drivers; do NULL) NULL=$val; ;; + Pertelian) + PERTELIAN=$val + ;; + PHAnderson) + PHANDERSON=$val + ;; + PICGraphic) + PICGRAPHIC=$val + ;; picoLCD) - picoLCD=$val - ;; + PICOLCD=$val + ;; + picoLCDGraphic) + PICOLCDGRAPHIC=$val + ;; PNG) PNG=$val ;; @@ -169,28 +224,40 @@ for driver in $drivers; do serdisplib) SERDISPLIB=$val; ;; + ShuttleVFD) + SHUTTLEVFD=$val + ;; SimpleLCD) SIMPLELCD=$val ;; + st2205) + ST2205=$val + ;; T6963) T6963=$val ;; Trefon) Trefon=$val ;; + ULA200) + ULA200=$val + ;; USBHUB) USBHUB=$val ;; USBLCD) USBLCD=$val ;; + VNC) + VNC=$val + ;; WincorNixdorf) WINCORNIXDORF=$val ;; X11) X11=$val ;; - *) + *) AC_MSG_ERROR([Unknown driver '$driver']) ;; esac @@ -213,6 +280,19 @@ KEYPAD="no" # generic libraries LIBUSB="no" +LIBFTDI="no" + +if test "$ASTUSB" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_ASTUSB.o" + LIBUSB="yes" + AC_DEFINE(WITH_ASTUSB,1,[ASTUSB driver]) + else + AC_MSG_WARN(usb.h not found: ASTUSB driver disabled) + fi +fi if test "$BECKMANNEGLE" = "yes"; then TEXT="yes" @@ -252,7 +332,7 @@ if test "$CURSES" = "yes"; then AC_DEFINE(WITH_CURSES,1,[Curses driver]) else AC_MSG_WARN(curses not found: Curses driver disabled) - fi + fi fi if test "$CWLINUX" = "yes"; then @@ -264,6 +344,14 @@ if test "$CWLINUX" = "yes"; then AC_DEFINE(WITH_CWLINUX,1,[CwLinux driver]) fi +if test "$D4D" = "yes"; then + TEXT="yes" + GRAPHIC="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_D4D.o" + AC_DEFINE(WITH_D4D,1,[D4D driver]) +fi + if test "$EA232graphic" = "yes"; then GRAPHIC="yes" SERIAL="yes" @@ -272,6 +360,20 @@ if test "$EA232graphic" = "yes"; then AC_DEFINE(WITH_EA232graphic,1,[Electronic Assembly RS232 graphic driver]) fi +if test "$EFN" = "yes"; then + TEXT="yes" + DRIVERS="$DRIVERS drv_EFN.o" + AC_DEFINE(WITH_EFN,1,[Driver for EFN LED modules and EUG 100 ethernet to serial converter]) +fi + + +if test "$FW8888" = "yes"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_FW8888.o" + AC_DEFINE(WITH_FW8888,1,[Allnet FW8888 driver]) +fi + if test "$G15" = "yes"; then if test "$has_usb" = "true"; then GRAPHIC="yes" @@ -283,13 +385,16 @@ if test "$G15" = "yes"; then fi fi -if test "$HD44780" = "yes"; then - TEXT="yes" - PARPORT="yes" - I2C="yes" - GPIO="yes" - DRIVERS="$DRIVERS drv_HD44780.o" - AC_DEFINE(WITH_HD44780,1,[HD44780 driver]) +if test "$GLCD2USB" = "yes"; then + if test "$has_usb" = "true"; then + GRAPHIC="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_GLCD2USB.o" + LIBUSB="yes" + AC_DEFINE(WITH_GLCD2USB,1,[GLCD2USB driver]) + else + AC_MSG_WARN(usb.h not found: GLCD2USB driver disabled) + fi fi if test "$HD44780_I2C" = "yes"; then @@ -300,6 +405,37 @@ if test "$HD44780_I2C" = "yes"; then AC_DEFINE(WITH_HD44780,1,[HD44780 driver]) fi +if test "$HD44780" = "yes"; then + if test "$HD44780_I2C" != "yes"; then + if test "$has_parport" = "true"; then + TEXT="yes" + PARPORT="yes" + I2C="yes" + GPIO="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_HD44780.o" + AC_DEFINE(WITH_HD44780,1,[HD44780 driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: HD44780 driver disabled) + fi + else + HD44780="no" + AC_MSG_WARN(HD44780-i2c enabled disabling HD44780) + fi +fi + +if test "$IRLCD" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_IRLCD.o" + LIBUSB="yes" + AC_DEFINE(WITH_IRLCD,1,[IRLCD driver]) + else + AC_MSG_WARN(usb.h not found: IRLCD driver disabled) + fi +fi + if test "$LCD2USB" = "yes"; then if test "$has_usb" = "true"; then TEXT="yes" @@ -320,7 +456,7 @@ if test "$LCDLINUX" = "yes"; then AC_DEFINE(WITH_LCDLINUX,1,[LCD-Linux driver]) else AC_MSG_WARN(linux/lcd-linux.h or linux/hd44780.h not found: LCD-Linux driver disabled) - fi + fi fi if test "$LCDTERM" = "yes"; then @@ -337,11 +473,15 @@ if test "$LEDMATRIX" = "yes"; then fi if test "$LPH7508" = "yes"; then - GRAPHIC="yes" - GPIO="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_LPH7508.o" - AC_DEFINE(WITH_LPH7508,1,[LPH7508 driver]) + if test "$has_parport" = "true"; then + GRAPHIC="yes" + GPIO="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_LPH7508.o" + AC_DEFINE(WITH_LPH7508,1,[LPH7508 driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: LPH7508 driver disabled) + fi fi if test "$LUISE" = "yes"; then @@ -355,12 +495,24 @@ if test "$LUISE" = "yes"; then fi fi -if test "$M50530" = "yes"; then +if test "$LW_ABP" = "yes"; then TEXT="yes" - GPIO="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_M50530.o" - AC_DEFINE(WITH_M50530,1,[M50530 driver]) + SERIAL="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_LW_ABP.o" + AC_DEFINE(WITH_LW_ABP,1,[LW ABP driver]) +fi + +if test "$M50530" = "yes"; then + if test "$has_parport" = "true"; then + TEXT="yes" + GPIO="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_M50530.o" + AC_DEFINE(WITH_M50530,1,[M50530 driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: M50530 driver disabled) + fi fi if test "$MATRIXORBITAL" = "yes"; then @@ -371,6 +523,18 @@ if test "$MATRIXORBITAL" = "yes"; then AC_DEFINE(WITH_MATRIXORBITAL,1,[MatrixOrbital driver]) fi +if test "$MATRIXORBITALGX" = "yes"; then + if test "$has_usb" = "true"; then + GRAPHIC="yes" + SERIAL="yes" + LIBUSB="yes" + DRIVERS="$DRIVERS drv_MatrixOrbitalGX.o" + AC_DEFINE(WITH_MATRIXORBITALGX,1,[MatrixOrbitalGX driver]) + else + AC_MSG_WARN(usb.h not found: MatrixOrbitalGX driver disabled) + fi +fi + if test "$MILINST" = "yes"; then TEXT="yes" SERIAL="yes" @@ -379,11 +543,15 @@ if test "$MILINST" = "yes"; then fi if test "$NORITAKE" = "yes"; then - TEXT="yes" - GRAPHIC="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_Noritake.o" - AC_DEFINE(WITH_NORITAKE,1,[Noritake driver]) + if test "$has_parport" = "true"; then + TEXT="yes" + GRAPHIC="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_Noritake.o" + AC_DEFINE(WITH_NORITAKE,1,[Noritake driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: NORITAKE driver disabled) + fi fi if test "$NULL" = "yes"; then @@ -392,19 +560,57 @@ if test "$NULL" = "yes"; then AC_DEFINE(WITH_NULL,1,[NULL driver]) fi -if test "$picoLCD" = "yes"; then +if test "$PERTELIAN" = "yes"; then + # select either text or graphics mode + TEXT="yes" + # select bus: serial (including USB), parallel or i2c + SERIAL="yes" + DRIVERS="$DRIVERS drv_Pertelian.o" + AC_DEFINE(WITH_PERTELIAN,1,[Pertelian driver]) +fi + +if test "$PHANDERSON" = "yes"; then + TEXT="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_PHAnderson.o" + AC_DEFINE(WITH_PHANDERSON,1,[PHAnderson driver]) +fi + +if test "$PICGRAPHIC" = "yes"; then + GRAPHIC="yes" + GPIO="yes" + SERIAL="yes" + DRIVERS="$DRIVERS drv_PICGraphic.o" + AC_DEFINE(WITH_PICGRAPHIC,1,[PICGraphic driver]) +fi + +if test "$PICOLCD" = "yes"; then if test "$has_usb" = "true"; then TEXT="yes" GPIO="yes" SERIAL="yes" LIBUSB="yes" DRIVERS="$DRIVERS drv_picoLCD.o" - AC_DEFINE(WITH_picoLCD,1,[picoLCD driver]) + AC_DEFINE(WITH_PICOLCD,1,[picoLCD driver]) else AC_MSG_WARN(usb.h not found: picoLCD driver disabled) fi fi +if test "$PICOLCDGRAPHIC" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + GRAPHIC="yes" + GPIO="yes" + SERIAL="yes" + LIBUSB="yes" + DRIVERS="$DRIVERS drv_picoLCDGraphic.o" + AC_DEFINE(WITH_PICOLCDGRAPHIC,1,[picoLCDGraphic driver]) + else + AC_MSG_WARN(usb.h not found: picoLCDGraphic driver disabled) + fi +fi + if test "$PNG" = "yes"; then if test "$has_gd" = "true"; then IMAGE="yes" @@ -420,24 +626,32 @@ if test "$PPM" = "yes"; then fi if test "$ROUTERBOARD" = "yes"; then - TEXT="yes" - GPIO="yes" - DRIVERS="$DRIVERS drv_RouterBoard.o" - AC_DEFINE(WITH_ROUTERBOARD,1,[RouterBoard driver]) + if test "$has_io_h" = "true"; then + TEXT="yes" + GPIO="yes" + DRIVERS="$DRIVERS drv_RouterBoard.o" + AC_DEFINE(WITH_ROUTERBOARD,1,[RouterBoard driver]) + else + AC_MSG_WARN(sys/io.h not found: RouterBoard driver disabled) + fi fi if test "$SAMPLE" = "yes"; then - # select either text or graphics mode - TEXT="yes" - GRAPHIC="yes" - # support for GPIO's - GPIO="yes" - # select bus: serial (including USB), parallel or i2c - SERIAL="yes" - PARPORT="yes" - #I2C="yes" - DRIVERS="$DRIVERS drv_Sample.o" - AC_DEFINE(WITH_SAMPLE,1,[Sample driver]) + if test "$has_parport" = "true"; then + # select either text or graphics mode + TEXT="yes" + GRAPHIC="yes" + # support for GPIO's + GPIO="yes" + # select bus: serial (including USB), parallel or i2c + SERIAL="yes" + PARPORT="yes" + #I2C="yes" + DRIVERS="$DRIVERS drv_Sample.o" + AC_DEFINE(WITH_SAMPLE,1,[Sample driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: SAMPLE driver disabled) + fi fi if test "$SERDISPLIB" = "yes"; then @@ -454,6 +668,18 @@ if test "$SERDISPLIB" = "yes"; then fi fi +if test "$SHUTTLEVFD" = "yes"; then + if test "$has_usb" = "true"; then + TEXT="yes" + GPIO="yes" + DRIVERS="$DRIVERS drv_ShuttleVFD.o" + LIBUSB="yes" + AC_DEFINE(WITH_SHUTTLEVFD,1,[ShuttleVFD driver]) + else + AC_MSG_WARN(usb.h not found: ShuttleVFD driver disabled) + fi +fi + if test "$SIMPLELCD" = "yes"; then TEXT="yes" SERIAL="yes" @@ -461,11 +687,26 @@ if test "$SIMPLELCD" = "yes"; then AC_DEFINE(WITH_SIMPLELCD,1,[SimpleLCD driver]) fi +if test "$ST2205" = "yes"; then + if test "$has_st2205" = "true"; then + GRAPHIC="yes" + DRIVERS="$DRIVERS drv_st2205.o" + DRVLIBS="$DRVLIBS -L/usr/local/lib -lst2205" + AC_DEFINE(WITH_ST2205,1,[st2205 driver]) + else + AC_MSG_WARN(st2205.h not found: st2205 driver disabled) + fi +fi + if test "$T6963" = "yes"; then - GRAPHIC="yes" - PARPORT="yes" - DRIVERS="$DRIVERS drv_T6963.o" - AC_DEFINE(WITH_T6963,1,[T6963 driver]) + if test "$has_parport" = "true"; then + GRAPHIC="yes" + PARPORT="yes" + DRIVERS="$DRIVERS drv_T6963.o" + AC_DEFINE(WITH_T6963,1,[T6963 driver]) + else + AC_MSG_WARN(asm/io.h or {linux/parport.h and linux/ppdev.h} not found: T6963 driver disabled) + fi fi if test "$Trefon" = "yes"; then @@ -479,6 +720,18 @@ if test "$Trefon" = "yes"; then fi fi +if test "$ULA200" = "yes"; then + if test "$has_ftdi" = "true"; then + TEXT="yes" + LIBUSB="yes" + LIBFTDI="yes" + DRIVERS="$DRIVERS drv_ula200.o" + AC_DEFINE(WITH_ULA200,1,[ULA200 driver]) + else + AC_MSG_WARN(ftdi.h not found: ULA200 driver disabled) + fi +fi + if test "$USBHUB" = "yes"; then if test "$has_usb" = "true"; then GPIO="yes" @@ -500,6 +753,18 @@ if test "$USBLCD" = "yes"; then AC_DEFINE(WITH_USBLCD,1,[USBLCD driver]) fi +if test "$VNC" = "yes"; then + if test "$has_vncserverlib" = "true"; then + GRAPHIC="yes" + KEYPAD="yes" + DRIVERS="$DRIVERS drv_vnc.o" + DRVLIBS="$DRVLIBS -L/usr/local/lib -lvncserver -lz" + AC_DEFINE(WITH_VNC,1,[vnc driver]) + else + AC_MSG_WARN(libvncserver not found: vnc driver disabled) + fi +fi + if test "$WINCORNIXDORF" = "yes"; then TEXT="yes" SERIAL="yes" @@ -512,13 +777,14 @@ if test "$X11" = "yes"; then AC_MSG_WARN(X11 headers or libraries not available: X11 driver disabled) else GRAPHIC="yes" + KEYPAD="yes" DRIVERS="$DRIVERS drv_X11.o" if test "x$ac_x_libraries" = "x"; then DRVLIBS="$DRVLIBS -lX11" else DRVLIBS="$DRVLIBS -L$ac_x_libraries -lX11" fi - CPP_FLAGS="$CPPFLAGS $X_CFLAGS" + CPP_FLAGS="$CPPFLAGS $X_CFLAGS" AC_DEFINE(WITH_X11, 1, [X11 driver]) fi fi @@ -533,7 +799,7 @@ fi if test "$DRIVERS" = ""; then AC_MSG_ERROR([You should activate at least one driver...]) fi - + # generic text driver if test "$TEXT" = "yes"; then DRIVERS="$DRIVERS drv_generic_text.o" @@ -545,8 +811,9 @@ if test "$GRAPHIC" = "yes"; then if test "$has_gd" = "true"; then DRIVERS="$DRIVERS widget_image.o" DRVLIBS="$DRVLIBS -lgd" + AC_DEFINE(WITH_GD, 1, [GD library]) AC_DEFINE(WITH_IMAGE, 1, [image widget]) - fi + fi fi # generic GPIO driver @@ -582,5 +849,14 @@ if test "$LIBUSB" = "yes"; then DRVLIBS="$DRVLIBS -lusb" fi +# libftdi +if test "$LIBFTDI" = "yes"; then + DRVLIBS="$DRVLIBS -lftdi" +fi + +if test "$DRIVERS" = ""; then + AC_MSG_ERROR([You should include at least one driver...]) +fi + AC_SUBST(DRIVERS) AC_SUBST(DRVLIBS) @@ -1,9 +1,9 @@ -/* $Id: drv.c 760 2007-02-04 06:29:55Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv.c $ +/* $Id: drv.c 1137 2011-01-02 00:39:10Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv.c $ * * new framework for display drivers * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -24,7 +24,7 @@ * */ -/* +/* * exported functions: * * drv_list (void) @@ -47,35 +47,51 @@ #include "cfg.h" #include "drv.h" +extern DRIVER drv_ASTUSB; extern DRIVER drv_BeckmannEgle; extern DRIVER drv_BWCT; extern DRIVER drv_Crystalfontz; extern DRIVER drv_Curses; extern DRIVER drv_Cwlinux; +extern DRIVER drv_D4D; extern DRIVER drv_EA232graphic; +extern DRIVER drv_EFN; +extern DRIVER drv_FW8888; extern DRIVER drv_G15; +extern DRIVER drv_GLCD2USB; extern DRIVER drv_HD44780; extern DRIVER drv_Image; +extern DRIVER drv_IRLCD; extern DRIVER drv_LCD2USB; extern DRIVER drv_LCDLinux; extern DRIVER drv_LCDTerm; extern DRIVER drv_LEDMatrix; extern DRIVER drv_LPH7508; extern DRIVER drv_LUIse; +extern DRIVER drv_LW_ABP; extern DRIVER drv_M50530; extern DRIVER drv_MatrixOrbital; +extern DRIVER drv_MatrixOrbitalGX; extern DRIVER drv_MilfordInstruments; extern DRIVER drv_Noritake; extern DRIVER drv_NULL; +extern DRIVER drv_Pertelian; +extern DRIVER drv_PHAnderson; +extern DRIVER drv_PICGraphic; extern DRIVER drv_picoLCD; +extern DRIVER drv_picoLCDGraphic; extern DRIVER drv_RouterBoard; extern DRIVER drv_Sample; +extern DRIVER drv_st2205; extern DRIVER drv_serdisplib; +extern DRIVER drv_ShuttleVFD; extern DRIVER drv_SimpleLCD; extern DRIVER drv_T6963; extern DRIVER drv_Trefon; +extern DRIVER drv_ula200; extern DRIVER drv_USBHUB; extern DRIVER drv_USBLCD; +extern DRIVER drv_vnc; extern DRIVER drv_WincorNixdorf; extern DRIVER drv_X11; @@ -85,7 +101,12 @@ extern DRIVER drv_X11; */ char *output = NULL; + + DRIVER *Driver[] = { +#ifdef WITH_ASTUSB + &drv_ASTUSB, +#endif #ifdef WITH_BECKMANNEGLE &drv_BeckmannEgle, #endif @@ -101,18 +122,33 @@ DRIVER *Driver[] = { #ifdef WITH_CWLINUX &drv_Cwlinux, #endif +#ifdef WITH_D4D + &drv_D4D, +#endif #ifdef WITH_EA232graphic &drv_EA232graphic, #endif +#ifdef WITH_EFN + &drv_EFN, +#endif +#ifdef WITH_FW8888 + &drv_FW8888, +#endif #ifdef WITH_G15 &drv_G15, #endif +#ifdef WITH_GLCD2USB + &drv_GLCD2USB, +#endif #ifdef WITH_HD44780 &drv_HD44780, #endif -#if (defined (WITH_PNG) || defined(WITH_PPM)) && defined(WITH_GD) +#if (defined(WITH_PNG) && defined(WITH_GD)) || defined(WITH_PPM) &drv_Image, #endif +#ifdef WITH_IRLCD + &drv_IRLCD, +#endif #ifdef WITH_LCD2USB &drv_LCD2USB, #endif @@ -131,12 +167,18 @@ DRIVER *Driver[] = { #ifdef WITH_LUISE &drv_LUIse, #endif +#ifdef WITH_LW_ABP + &drv_LW_ABP, +#endif #ifdef WITH_M50530 &drv_M50530, #endif #ifdef WITH_MATRIXORBITAL &drv_MatrixOrbital, #endif +#ifdef WITH_MATRIXORBITALGX + &drv_MatrixOrbitalGX, +#endif #ifdef WITH_MILINST &drv_MilfordInstruments, #endif @@ -146,16 +188,33 @@ DRIVER *Driver[] = { #ifdef WITH_NULL &drv_NULL, #endif -#ifdef WITH_picoLCD +#ifdef WITH_PERTELIAN + &drv_Pertelian, +#endif +#ifdef WITH_PHANDERSON + &drv_PHAnderson, +#endif +#ifdef WITH_PICGRAPHIC + &drv_PICGraphic, +#endif +#ifdef WITH_PICOLCD &drv_picoLCD, #endif - +#ifdef WITH_PICOLCDGRAPHIC + &drv_picoLCDGraphic, +#endif #ifdef WITH_ROUTERBOARD &drv_RouterBoard, #endif #ifdef WITH_SAMPLE &drv_Sample, #endif +#ifdef WITH_ST2205 + &drv_st2205, +#endif +#ifdef WITH_SHUTTLEVFD + &drv_ShuttleVFD, +#endif #ifdef WITH_SERDISPLIB &drv_serdisplib, #endif @@ -168,12 +227,18 @@ DRIVER *Driver[] = { #ifdef WITH_TREFON &drv_Trefon, #endif +#ifdef WITH_ULA200 + &drv_ula200, +#endif #ifdef WITH_USBHUB &drv_USBHUB, #endif #ifdef WITH_USBLCD &drv_USBLCD, #endif +#ifdef WITH_VNC + &drv_vnc, +#endif #ifdef WITH_WINCORNIXDORF &drv_WincorNixdorf, #endif @@ -188,6 +253,10 @@ DRIVER *Driver[] = { static DRIVER *Drv = NULL; +/* maybe we need this */ +extern int drv_SD_list_verbose(void); + + int drv_list(void) { int i; @@ -200,6 +269,12 @@ int drv_list(void) Driver[i]->list(); } printf("\n"); + +#ifdef WITH_SERDISPLIB + printf("\n"); + drv_SD_list_verbose(); +#endif + return 0; } @@ -1,9 +1,9 @@ -/* $Id: drv.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv.h $ +/* $Id: drv.h 1067 2009-11-20 14:49:34Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv.h $ * * new framework for display drivers * - * Copyright (C) 1999-2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999-2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -41,6 +41,14 @@ typedef struct DRIVER { */ extern char *output; +#ifdef WITH_X11 +/* function to handle special X11 command line parameters + * has to be defined here because it's referenced + * in main before dealing with normal parameters. + */ +void drv_X11_parseArgs(int *argc, char *arvg[]); +#endif + int drv_list(void); int drv_init(const char *section, const char *driver, const int quiet); int drv_quit(const int quiet); diff --git a/drv_ASTUSB.c b/drv_ASTUSB.c new file mode 100644 index 0000000..6cc0297 --- /dev/null +++ b/drv_ASTUSB.c @@ -0,0 +1,512 @@ +/* $Id: $ + * $URL: $ + * + * driver for Attiny2313 USB LCD display interface + * see http://ast.m-faq.de/USB-LCD/USB-LCD.htm for schematics + * + * Copyright 2005 Till Harbaum <till@harbaum.org> + * Copyright 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_LCD2USB + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <fcntl.h> +#include <ctype.h> +#include <sys/ioctl.h> +#include <sys/time.h> + +#include <usb.h> + +#include "debug.h" +#include "cfg.h" +#include "timer.h" +#include "qprintf.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "widget_keypad.h" +#include "drv.h" +#include "drv_generic_text.h" + + +#define LCD_USB_VENDOR 0x03eb +#define LCD_USB_DEVICE 0x7a53 + +#define CMD_LCD_ECHO (0<<5) +#define CMD_LCD_INIT 1 +#define CMD_LCD_COMMAND 2 +#define CMD_LCD_DATA 3 +#define CMD_LCD_BLIGHT 4 + + +/* target is a bit map for CMD/DATA */ +#define LCD_CTRL_0 (1<<0) +#define LCD_CTRL_1 (1<<1) +#define LCD_BOTH (LCD_CTRL_0 | LCD_CTRL_1) + + +static char Name[] = "ASTUSB"; +static char *device_id = NULL, *bus_id = NULL; + +static usb_dev_handle *lcd; +static int controllers = 0; + +extern int got_signal; + +enum { + LCD_INIT_INCREASE = 1 << 0, + LCD_INIT_SHIFT = 1 << 1, + LCD_INIT_CON = 1 << 2, + LCD_INIT_BON = 1 << 3, + LCD_INIT_DSHIFT = 1 << 4, + LCD_INIT_RSHIFT = 1 << 5, + LCD_INIT_2LINES = 1 << 6, + LCD_INIT_FONT = 1 << 7 +}; + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_AST_HW_open(char *bus_id, char *device_id) +{ + struct usb_bus *busses, *bus; + struct usb_device *dev; + + lcd = NULL; + + info("%s: scanning USB for ASTUSB interface ...", Name); + + if (bus_id != NULL) + info("%s: scanning for bus id: %s", Name, bus_id); + + if (device_id != NULL) + info("%s: scanning for device id: %s", Name, device_id); + + usb_set_debug(0); + + usb_init(); + usb_find_busses(); + usb_find_devices(); + busses = usb_get_busses(); + + for (bus = busses; bus; bus = bus->next) { + /* search this bus if no bus id was given or if this is the given bus id */ + if (!bus_id || (bus_id && !strcasecmp(bus->dirname, bus_id))) { + + for (dev = bus->devices; dev; dev = dev->next) { + /* search this device if no device id was given or if this is the given device id */ + if (!device_id || (device_id && !strcasecmp(dev->filename, device_id))) { + + if ((dev->descriptor.idVendor == LCD_USB_VENDOR) && (dev->descriptor.idProduct == LCD_USB_DEVICE)) { + info("%s: found ASTUSB interface on bus %s device %s", Name, bus->dirname, dev->filename); + lcd = usb_open(dev); + if (usb_claim_interface(lcd, 0) < 0) { + error("%s: usb_claim_interface() failed!", Name); + return -1; + } + return 0; + } + } + } + } + } + return -1; +} + +static int drv_AST_HW_close(void) +{ + usb_release_interface(lcd, 0); + usb_close(lcd); + + return 0; +} + +static int drv_AST_HW_data(unsigned char *buffer, short length, int __attribute__ ((unused)) index) +{ + int request = CMD_LCD_DATA; + int value = 0; + + if (usb_control_msg + (lcd, USB_TYPE_VENDOR | USB_RECIP_DEVICE, request, value, 0 /*index */ , (char *) buffer, length, 1000) < 0) { + error("%s: USB request failed! Trying to reconnect device.", Name); + + usb_release_interface(lcd, 0); + usb_close(lcd); + + /* try to close and reopen connection */ + if (drv_AST_HW_open(bus_id, device_id) < 0) { + error("%s: could not re-detect ASTUSB USB LCD", Name); + got_signal = -1; + return -1; + } + /* and try to re-send command */ + if (usb_control_msg + (lcd, USB_TYPE_VENDOR | USB_RECIP_DEVICE, request, value, 0 /*index */ , (char *) buffer, length, + 1000) < 0) { + error("%s: retried USB request failed, aborting!", Name); + got_signal = -1; + return -1; + } + + info("%s: Device successfully reconnected.", Name); + } + + return 0; +} + +/* send a number of 16 bit words to the lcd2usb interface */ +/* and verify that they are correctly returned by the echo */ +/* command. This may be used to check the reliability of */ +/* the usb interfacing */ +#define ECHO_NUM 10 + + +static int drv_AST_HW_cmd(unsigned char cmd, short value, int __attribute__ ((unused)) index) +{ + unsigned char buffer[2]; + int nBytes; + + /* send control request and accept return value */ + nBytes = usb_control_msg(lcd, + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + cmd, value, 0 /*index */ , (char *) buffer, sizeof(buffer), 1000); + + if (nBytes < 0) { + error("%s: USB request failed!", Name); + return -1; + } + + return buffer[0] + 256 * buffer[1]; +} + +int drv_AST_HW_echo(void) +{ + int i, errors = 0; + char val; + char buffer[2]; + + for (i = 0; i < ECHO_NUM; i++) { + val = rand() & 0xff; //8 bit number + + if (usb_control_msg(lcd, + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + CMD_LCD_ECHO, val, 0, buffer, sizeof(buffer), 1000) < 0) { + error("%s: USB request failed!", Name); + return -1; + } + + if (val != buffer[1]) + errors++; + } + + if (errors) { + error("%s: ERROR, %d out of %d echo transfers failed!", Name, errors, ECHO_NUM); + return -1; + } else + info("%s: echo test successful", Name); + + + return 0; +} + + +/* command format: + * 7 6 5 4 3 2 1 0 + * C C C T T R L L + * + * TT = target bit map + * R = reserved for future use, set to 0 + * LL = number of bytes in transfer - 1 + */ + +short drv_AST_LCD_BL(int backlight) +{ + + if (backlight < 0) + backlight = 0; + else if (backlight > 1) + backlight = 1; + + drv_AST_HW_cmd(CMD_LCD_BLIGHT, backlight, 0); + + return backlight; +} + + +static void drv_AST_clear(void) +{ + drv_AST_HW_cmd(CMD_LCD_COMMAND, 0x01, LCD_BOTH & controllers); /* clear display */ + drv_AST_HW_cmd(CMD_LCD_COMMAND, 0x03, LCD_BOTH & controllers); /* return home */ +} + +static void drv_AST_write(const int row, const int col, const char *data, int len) +{ + int pos, ctrl = LCD_CTRL_0; + int tmpRow = row; + + /* displays with more two rows and 20 columns have a logical width */ + /* of 40 chars and use more than one controller */ + if ((DROWS > 2) && (DCOLS > 20) && (row > 1)) { + /* use second controller */ + tmpRow -= 2; + ctrl = LCD_CTRL_1; + } + + /* 16x4 Displays use a slightly different layout */ + if (DCOLS == 16 && DROWS == 4) { + pos = (tmpRow % 2) * 64 + (tmpRow / 2) * 16 + col; + } else { + pos = (tmpRow % 2) * 64 + (tmpRow / 2) * 20 + col; + } + + drv_AST_HW_cmd(CMD_LCD_COMMAND, 0x80 | pos, (ctrl & controllers)); + drv_AST_HW_data((unsigned char *) data, len, (ctrl & controllers)); + +} + +static void drv_AST_defchar(const int ascii, const unsigned char *matrix) +{ + int i; + unsigned char buffer[8]; + + //build buffer + for (i = 0; i < 8; i++) { + buffer[i] = *matrix++ & 0x1f; + } + + //send to HW + drv_AST_HW_cmd(CMD_LCD_COMMAND, 0x40 | 8 * ascii, LCD_BOTH & controllers); + drv_AST_HW_data((unsigned char *) buffer, sizeof(buffer), LCD_BOTH & controllers); +} + +static int drv_AST_start(const char *section, const int quiet) +{ +// int contrast, brightness; + int backlight; + int rows = -1, cols = -1; + char *s; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* bus id and device id are strings and not just intergers, since */ + /* the windows port of libusb treats them as strings. And this way */ + /* we keep windows compatibility ... just in case ... */ + bus_id = cfg_get(section, "Bus", NULL); + device_id = cfg_get(section, "Device", NULL); + + if (drv_AST_HW_open(bus_id, device_id) < 0) { + error("%s: could not find a ASTUSB USB LCD", Name); + return -1; + } + + /* test interface reliability */ + drv_AST_HW_echo(); + + /*low level init of init LCD */ + if (drv_AST_HW_cmd(CMD_LCD_INIT, LCD_INIT_INCREASE | (DROWS > 1 ? LCD_INIT_2LINES : 1), LCD_BOTH & controllers) < 0) { + error("%s: could not init LCD", Name); + return -1; + } + + if (cfg_number(section, "Backlight", 0, 0, 1, &backlight) > 0) { + info("%s: backlight %s", Name, backlight ? "enabled" : "disabled"); + drv_AST_LCD_BL(backlight); + } + + drv_AST_clear(); /* clear display */ + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "AST USB-LCD")) { + sleep(3); + drv_AST_clear(); + } + } + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + double backlight; + + backlight = drv_AST_LCD_BL(R2N(arg1)); + SetResult(&result, R_NUMBER, &backlight); +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_AST_list(void) +{ + printf("ASTUSB display interface"); + return 0; +} + + +/* initialize driver & display */ +int drv_AST_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int asc255bug; + int ret; + + info("%s: %s", Name, "$Rev: 975 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 8; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 2; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_AST_write; + drv_generic_text_real_defchar = drv_AST_defchar; + + /* start display */ + if ((ret = drv_AST_start(section, quiet)) != 0) + return ret; + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + /* most displays have a full block on ascii 255, but some have kind of */ + /* an 'inverted P'. If you specify 'asc255bug 1 in the config, this */ + /* char will not be used, but rendered by the bar driver */ + cfg_number(section, "asc255bug", 0, 0, 1, &asc255bug); + drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ + if (!asc255bug) + drv_generic_text_bar_add_segment(255, 255, 255, 255); /* ASCII 255 = block */ + + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register icon widget */ + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + + /* register plugins */ + // AddFunction("LCD::contrast", 1, plugin_contrast); + // AddFunction("LCD::brightness", 1, plugin_brightness); + AddFunction("LCD::backlight", 1, plugin_backlight); + + return 0; +} + + +/* close driver & display */ +int drv_AST_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + /* clear display */ + drv_AST_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("That's all, folks!", NULL); + } + + drv_AST_LCD_BL(0); + + debug("closing USB connection"); + drv_AST_HW_close(); + + return (0); +} + + +DRIVER drv_ASTUSB = { + .name = Name, + .list = drv_AST_list, + .init = drv_AST_init, + .quit = drv_AST_quit, +}; @@ -1,9 +1,9 @@ -/* $Id: drv_BWCT.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_BWCT.c $ +/* $Id: drv_BWCT.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_BWCT.c $ * * new style driver for BWCT USB LCD displays * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -72,7 +72,6 @@ static char Name[] = "BWCT"; static usb_dev_handle *lcd; static int interface; -extern int usb_debug; extern int got_signal; @@ -89,7 +88,7 @@ static int drv_BW_open(void) info("%s: scanning USB for BWCT LCD...", Name); - usb_debug = 0; + usb_set_debug(0); usb_init(); usb_find_busses(); @@ -298,7 +297,7 @@ static void plugin_contrast(RESULT * result, RESULT * arg1) /* list models */ int drv_BW_list(void) { - printf("generic"); + printf("BWCT USB to HD44780 interface"); return 0; } @@ -310,7 +309,7 @@ int drv_BW_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_BeckmannEgle.c b/drv_BeckmannEgle.c index 301e029..2f09444 100644 --- a/drv_BeckmannEgle.c +++ b/drv_BeckmannEgle.c @@ -1,8 +1,8 @@ -/* $Id: drv_BeckmannEgle.c 776 2007-02-26 10:34:52Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_BeckmannEgle.c $ +/* $Id: drv_BeckmannEgle.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_BeckmannEgle.c $ * * driver for Beckmann+Egle "Mini Terminals" and "Compact Terminals" - * Copyright (C) 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -625,7 +625,7 @@ int drv_BuE_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 776 $"); + info("%s: %s", Name, "$Rev: 840 $"); /* start display */ if ((ret = drv_BuE_start(section)) != 0) { diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c index 0833629..9b11587 100644 --- a/drv_Crystalfontz.c +++ b/drv_Crystalfontz.c @@ -1,9 +1,9 @@ -/* $Id: drv_Crystalfontz.c 781 2007-03-13 12:39:11Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Crystalfontz.c $ +/* $Id: drv_Crystalfontz.c 906 2008-12-23 14:55:32Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Crystalfontz.c $ * * new style driver for Crystalfontz display modules * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -353,6 +353,86 @@ static void drv_CF_send(const unsigned char cmd, const unsigned char len, const } +/* check http://www.crystalfontz.com/products/634/cgrom.html */ +/* HINT: the input should using the ISO-8859-1 charset */ +void convertToCgrom2(char *str) +{ + unsigned int i; + for (i = 0; i < strlen(str); i++) { + switch ((unsigned char) str[i]) { + case 0x5d: /* ] */ + str[i] = 252; + break; + case 0x5b: /* [ */ + str[i] = 250; + break; + case 0x24: /* $ */ + str[i] = 162; + break; + case 0x40: /* @ */ + str[i] = 160; + break; + case 0x5c: /* \ */ + str[i] = 251; + break; + case 0x7b: /* { */ + str[i] = 253; + break; + case 0x7d: /* } */ + str[i] = 255; + break; + case 0x7c: + str[i] = 254; /* pipe */ + break; + case 0x27: + case 0x60: + case 0xB4: + str[i] = 39; /* ' */ + break; + case 0xe8: + str[i] = 164; /* french e */ + break; + case 0xe9: + str[i] = 165; /* french e */ + break; + case 0xc8: + str[i] = 197; /* french E */ + break; + case 0xc9: + str[i] = 207; /* french E */ + break; + + case 0xe4: + str[i] = 123; /* small german ae */ + break; + case 0xc4: + str[i] = 91; /* big german ae */ + break; + case 0xf6: + str[i] = 124; /* small german oe */ + break; + case 0xd6: + str[i] = 92; /* big german oe */ + break; + case 0xfc: + str[i] = 126; /* small german ue */ + break; + case 0xdc: + str[i] = 94; /* big german ue */ + break; + case 0x5e: /* ^ */ + str[i] = 253; + break; + case 0x5f: /* _ */ + str[i] = 254; + break; + default: + break; + } + } +} + + static void drv_CF_write1(const int row, const int col, const char *data, const int len) { char cmd[3] = "\021xy"; /* set cursor position */ @@ -365,6 +445,11 @@ static void drv_CF_write1(const int row, const int col, const char *data, const drv_generic_serial_write(cmd, 3); } + /* Model 634 and 632 use another ROM */ + if (Model == 4 || Model == 2) { + convertToCgrom2((char *) data); + } + drv_generic_serial_write(data, len); } @@ -411,7 +496,6 @@ static void drv_CF_write3(const int row, const int col, const char *data, const memcpy(cmd + 2, data, l); drv_CF_send(31, l + 2, cmd); - } @@ -531,7 +615,7 @@ static int drv_CF_keypad(const int num) case 2: break; case 3: - if ((num < 8) || ((num > 12) && (num < 17))) + if ((num < 7) || ((num > 12) && (num < 17))) val = WIDGET_KEY_PRESSED; else val = WIDGET_KEY_RELEASED; @@ -973,7 +1057,7 @@ int drv_CF_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 781 $"); + info("%s: %s", Name, "$Rev: 906 $"); /* start display */ if ((ret = drv_CF_start(section)) != 0) { diff --git a/drv_Curses.c b/drv_Curses.c index cac9452..2e00210 100644 --- a/drv_Curses.c +++ b/drv_Curses.c @@ -1,9 +1,9 @@ -/* $Id: drv_Curses.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Curses.c $ +/* $Id: drv_Curses.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Curses.c $ * * pure ncurses based text driver * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old Curses/Text driver which is @@ -276,7 +276,7 @@ static int drv_Curs_keypad(const int num) /* list models */ int drv_Curs_list(void) { - printf("any"); + printf("pure ncurses based text driver"); return 0; } @@ -287,7 +287,7 @@ int drv_Curs_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 1; /* pixel width of one char */ diff --git a/drv_Cwlinux.c b/drv_Cwlinux.c index f870c53..fbf2393 100644 --- a/drv_Cwlinux.c +++ b/drv_Cwlinux.c @@ -1,9 +1,9 @@ -/* $Id: drv_Cwlinux.c 789 2007-04-30 04:48:10Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Cwlinux.c $ +/* $Id: drv_Cwlinux.c 929 2008-12-31 06:40:59Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Cwlinux.c $ * * new style driver for Cwlinux display modules * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -83,8 +83,10 @@ typedef struct { /* Fixme: number of gpo's should be verified */ static MODEL Models[] = { + /* type, name, rows, cols, xres/char, yres/char, gpo's, gpi's, definable chars, protocol */ {0x01, "CW1602", 2, 16, 5, 7, 2, 2, 8, 1}, {0x02, "CW12232", 4, 20, 6, 8, 2, 2, 16, 2}, + {0x03, "CW12832", 4, 21, 6, 8, 2, 2, 16, 2}, {0xff, "Unknown", -1, -1, -1, -1, -1, -1, -1, -1} }; @@ -173,7 +175,7 @@ static void drv_CW1602_defchar(const int ascii, const unsigned char *buffer) static void drv_CW12232_defchar(const int ascii, const unsigned char *buffer) { int i, j; - char cmd[10] = "\376Nn123456\375"; + char cmd[10] = "\376Nn123456\375"; /* 0xfe 'N' [1..16] (6 Bytes Data) 0xfd */ cmd[2] = (char) ascii; @@ -236,8 +238,8 @@ static int drv_CW_brightness(int brightness) if (brightness < 0) brightness = 0; - if (brightness > 255) - brightness = 255; + if (brightness > 8) + brightness = 8; Brightness = brightness; switch (Brightness) { @@ -319,7 +321,7 @@ static int drv_CW_start(const char *section) if (drv_generic_serial_open(section, Name, 0) < 0) return -1; - /* read firmware version */ + /* read firmware version: 0xfe '1' 0xfd */ drv_generic_serial_write("\3761\375", 3); usleep(100000); if (drv_generic_serial_read(buffer, 2) != 2) { @@ -328,7 +330,7 @@ static int drv_CW_start(const char *section) info("Cwlinux Firmware V%d.%d", (int) buffer[0], (int) buffer[1]); } - /* read model mumber */ + /* read model mumber: 0xfe 0x30 0xfd */ drv_generic_serial_write("\3760\375", 3); usleep(100000); if (drv_generic_serial_read(buffer, 2) != 2) { @@ -425,7 +427,7 @@ int drv_CW_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 789 $"); + info("%s: %s", Name, "$Rev: 929 $"); /* display preferences */ CHAR0 = 1; /* ASCII of first user-defineable char */ diff --git a/drv_D4D.c b/drv_D4D.c new file mode 100755 index 0000000..5e10f6f --- /dev/null +++ b/drv_D4D.c @@ -0,0 +1,778 @@ +/* $Id: drv_D4D.c 897 2008-10-06 04:25:14Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_D4D.c $ + * + * LCD4Linux driver for 4D Systems Display Graphics Modules + * + * Copyright (C) 2008 Sven Killig <sven@killig.de> + * Modified from sample code by: + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_D4D + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include <termios.h> +#include <fcntl.h> +#include <math.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +#include "drv_generic_text.h" +#include "drv_generic_graphic.h" +#include "drv_generic_serial.h" + +static char Name[] = "D4D"; +char NAME_[20]; +int FONT = 1, MODE = 0, EXTRA = 0, SECTOR = 0, SECTOR_SIZE, NOPOWERCYCLE = 0; +/* int CONTRAST_; */ + +#define address_mmsb(variable) ((variable >> 24) & 0xFF) +#define address_mlsb(variable) ((variable >> 16) & 0xFF) +#define address_lmsb(variable) ((variable >> 8) & 0xFF) +#define address_llsb(variable) (variable & 0xFF) + +#define address_hi(variable) ((variable >> 16) & 0xFF) +#define address_mid(variable) ((variable >> 8) & 0xFF) +#define address_lo(variable) (variable & 0xFF) + +#define msb(variable) ((variable >> 8) & 0xFF) +#define lsb(variable) (variable & 0xFF) + +RGBA FG_COL_ = {.R = 0x00,.G = 0x00,.B = 0x00,.A = 0xff }; +RGBA BG_COL_ = {.R = 0xff,.G = 0xff,.B = 0xff,.A = 0xff }; + +short int FG_COLOR, BG_COLOR; + +int RGB_24to16(int red, int grn, int blu) +{ + return (((red >> 3) << 11) | ((grn >> 2) << 5) | (blu >> 3)); +} + +int RGB_24to8(int red, int grn, int blu) +{ + return (((red >> 5) << 5) | ((grn >> 5) << 2) | (blu >> 6)); +} + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + + +static int drv_D4D_open(const char *section) +{ + int fd; + fd = drv_generic_serial_open(section, Name, 0); + if (fd < 0) + return -1; + fcntl(fd, F_SETFL, 0); /* blocking read */ + return 0; +} + + +static int drv_D4D_close(void) +{ + drv_generic_serial_close(); + return 0; +} + + +static void drv_D4D_receive_ACK() +{ + char ret[1]; + while (drv_generic_serial_read(ret, sizeof(ret)) != 1) + usleep(1); /* loop should be unneccessary */ + if (ret[0] == 0x15) { + error("NAK!"); + } else if (ret[0] != 6) { + error("no ACK!"); + } +} + +static void drv_D4D_send_nowait(const char *data, const unsigned int len) +{ + drv_generic_serial_write(data, len); +} + +static void drv_D4D_send(const char *data, const unsigned int len) +{ + drv_D4D_send_nowait(data, len); + drv_D4D_receive_ACK(); +} + +static void drv_D4D_send_nowait_extra(const char *data, const unsigned int len, unsigned char pos1, unsigned char pos2) +{ + /* possibly leave out bytes at pos1 and pos2 for older protocol format */ + if (EXTRA) { + drv_D4D_send_nowait(data, len); + } else { + unsigned int i; + char send[1]; + for (i = 0; i < len; i++) { + if (!pos1 || i != pos1) { + if (!pos2 || i != pos2) { + send[0] = data[i]; + drv_generic_serial_write(send, 1); + } + } + } + } +} + +static void drv_D4D_send_extra(const char *data, const unsigned int len, char pos1, char pos2) +{ + drv_D4D_send_nowait_extra(data, len, pos1, pos2); + drv_D4D_receive_ACK(); +} + + +static void drv_D4D_clear(void) +{ + char cmd[] = { 'E' }; + drv_D4D_send(cmd, sizeof(cmd)); +} + + +static void drv_D4D_write(const int row, const int col, const char *data, int len) +{ + char out[len]; + char user_char[len]; + int user_x[len]; + int user_y[len]; + int i, k = 0; + + if (!SECTOR) { /* font in ROM */ + + for (i = 0; i < len; i++) { + if (data[i] >= 31 && data[i] < CHAR0) { + out[i] = data[i]; + } else if (data[i] == 'µ') { /* mu */ + if (FONT == 2) + out[i] = 31; /* undocumented */ + else if (FONT == 0) + out[i] = 'u'; + else + out[i] = 127; /* undocumented */ + } else { + out[i] = ' '; + if (data[i] == '°') + user_char[k] = 0; /* degree */ + else + user_char[k] = data[i] - CHAR0; + user_x[k] = (col + i) * XRES; + user_y[k] = row * YRES; + k++; + } + } + + char cmd[] = { 's', col, row, FONT, msb(FG_COLOR), lsb(FG_COLOR) }; /* normal chars */ + drv_D4D_send_nowait(cmd, sizeof(cmd)); + if (len > 256) + len = 256; + drv_D4D_send_nowait(out, len); + char cmdNull[1]; + cmdNull[0] = 0; + drv_D4D_send(cmdNull, 1); + + char cmd_user[] = { 'D', 0, 0, 0, 0, 0, msb(FG_COLOR), lsb(FG_COLOR) }; /* user defined symbols */ + for (i = 0; i < k; i++) { + cmd_user[2] = user_char[i]; + cmd_user[3] = user_x[i]; + cmd_user[4] = msb(user_y[i]); + cmd_user[5] = lsb(user_y[i]); + drv_D4D_send_extra(cmd_user, sizeof(cmd_user), 1, 4); + } + } else { /* font on SD card */ + int sec; + char cmd_sd[] = { '@', 'I', 0, msb(row * YRES), lsb(row * YRES), XRES, msb(YRES), lsb(YRES), 16, 0, 0, 0 }; + for (i = 0; i < len; i++) { + cmd_sd[2] = (col + i) * XRES; + sec = SECTOR + (unsigned char) data[i] * SECTOR_SIZE; + cmd_sd[9] = address_hi(sec); + cmd_sd[10] = address_mid(sec); + cmd_sd[11] = address_lo(sec); + drv_D4D_send_extra(cmd_sd, sizeof(cmd_sd), 3, 6); + } + } +} + + +static void drv_D4D_defchar(const int ascii, const unsigned char *matrix) +{ + /* error("drv_D4D_defchar"); */ + char cmd[11]; + int i; + + cmd[0] = 'A'; + cmd[1] = 0; + cmd[2] = ascii - CHAR0; + + for (i = 0; i < 8; i++) { + cmd[i + 3] = *matrix++; + } + drv_D4D_send_extra(cmd, sizeof(cmd), 1, 0); +} + + +static void drv_D4D_blit(const int row, const int col, const int height, const int width) +{ + /* error("drv_D4D_blit(%i, %i, %i, %i)",row, col, height, width); */ + int r, c; + RGBA rgb, pixel0_0, pixel; + short int color; + char colorArray[2]; + + + /* optimization: single colour rectangle? */ + pixel0_0 = drv_generic_graphic_rgb(0, 0); + char unicolor = 1; + for (r = row; r < row + height; r++) { + if (!unicolor) + break; + for (c = col; c < col + width; c++) { + if (!unicolor) + break; + pixel = drv_generic_graphic_rgb(r, c); + if (pixel0_0.R != pixel.R || pixel0_0.G != pixel.G || pixel0_0.B != pixel.B || pixel0_0.A != pixel.A) + unicolor = 0; + } + } + + if (unicolor) { + color = RGB_24to16(pixel0_0.R, pixel0_0.G, pixel0_0.B); + char row2 = row + height - 1; + char cmdRect[] = + { 'r', col, msb(row), lsb(row), col + width - 1, msb(row2), lsb(row2), msb(color), lsb(color) }; + drv_D4D_send_extra(cmdRect, sizeof(cmdRect), 2, 5); + } else { + char cmd[] = { 'I', col, msb(row), lsb(row), width, msb(height), lsb(height), MODE }; + drv_D4D_send_nowait_extra(cmd, sizeof(cmd), 2, 5); + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) { + rgb = drv_generic_graphic_rgb(r, c); + if (MODE == 8) { + colorArray[0] = RGB_24to8(rgb.R, rgb.G, rgb.B); + drv_D4D_send_nowait(colorArray, 1); + } else { + color = RGB_24to16(rgb.R, rgb.G, rgb.B); + colorArray[0] = msb(color); + drv_D4D_send_nowait(colorArray, 1); /* doesn't werk if sent together (error: "partial write(/dev/tts/1): len=2 ret=1") */ + /* colorArray[1]=lsb(color); */ + colorArray[0] = lsb(color); + drv_D4D_send_nowait(colorArray, 1); + } + /* drv_D4D_send_nowait(colorArray, MODE/8); */ + } + } + drv_D4D_receive_ACK(); + } +} + + +static int drv_D4D_contrast(int contrast) +{ + if (contrast < 0) + contrast = 0; + if (contrast > 15) + contrast = 15; + + char cmd[] = { 'Y', 2, contrast }; + drv_D4D_send(cmd, sizeof(cmd)); + + /* CONTRAST_=contrast; */ + return contrast; +} + + +static int drv_D4D_start(const char *section) +{ + /* error("drv_D4D_start()"); */ + int contrast; + int xres_cfg = -1, yres_cfg = -1; + char *s; + char *color; + + if (drv_D4D_open(section) < 0) { + return -1; + } + + char cmd[] = { 'U' }; + drv_D4D_send(cmd, sizeof(cmd)); + + + char getVersion[] = { 'V', 0 }; + drv_D4D_send_nowait(getVersion, sizeof(getVersion)); + char answer[5]; + drv_generic_serial_read(answer, sizeof(answer)); + char *ids[] = { "uOLED", "uLCD", "uVGA" }; + char *id; + if (answer[0] <= 2) + id = ids[(int) answer[0]]; + else + id = "Unknown"; + qprintf(NAME_, sizeof(NAME_), "%s H%u S%u", id, (int) answer[1], (int) answer[2]); + int res[2]; + int i; + for (i = 0; i < 2; i++) { + switch ((unsigned char) answer[3 + i]) { + case 0x22: + res[i] = 220; + break; + case 0x28: + res[i] = 128; + break; + case 0x32: + res[i] = 320; + EXTRA = 1; + break; + case 0x60: + res[i] = 160; + break; + case 0x64: + res[i] = 64; + break; + case 0x76: + res[i] = 176; + break; + case 0x96: + res[i] = 96; + break; + case 0x24: /* undocumented? */ + res[i] = 240; + break; + default: + error("Can't detect display dimensions!"); + return -1; + } + } + DCOLS = res[0]; + DROWS = res[1]; + + + cfg_number(section, "Mode", 0, 0, 16, &MODE); + + s = cfg_get(section, "Font", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &xres_cfg, &yres_cfg) < 1 || xres_cfg < 0) { + error("%s: bad %s.Font '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + if (yres_cfg == -1) { /* font on SD card */ + SECTOR = xres_cfg * 512; + char setAddress[] = + { '@', 'A', address_mmsb(SECTOR), address_mlsb(SECTOR), address_lmsb(SECTOR), address_llsb(SECTOR) }; + drv_D4D_send(setAddress, sizeof(setAddress)); + char answer1[1]; + char readByte[] = { '@', 'r' }; + drv_D4D_send_nowait(readByte, sizeof(readByte)); + drv_generic_serial_read(answer1, sizeof(answer1)); + XRES = answer1[0]; + drv_D4D_send_nowait(readByte, sizeof(readByte)); + drv_generic_serial_read(answer1, sizeof(answer1)); + YRES = answer1[0]; + SECTOR = xres_cfg + 1; + SECTOR_SIZE = ceil((double) XRES * (double) YRES * 2.0 / 512.0); + } else { + XRES = xres_cfg; + YRES = yres_cfg; + } + + if (MODE == 0) { + + color = cfg_get(section, "foreground", "ffffff"); + if (color2RGBA(color, &FG_COL_) < 0) { + error("%s: ignoring illegal color '%s'", Name, color); + } + if (color) + free(color); + FG_COLOR = RGB_24to16(FG_COL_.R, FG_COL_.G, FG_COL_.B); + + color = cfg_get(section, "background", "000000"); + if (color2RGBA(color, &BG_COL_) < 0) { + error("%s: ignoring illegal color '%s'", Name, color); + } + if (color) + free(color); + BG_COLOR = RGB_24to16(BG_COL_.R, BG_COL_.G, BG_COL_.B); + + DCOLS = DCOLS / XRES; + DROWS = DROWS / YRES; + switch (yres_cfg) { /* font in ROM */ + case 8: + switch (xres_cfg) { + case 6: + FONT = 0; + break; + case 8: + FONT = 1; + break; + default: + error("%s: unknown width in %s.Font '%s' from %s", Name, section, s, cfg_source()); + return -1; + }; + break; + case 12: + FONT = 2; + break; + case 16: + FONT = 3; + break; + case -1: + break; + default: + error("%s: unknown height in %s.Font '%s' from %s", Name, section, s, cfg_source()); + return -1; + } + } + + info("XRES=%i, YRES=%i; DCOLS=%i, DROWS=%d; FONT=%d, SECTOR=%i, SECTOR_SIZE=%i\n", XRES, YRES, DCOLS, DROWS, + FONT, SECTOR, SECTOR_SIZE); + + + + cfg_number(section, "NoPowerCycle", 0, 1, 65536, &NOPOWERCYCLE); + if (!NOPOWERCYCLE) { + char powerOn[] = { 'Y', 3, 1 }; + drv_D4D_send(powerOn, sizeof(powerOn)); + + /*char background[] = {'B', msb(BG_COLOR), lsb(BG_COLOR)}; + drv_D4D_send(background, sizeof(background)); */ + } + + char opaque[] = { 'O', 1 }; + drv_D4D_send(opaque, sizeof(opaque)); + + char penSize[] = { 'p', 0 }; + drv_D4D_send(penSize, sizeof(penSize)); + + + if (!MODE) { + unsigned char buffer[] = { 0x18, 0x24, 0x24, 0x18, 0, 0, 0, 0 }; /* degree */ + drv_D4D_defchar(CHAR0, buffer); + CHARS--; + CHAR0++; + } + + if (cfg_number(section, "Contrast", 0, 0, 255, &contrast) > 0) { + drv_D4D_contrast(contrast); + } + + drv_D4D_clear(); + + return 0; +} + + +int drv_D4D_text_draw(WIDGET * W) +{ + short int FG_COLOR_old = FG_COLOR, BG_COLOR_old = BG_COLOR; + int ret; + RGBA fg, bg; + fg = W->fg_valid ? W->fg_color : FG_COL_; + bg = W->bg_valid ? W->bg_color : BG_COL_; + FG_COLOR = RGB_24to16(fg.R, fg.G, fg.B); + BG_COLOR = RGB_24to16(bg.R, bg.G, bg.B); + ret = drv_generic_text_draw(W); + FG_COLOR = FG_COLOR_old; + BG_COLOR = BG_COLOR_old; + return ret; +} + + +int lastVal[40 * 40 * 2]; /* ToDo: MAX_WIDGETS*2 */ +int drv_D4D_bar_draw(WIDGET * W) +{ + /* optimizations: + - draw filled rectangles instead of user defined bar characters + - cache last values */ + + WIDGET_BAR *Bar = W->data; + int row, col, len, res, max, val1, val2; + DIRECTION dir; + STYLE style; + + row = W->row; + col = W->col; + dir = Bar->direction; + style = Bar->style; + len = Bar->length; + + res = dir & (DIR_EAST | DIR_WEST) ? XRES : YRES; + max = len * res; + val1 = Bar->val1 * (double) (max); + val2 = Bar->val2 * (double) (max); + + if (val1 < 1) + val1 = 1; + else if (val1 > max) + val1 = max; + + if (val2 < 1) + val2 = 1; + else if (val2 > max) + val2 = max; + + short int FG_COLOR_old = FG_COLOR, BG_COLOR_old = BG_COLOR; + RGBA fg, bg; + fg = W->fg_valid ? W->fg_color : FG_COL_; + bg = W->bg_valid ? W->bg_color : BG_COL_; + FG_COLOR = RGB_24to16(fg.R, fg.G, fg.B); + BG_COLOR = RGB_24to16(bg.R, bg.G, bg.B); + + char cmd[9]; + cmd[0] = 'r'; + int val[2]; + val[0] = val1; + val[1] = val2; + int i, vals; + int lastValIndex0 = row * DCOLS + col; + int cells = DROWS * DCOLS; + if (val1 == val2 && lastVal[lastValIndex0] == lastVal[lastValIndex0 + cells]) + vals = 1; + else + vals = 2; + for (i = 0; i < vals; i++) { + int lastValIndex = lastValIndex0 + cells * (i /*+1 */ ); + int y1 = row * YRES + (YRES / 2) * i; + cmd[2] = msb(y1); + cmd[3] = lsb(y1); + int y2 = y1 + (YRES) / vals - 1; + cmd[5] = msb(y2); + cmd[6] = lsb(y2); + if (val[i] > lastVal[lastValIndex]) { + cmd[1] = col * XRES + lastVal[lastValIndex]; + cmd[4] = cmd[1] + val[i] - lastVal[lastValIndex] - 1; + cmd[7] = msb(FG_COLOR); + cmd[8] = lsb(FG_COLOR); + drv_D4D_send_extra(cmd, sizeof(cmd), 2, 5); + } else if (val[i] < lastVal[lastValIndex]) { + cmd[1] = col * XRES + val[i] - 1 + 1; + cmd[4] = cmd[1] + lastVal[lastValIndex] - val[i]; + cmd[7] = msb(BG_COLOR); + cmd[8] = lsb(BG_COLOR); + drv_D4D_send_extra(cmd, sizeof(cmd), 2, 5); + } + lastVal[lastValIndex] = val[i]; + } + + FG_COLOR = FG_COLOR_old; + BG_COLOR = BG_COLOR_old; + return 0; +} + + + + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_contrast(RESULT * result, RESULT * arg1) +{ + double contrast; + + contrast = drv_D4D_contrast(R2N(arg1)); + SetResult(&result, R_NUMBER, &contrast); +} + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +int drv_D4D_list(void) +{ + printf("4D Systems Display Graphics Modules"); + return 0; +} + + +int drv_D4D_init(const char *section, const int quiet) +{ + /* error("drv_D4D_init()"); */ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 897 $"); + + if ((ret = drv_D4D_start(section)) != 0) + return ret; + + if (EXTRA) + CHARS = 64; + else + CHARS = 32; + CHAR0 = 128; + GOTO_COST = 7; + + if (MODE) { + drv_generic_graphic_real_blit = drv_D4D_blit; + } else { + drv_generic_text_real_write = drv_D4D_write; + drv_generic_text_real_defchar = drv_D4D_defchar; + } + + + + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", NAME_, DCOLS, DROWS); + if (MODE) { + if (drv_generic_graphic_greet(buffer, "www.4dsystems.com.au")) { + sleep(3); + drv_generic_graphic_clear(); + } + } else { + if (drv_generic_text_greet(buffer, "www.4dsystems.com.au")) { + sleep(3); + drv_D4D_clear(); + } + } + } + + + if (MODE) { + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + } else { + + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + drv_generic_text_bar_add_segment(0, 0, 255, 32); + + + wc = Widget_Text; + wc.draw = drv_D4D_text_draw; + widget_register(&wc); + + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + wc = Widget_Bar; + wc.draw = drv_D4D_bar_draw; + widget_register(&wc); + + } + + AddFunction("LCD::contrast", 1, plugin_contrast); + + return 0; +} + + +int drv_D4D_quit(const int quiet) +{ + /* error("drv_D4D_quit()"); */ + + info("%s: shutting down.", Name); + + if (MODE == 0) + drv_generic_text_quit(); + + + if (!NOPOWERCYCLE) { + drv_D4D_clear(); + } + + if (!quiet) { + if (MODE) + drv_generic_graphic_greet("goodbye!", NULL); + else + drv_generic_text_greet("goodbye!", NULL); + } + + /* fade */ + /*int i; + for(i=CONTRAST_;i>=0;i--) { + drv_D4D_contrast(i); + usleep(1000); + } */ + + if (MODE) + drv_generic_graphic_quit(); + + if (!NOPOWERCYCLE) { + char powerDown[] = { 'Y', 3, 0 }; + drv_D4D_send(powerDown, sizeof(powerDown)); + } + + debug("closing connection"); + drv_D4D_close(); + + return (0); +} + + + +DRIVER drv_D4D = { + .name = Name, + .list = drv_D4D_list, + .init = drv_D4D_init, + .quit = drv_D4D_quit, +}; diff --git a/drv_EA232graphic.c b/drv_EA232graphic.c index f98a738..680ffe9 100644 --- a/drv_EA232graphic.c +++ b/drv_EA232graphic.c @@ -1,10 +1,10 @@ -/* $Id: drv_EA232graphic.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_EA232graphic.c $ +/* $Id: drv_EA232graphic.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_EA232graphic.c $ * * Driver for Electronic Assembly serial graphic display * * Copyright (C) 2007 Stefan Gmeiner <stefangmeiner@solnet.ch> - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_EFN.c b/drv_EFN.c new file mode 100644 index 0000000..dca226c --- /dev/null +++ b/drv_EFN.c @@ -0,0 +1,414 @@ +/* $Id: drv_Sample.c 773 2007-02-25 12:39:09Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Sample.c $ + * + * lcd4linux driver for EFN LED modules (manufacturer: COMFILE/South Korea) + * connected to the ethernet to serial converter EUG 100 (manufacturer ELV/ + * Germany) + * + * Up to 256 EFN LED modules listen on a serial bus (9600 BAUD, 1 stop bit, + * no parity) and are controlled by a 3 byte protocol: + * Byte 1: 0xff + * Byte 2: <module address> + * Byte 3: <Ascii value of character to be diplayed> + * The module address of each EFN LED module is set hy solder bridges. + * The driver expects the EFN LED modules to be configured starting + * from address 1. The EFN LED module set to address 1 is the right + * most module. + * + * The EUG 100 is an ethernet to seriell converter. The IP address + * can be set by dhcp. It listens on ports 1000 (data) and 1001 + * (configuration). Data received on port 1000 is sent onto the serial bus, + * while data sent to configuration port sets format of the EUG 100's + * serial interface. + * Due to a bug in the firmware, the transmission is interrupted if '\0' (0x00) + * is received on port 1000. Consequently, none of the EFN LED modules shall + * be set to address 0. + * + * Copyright (C) 2010 Tilman Glötzner <tilmanglotzner@hotmail.com> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * +* You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_EFN + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <strings.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +/* text mode display */ +#include "drv_generic_text.h" + + + +static char Name[] = "EFN"; + +char Host[256]; +int Port; +int DataSocket; + +static void drv_EFN_clear(void); + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_EFN_open(const char *section) +{ + int sockfd_conf, portno_conf, n; + struct sockaddr_in serv_addr; + struct sockaddr_in conf_addr; + struct hostent *server; + char buffer[5]; + + /* open tcp sockets to config port to EUG 100 t0 set serial parameter */ + /* 9600 BAUD; no parity; 1 stop bit */ + // socket to config EUG + portno_conf = Port + 1; + sockfd_conf = socket(AF_INET, SOCK_STREAM, 0); + if (sockfd_conf < 0) { + error("ERROR opening config socket"); + return -1; + } + // resolve DNS name of EFN server (= EUG 100) + server = gethostbyname(Host); + if (server == NULL) { + error("ERROR, no such host\n"); + return -1; + } + // socket addr for config socket + bzero((char *) &conf_addr, sizeof(struct sockaddr_in)); + conf_addr.sin_family = AF_INET; + bcopy((char *) server->h_addr, (char *) &conf_addr.sin_addr.s_addr, server->h_length); + conf_addr.sin_port = htons(portno_conf); + + // open config socket + if (connect(sockfd_conf, (struct sockaddr *) &conf_addr, sizeof(struct sockaddr_in)) < 0) { + error("ERROR connecting to config port"); + return -1; + } + // sent config message + + bzero(buffer, 5); + buffer[0] = '4'; + buffer[1] = '0'; + buffer[2] = '1'; + + + n = write(sockfd_conf, buffer, 3); + if (n < 0) { + error("ERROR writing to config socket"); + close(sockfd_conf); + return -1; + } + close(sockfd_conf); + + // open data socket + + DataSocket = socket(AF_INET, SOCK_STREAM, 0); + if (DataSocket < 0) { + error("ERROR opening data socket"); + return -1; + } + // socket addr for data socket + bzero((char *) &serv_addr, sizeof(struct sockaddr_in)); + serv_addr.sin_family = AF_INET; + bcopy((char *) server->h_addr, (char *) &serv_addr.sin_addr.s_addr, server->h_length); + serv_addr.sin_port = htons(Port); + + if (connect(DataSocket, (struct sockaddr *) &serv_addr, sizeof(struct sockaddr_in)) < 0) { + error("ERROR connecting to data socket"); + return -1; + } + return 0; +} + + +static int drv_EFN_close(void) +{ + /* close whatever port you've opened */ + drv_EFN_clear(); + close(DataSocket); + return 0; +} + + +/* dummy function that sends something to the display */ +static void drv_EFN_send(const char *data, const unsigned int len) +{ + int n, i; + + // transport command stirng to EUG 100 + n = write(DataSocket, data, len); + + if (n < 0) { + error("%s:drv_EFN_send: Failed to write to data socket\n", Name); + // return(-1); + } + /* + printf("EFN_send: "); + for(i=0;i<n;i++) + { + printf("0x%02x ",data[i]); + } + printf("\n"); + */ +} + + +/* text mode displays only */ +static void drv_EFN_clear(void) +{ + char *cmd; + int max_char, max_cmd, k; + + max_char = DROWS * DCOLS; + max_cmd = 3 * max_char; // each EFN module expects 3 bytes + + if ((cmd = malloc(max_cmd)) == NULL) { + error("%s : Failed to allocate memory in drv_Sample_write\n", Name); + // return -1; + } else { + /* do whatever is necessary to clear the display */ + for (k = 0; k < max_char; k++) { + cmd[(3 * k) + 0] = 0xff; + cmd[(3 * k) + 1] = k + 1; + cmd[(3 * k) + 2] = ' '; + } + drv_EFN_send(cmd, max_cmd); + drv_EFN_send(cmd, max_cmd); + free(cmd); + //return 0; + } +} + + +/* text mode displays only */ +static void drv_EFN_write(const int row, const int col, const char *data, int len) +{ + char *cmd; + int offset, i, k, max_char, max_cmd; + + max_char = DROWS * DCOLS; + max_cmd = 3 * max_char; // each LED blocks expects a 3 byte sequence + + + if ((cmd = (char *) malloc(max_cmd)) == NULL) { + error("%s : Failed to allocate memory in drv_Sample_write\n", Name); + //return -1; + } else { + /* do the cursor positioning here */ + + offset = ((row) * DCOLS) + col; + + for (i = max_char - offset, k = 0; ((i > 0) && (k < len)); i--, k++) { + cmd[(3 * k) + 0] = 0xff; + cmd[(3 * k) + 1] = i; + cmd[(3 * k) + 2] = data[k]; + } + + /* send string to the display twice (to make transmission + * reliable) */ + drv_EFN_send(cmd, 3 * (k)); + drv_EFN_send(cmd, 3 * (k)); + + free(cmd); + // return 0; + } +} + +static void drv_EFN_defchar(const int ascii, const unsigned char *matrix) +{ + error("%s:drv_EFN_defchar: Function not supported by EFN modules\n", Name); +} + +/* start text mode display */ +static int drv_EFN_start(const char *section) +{ + int rows = -1, cols = -1; + char *s; + + s = cfg_get(section, "Host", NULL); + + if (s == NULL || *s == '\0') { + error("%s: no '%s.Host' entry from %s", Name, section, cfg_source()); + return -1; + } + + if (sscanf(s, "%s", &Host) != 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + if (cfg_number(section, "Port", 1000, 0, 65535, &Port) < 0) + return -1; + + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* open communication with the display */ + if (drv_EFN_open(section) < 0) { + return -1; + } + + /* initialize display */ + drv_EFN_clear(); /* clear display */ + + return 0; +} + + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_EFN_list(void) +{ + printf("EFN LED modules + EUG100 Ethernet to serial convertor"); + return 0; +} + + +/* initialize driver & display */ +/* use this function for a text display */ +int drv_EFN_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 773 $"); + + /* display preferences */ + + /* real worker functions */ + drv_generic_text_real_write = drv_EFN_write; + drv_generic_text_real_defchar = drv_EFN_defchar; + + + /* start display */ + if ((ret = drv_EFN_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + sleep(3); + drv_EFN_clear(); + + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + return 0; +} + + + + +/* close driver & display */ +/* use this function for a text display */ +int drv_EFN_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + /* clear display */ + drv_EFN_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + debug("closing connection"); + drv_EFN_close(); + + return (0); +} + +/* close driver & display */ +/* use this one for a text display */ +DRIVER drv_EFN = { + .name = Name, + .list = drv_EFN_list, + .init = drv_EFN_init, + .quit = drv_EFN_quit, +}; diff --git a/drv_FW8888.c b/drv_FW8888.c new file mode 100644 index 0000000..67fc9a8 --- /dev/null +++ b/drv_FW8888.c @@ -0,0 +1,309 @@ +/* $Id: drv_FW8888.c 1123 2010-06-21 02:07:13Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_FW8888.c $ + * + * driver for Allnet FW8888 display + * + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 2010 Linum Software GmbH <support@linum.com> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_FW8888 + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +/* text mode display? */ +#include "drv_generic_text.h" + +/* serial port? */ +#include "drv_generic_serial.h" + +static char Name[] = "FW8888"; + + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_FW8888_open(const char *section) +{ + /* open serial port */ + /* don't mind about device, speed and stuff, this function will take care of */ + + if (drv_generic_serial_open(section, Name, 0) < 0) + return -1; + + return 0; +} + + +static int drv_FW8888_close(void) +{ + /* close whatever port you've opened */ + drv_generic_serial_close(); + + return 0; +} + + +static void drv_FW8888_send_cmd(const unsigned int cmd) +{ + char cmd_str[2]; + + cmd_str[0] = 0x10; + cmd_str[1] = cmd; + drv_generic_serial_write(cmd_str, 2); +} + + +static void drv_FW8888_send_text(const char *text, const unsigned int len) +{ + unsigned int i; + char cmd_str[2]; + + cmd_str[0] = 0x12; + + for (i = 0; i < len; i++) { + cmd_str[1] = text[i]; + drv_generic_serial_write(cmd_str, 2); + } +} + +/* text mode displays only */ +static void drv_FW8888_clear(void) +{ + drv_FW8888_send_cmd(0x01); +} + +static void drv_FW8888_home(void) +{ + drv_FW8888_send_cmd(0x02); +} + +static void drv_FW8888_display_off(void) +{ + drv_FW8888_send_cmd(0x08); +} + +static void drv_FW8888_display_on_cursor_off(void) +{ + drv_FW8888_send_cmd(0x0C); +} + +static void drv_FW8888_display_on_cursor_on(void) +{ + drv_FW8888_send_cmd(0x0E); +} + +static void drv_FW8888_backlight_off(void) +{ + drv_FW8888_send_cmd(0x38); +} + +static void drv_FW8888_backlight_on(void) +{ + drv_FW8888_send_cmd(0x39); +} + +static void drv_FW8888_set_cursor(int row, int col) +{ + int pos; + switch (row) { + case 0: + pos = 0x80 + col; + break; + case 1: + pos = 0xC0 + col; + break; + default: + error("%s: invalid row(%d) or col(%d)", Name, row, col); + return; + } + drv_FW8888_send_cmd(pos); +} + + +/* text mode displays only */ +static void drv_FW8888_write(const int row, const int col, const char *data, int len) +{ + /* do the cursor positioning here */ + drv_FW8888_set_cursor(row, col); + + /* send string to the display */ + drv_FW8888_send_text(data, len); +} + + +/* start text mode display */ +static int drv_FW8888_start(const char *section) +{ + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 0; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + DROWS = 2; + DCOLS = 16; + + GOTO_COST = -1; /* number of bytes a goto command requires */ + + /* open communication with the display */ + if (drv_FW8888_open(section) < 0) { + return -1; + } + + drv_FW8888_clear(); /* clear display */ + + return 0; +} + + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +/* none */ + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_FW8888_list(void) +{ + printf("Allnet-FW8888"); + return 0; +} + + +/* initialize driver & display */ +/* use this function for a text display */ +int drv_FW8888_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 1123 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 7; /* pixel height of one char */ + CHARS = 0; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + + /* real worker functions */ + drv_generic_text_real_write = drv_FW8888_write; + + /* start display */ + if ((ret = drv_FW8888_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "www.linum.com")) { + sleep(3); + drv_FW8888_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register plugins */ + // AddFunction("LCD::contrast", 1, plugin_contrast); + + return 0; +} + + +/* close driver & display */ +/* use this function for a text display */ +int drv_FW8888_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + /* clear display */ + drv_FW8888_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + debug("closing connection"); + drv_FW8888_close(); + + return (0); +} + + +/* use this one for a text display */ +DRIVER drv_FW8888 = { + .name = Name, + .list = drv_FW8888_list, + .init = drv_FW8888_init, + .quit = drv_FW8888_quit, +}; @@ -1,10 +1,10 @@ -/* $Id: drv_G15.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_G15.c $ +/* $Id: drv_G15.c 1117 2010-04-18 11:47:58Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_G15.c $ * * Driver for Logitech G-15 keyboard LCD screen * * Copyright (C) 2006 Dave Ingram <dave@partis-project.net> - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -45,6 +45,9 @@ #include <linux/input.h> #include <linux/uinput.h> +#include <unistd.h> +#include <sys/types.h> + #include "debug.h" #include "cfg.h" #include "qprintf.h" @@ -54,8 +57,14 @@ #include "drv_generic_graphic.h" #include "thread.h" +/* Logitech: VendorID 0x046d */ #define G15_VENDOR 0x046d +/* Logitech Keyboard G15: ProductID 0xc222, 0xc227 */ +/* Logitech Speaker Z10: ProductID 0x0a07 */ #define G15_DEVICE 0xc222 +#define G15_DEVICE2 0xc227 +#define Z10_DEVICE 0x0a07 +#define M1730_DEVICE 0xc251 #if 0 #define DEBUG(x) debug("%s(): %s", __FUNCTION__, x); @@ -80,6 +89,8 @@ static int kb_mutex; static int kb_thread_pid; static int kb_single_keypress = 0; +static int usb_endpoint = 0; + /****************************************/ /*** hardware dependant functions ***/ @@ -301,36 +312,108 @@ static int drv_G15_open() struct usb_bus *bus; struct usb_device *dev; char dname[32] = { 0 }; + int interf = -1; + int config = 1; + int retval; g15_lcd = NULL; - info("%s: Scanning USB for G-15 keyboard...", Name); + info("%s: Scanning USB for G-15 keyboard or Z-10 speaker ...", Name); usb_init(); - usb_set_debug(0); - usb_find_busses(); - usb_find_devices(); + usb_set_debug(0); // 0: no, 1 error, 2 warn, 3 info + debug("%s: found %d USB busses", Name, usb_find_busses()); + debug("%s: found %d USB devices", Name, usb_find_devices()); for (bus = usb_get_busses(); bus; bus = bus->next) { for (dev = bus->devices; dev; dev = dev->next) { - if ((g15_lcd = usb_open(dev))) { - if ((dev->descriptor.idVendor == G15_VENDOR) && (dev->descriptor.idProduct == G15_DEVICE)) { + debug("%s: open %s/%s/%s", Name, bus->dirname, dev->bus->dirname, dev->filename); + if (dev->descriptor.idVendor == G15_VENDOR) { + if ((g15_lcd = usb_open(dev))) { + // get vendor name if possible + if (dev->descriptor.iManufacturer) { + retval = usb_get_string_simple(g15_lcd, dev->descriptor.iManufacturer, dname, sizeof(dname)); + if (retval <= 0) { + snprintf(dname, sizeof(dname), "(unknown)"); + } + } + debug("%s: Found USB vendor ID 0x%x (%s), checking productID 0x%x...", + Name, G15_VENDOR, dname, dev->descriptor.idProduct); + switch (dev->descriptor.idProduct) { + case G15_DEVICE: + case G15_DEVICE2: + case M1730_DEVICE: + { + info("%s: Found Logitech G-15 or Dell M1730 Keyboard", Name); + interf = 0; + config = 1; + usb_endpoint = 0x02; + break; + } + case Z10_DEVICE: + { + info("%s: Found Logitech Z-10 Speaker", Name); + interf = 2; + usb_endpoint = 0x03; + break; + } + default: + debug("%s: Don't found USB product IDs 0x%x|0x%x/0x%x for G-15/M1730 or 0x%x for Z10", + Name, G15_DEVICE, G15_DEVICE2, M1730_DEVICE, Z10_DEVICE); + usb_close(g15_lcd); + } - /* detach from the kernel if we need to */ - int retval = usb_get_driver_np(g15_lcd, 0, dname, 31); - if (retval == 0 && strcmp(dname, "usbhid") == 0) { - usb_detach_kernel_driver_np(g15_lcd, 0); + if (interf >= 0) { + debug("%s: Vendor 0x%x Product 0x%x found", + Name, dev->descriptor.idVendor, dev->descriptor.idProduct); + +#ifdef LIBUSB_HAS_GET_DRIVER_NP + /* detach from the kernel if we need to */ + retval = usb_get_driver_np(g15_lcd, interf, dname, 31); + debug("%s: Ret %i from usb_get_driver_np(interf.%d), Drivername %s", + Name, retval, interf, dname); + switch (retval) { + case -EPERM: + error("%s: Permission denied! eUID of this process is %i %s", + Name, geteuid(), geteuid() != 0 ? "(not root)" : ""); + //return -1; + break; + case -ENODATA: + error("%s: No data available! Device switched off?", Name); + //return -1; + break; + } +#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP + if (retval == 0 && strcmp(dname, "usbhid") == 0) { + debug("%s: detaching...", Name); + usb_detach_kernel_driver_np(g15_lcd, interf); + } +#endif // detach_kernel_driver_np +#endif // get_driver_np + + retval = usb_set_configuration(g15_lcd, config); + debug("%s: Ret %d from usb_set_configuration(%d)", Name, retval, config); + switch (retval) { + case -EPERM: + error("%s: Permission denied! eUID of this process is %i %s", + Name, geteuid(), geteuid() != 0 ? "(not root)" : ""); + return -1; + break; + case -EBUSY: + error("%s: Device or resource busy! Device switched off?", Name); + return -1; + break; + } + usleep(100); + retval = usb_claim_interface(g15_lcd, interf); + debug("%s: Ret %i from usb_claim_interface(%d)", Name, retval, interf); + return retval; } - usb_set_configuration(g15_lcd, 1); - usleep(100); - usb_claim_interface(g15_lcd, 0); - return 0; - } else { - usb_close(g15_lcd); + } - } - } - } + } // G15_Vendor + } // all devices + } // all busses return -1; } @@ -349,31 +432,33 @@ static int drv_G15_close(void) static void drv_G15_update_img() { int i, j, k; - unsigned char *output = malloc(160 * 43 * sizeof(unsigned char)); + unsigned char *output = malloc(DCOLS * DROWS * sizeof(unsigned char)); + int retval; DEBUG("entered"); if (!output) return; DEBUG("memory allocated"); - memset(output, 0, 160 * 43); + memset(output, 0, DCOLS * DROWS); DEBUG("memory set"); output[0] = 0x03; DEBUG("first output set"); for (k = 0; k < 6; k++) { - for (i = 0; i < 160; i++) { + for (i = 0; i < DCOLS; i++) { int maxj = (k == 5) ? 3 : 8; for (j = 0; j < maxj; j++) { - if (g15_image[(k * 1280) + i + (j * 160)]) - output[32 + i + (k * 160)] |= (1 << j); + if (g15_image[(k * 1280) + i + (j * DCOLS)]) + output[32 + i + (k * DCOLS)] |= (1 << j); } } } DEBUG("output array prepared"); mutex_lock(kb_mutex); - usb_interrupt_write(g15_lcd, 0x02, (char *) output, 992, 1000); + retval = usb_interrupt_write(g15_lcd, usb_endpoint, (char *) output, 992, 1000); + //info("%s: Ret %i from usb_interrupt_write(endpoint %d)", Name, retval, usb_endpoint); mutex_unlock(kb_mutex); usleep(300); @@ -396,7 +481,7 @@ static void drv_G15_blit(const int row, const int col, const int height, const i for (r = row; r < row + height; r++) { for (c = col; c < col + width; c++) { - g15_image[r * 160 + c] = drv_generic_graphic_black(r, c); + g15_image[r * DCOLS + c] = drv_generic_graphic_black(r, c); } } @@ -444,11 +529,11 @@ static int drv_G15_start(const char *section) DEBUG("allocating image buffer"); /* you surely want to allocate a framebuffer or something... */ - g15_image = malloc(160 * 43 * sizeof(unsigned char)); + g15_image = malloc(DCOLS * DROWS * sizeof(unsigned char)); if (!g15_image) return -1; DEBUG("allocated"); - memset(g15_image, 0, 160 * 43); + memset(g15_image, 0, DCOLS * DROWS); DEBUG("zeroed"); /* open communication with the display */ @@ -501,7 +586,7 @@ static int drv_G15_start(const char *section) /* list models */ int drv_G15_list(void) { - printf("generic"); + printf("Logitech G-15 or Z-10 / Dell M1730"); return 0; } @@ -511,7 +596,7 @@ int drv_G15_init(const char *section, const int quiet) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1117 $"); DEBUG("entered"); diff --git a/drv_GLCD2USB.c b/drv_GLCD2USB.c new file mode 100644 index 0000000..c9f5618 --- /dev/null +++ b/drv_GLCD2USB.c @@ -0,0 +1,641 @@ +/* $Id: drv_GLCD2USB.c 1134 2010-11-20 20:22:05Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_GLCD2USB.c $ + * + * GLCD2USB driver for LCD4Linux + * (see http://www.harbaum.org/till/glcd2usb for hardware) + * + * Copyright (C) 2007 Till Harbaum <till@harbaum.org> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_GLCD2USB + * + */ + +/* + * Options: + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <fcntl.h> +#include <sys/time.h> +#include <usb.h> + +#include "debug.h" +#include "cfg.h" +#include "timer.h" +#include "qprintf.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "widget_keypad.h" +#include "drv.h" +#include "drv_generic_graphic.h" +#include "drv_generic_keypad.h" + +/* Numeric constants for 'reportType' parameters */ +#define USB_HID_REPORT_TYPE_INPUT 1 +#define USB_HID_REPORT_TYPE_OUTPUT 2 +#define USB_HID_REPORT_TYPE_FEATURE 3 + +/* These are the error codes which can be returned by functions of this + * module. + */ +#define USB_ERROR_NONE 0 +#define USB_ERROR_ACCESS 1 +#define USB_ERROR_NOTFOUND 2 +#define USB_ERROR_BUSY 16 +#define USB_ERROR_IO 5 + +/* ------------------------------------------------------------------------ */ + +#include "glcd2usb.h" + +/* ------------------------------------------------------------------------- */ + +#define USBRQ_HID_GET_REPORT 0x01 +#define USBRQ_HID_SET_REPORT 0x09 + +usb_dev_handle *dev = NULL; + +/* USB message buffer */ +static union { + unsigned char bytes[132]; + display_info_t display_info; +} buffer; + +/* ------------------------------------------------------------------------- */ + + +#define IDENT_VENDOR_NUM 0x1c40 +#define IDENT_VENDOR_STRING "www.harbaum.org/till/glcd2usb" +#define IDENT_PRODUCT_NUM 0x0525 +#define IDENT_PRODUCT_STRING "GLCD2USB" + +/* early versions used the ftdi vendor id */ +#define IDENT_VENDOR_NUM_OLD 0x0403 +#define IDENT_PRODUCT_NUM_OLD 0xc634 + +static char Name[] = IDENT_PRODUCT_STRING; + +/* ------------------------------------------------------------------------- */ + +static int usbGetString(usb_dev_handle * dev, int index, char *buf, int buflen) +{ + char buffer[256]; + int rval, i; + + if ((rval = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8) + index, 0x0409, buffer, sizeof(buffer), 1000)) < 0) + return rval; + + /* not a string */ + if (buffer[1] != USB_DT_STRING) + return 0; + + /* string would have been longer than buffer is */ + if ((unsigned char) buffer[0] < rval) + rval = (unsigned char) buffer[0]; + + /* 16 bit unicode -> 8 bit ascii */ + rval /= 2; + + /* lossy conversion to ISO Latin1 */ + for (i = 1; i < rval; i++) { + if (i > buflen) /* destination buffer overflow */ + break; + + buf[i - 1] = buffer[2 * i]; + + if (buffer[2 * i + 1] != 0) /* outside of ISO Latin1 range */ + buf[i - 1] = '?'; + } + + /* terminate string */ + buf[i - 1] = 0; + + return i - 1; +} + +/* ------------------------------------------------------------------------- */ + +int usbOpenDevice(usb_dev_handle ** device, int vendor, char *vendorName, int product, char *productName) +{ + struct usb_bus *bus; + struct usb_device *dev; + usb_dev_handle *handle = NULL; + int errorCode = USB_ERROR_NOTFOUND; + static int didUsbInit = 0; + + if (!didUsbInit) { + usb_init(); + didUsbInit = 1; + } + + usb_find_busses(); + usb_find_devices(); + + for (bus = usb_get_busses(); bus; bus = bus->next) { + for (dev = bus->devices; dev; dev = dev->next) { + if (dev->descriptor.idVendor == vendor && dev->descriptor.idProduct == product) { + char string[256]; + int len; + handle = usb_open(dev); /* we need to open the device in order to query strings */ + if (!handle) { + errorCode = USB_ERROR_ACCESS; + error("%s Warning: cannot open USB device: %s", Name, usb_strerror()); + continue; + } + if (vendorName == NULL && productName == NULL) { /* name does not matter */ + break; + } + /* now check whether the names match: */ + len = usbGetString(handle, dev->descriptor.iManufacturer, string, sizeof(string)); + if (len < 0) { + errorCode = USB_ERROR_IO; + error("%s: Cannot query manufacturer for device: %s", Name, usb_strerror()); + } else { + errorCode = USB_ERROR_NOTFOUND; + if (strcmp(string, vendorName) == 0) { + len = usbGetString(handle, dev->descriptor.iProduct, string, sizeof(string)); + if (len < 0) { + errorCode = USB_ERROR_IO; + fprintf(stderr, "Warning: cannot query product for device: %s\n", usb_strerror()); + } else { + errorCode = USB_ERROR_NOTFOUND; + if (strcmp(string, productName) == 0) + break; + } + } + } + usb_close(handle); + handle = NULL; + } + } + if (handle) + break; + } + + if (handle != NULL) { + int rval, retries = 3; + if (usb_set_configuration(handle, 1)) { + fprintf(stderr, "Warning: could not set configuration: %s\n", usb_strerror()); + } + /* now try to claim the interface and detach the kernel HID driver on + * linux and other operating systems which support the call. + */ + while ((rval = usb_claim_interface(handle, 0)) != 0 && retries-- > 0) { +#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP + if (usb_detach_kernel_driver_np(handle, 0) < 0) { + fprintf(stderr, "Warning: could not detach kernel HID driver: %s\n", usb_strerror()); + } +#endif + } +#ifndef __APPLE__ + if (rval != 0) + fprintf(stderr, "Warning: could not claim interface\n"); +#endif + /* Continue anyway, even if we could not claim the interface. Control transfers + * should still work. + */ + errorCode = 0; + *device = handle; + } + return errorCode; +} + +/* ------------------------------------------------------------------------- */ + +void usbCloseDevice(usb_dev_handle * device) +{ + if (device != NULL) + usb_close(device); +} + +/* ------------------------------------------------------------------------- */ + +int usbSetReport(usb_dev_handle * device, int reportType, unsigned char *buffer, int len) +{ + int bytesSent; + + /* the write command needs some tweaking regarding allowed report lengths */ + if (buffer[0] == GLCD2USB_RID_WRITE) { + int i = 0, allowed_lengths[] = { 4 + 4, 8 + 4, 16 + 4, 32 + 4, 64 + 4, 128 + 4 }; + + if (len > 128 + 4) + error("%s: %d bytes usb report is too long \n", Name, len); + + while (allowed_lengths[i] != (128 + 4) && allowed_lengths[i] < len) + i++; + + len = allowed_lengths[i]; + buffer[0] = GLCD2USB_RID_WRITE + i; + } + + bytesSent = usb_control_msg(device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | + USB_ENDPOINT_OUT, USBRQ_HID_SET_REPORT, + reportType << 8 | buffer[0], 0, (char *) buffer, len, 1000); + if (bytesSent != len) { + if (bytesSent < 0) + error("%s: Error sending message: %s", Name, usb_strerror()); + return USB_ERROR_IO; + } + return 0; +} + +/* ------------------------------------------------------------------------- */ + +int usbGetReport(usb_dev_handle * device, int reportType, int reportNumber, unsigned char *buffer, int *len) +{ + *len = usb_control_msg(device, USB_TYPE_CLASS | USB_RECIP_INTERFACE | + USB_ENDPOINT_IN, USBRQ_HID_GET_REPORT, + reportType << 8 | reportNumber, 0, (char *) buffer, *len, 1000); + if (*len < 0) { + error("%s: Error sending message: %s", Name, usb_strerror()); + return USB_ERROR_IO; + } + return 0; +} + +char *usbErrorMessage(int errCode) +{ + static char buffer[80]; + + switch (errCode) { + case USB_ERROR_ACCESS: + return "Access to device denied"; + case USB_ERROR_NOTFOUND: + return "The specified device was not found"; + case USB_ERROR_BUSY: + return "The device is used by another application"; + case USB_ERROR_IO: + return "Communication error with device"; + default: + sprintf(buffer, "Unknown USB error %d", errCode); + return buffer; + } + return NULL; /* not reached */ +} + +static char *video_buffer = NULL; +static char *dirty_buffer = NULL; + +static void drv_GLCD2USB_blit(const int row, const int col, const int height, const int width) +{ + int r, c, err, i, j; + + /* update offscreen buffer */ + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) { + int x, y, bit; + + /* these assignments are display layout dependent */ + x = c; + y = r / 8; + bit = r % 8; + + i = video_buffer[x + DCOLS * y]; + + if (drv_generic_graphic_black(r, c)) + video_buffer[x + DCOLS * y] |= 1 << bit; + else + video_buffer[x + DCOLS * y] &= ~(1 << bit); + + if (video_buffer[x + DCOLS * y] != i) + dirty_buffer[x + DCOLS * y] |= 1 << bit; + } + } + +#if 0 + /* display what's in the buffer (for debugging) */ + for (r = 0; r < DROWS; r++) { + for (c = 0; c < DCOLS; c++) { + if (video_buffer[c + DCOLS * (r / 8)] & (1 << (r % 8))) + putchar('#'); + else + putchar(' '); + } + putchar('\n'); + } +#endif + + /* short gaps of unchanged bytes in fact increase the communication */ + /* overhead. so we eliminate them here */ + for (j = -1, i = 0; i < DROWS * DCOLS / 8; i++) { + if (dirty_buffer[i] && j >= 0 && i - j <= 4) { + /* found a clean gap <= 4 bytes: mark it dirty */ + for (r = j; r < i; r++) + dirty_buffer[r] = 1; + } + + /* if this is dirty, drop the saved position */ + if (dirty_buffer[i]) + j = -1; + + /* save position of this clean entry if there's no position saved yet */ + if (!dirty_buffer[i] && j < 0) + j = i; + } + + /* and do the actual data transmission */ + buffer.bytes[0] = 0; + for (i = 0; i < DROWS * DCOLS / 8; i++) { + if (dirty_buffer[i]) { + /* starting a new run? */ + if (!buffer.bytes[0]) { + buffer.bytes[0] = GLCD2USB_RID_WRITE; + buffer.bytes[1] = i % 256; // offset + buffer.bytes[2] = i / 256; + buffer.bytes[3] = 0; // length + } + buffer.bytes[4 + buffer.bytes[3]++] = video_buffer[i]; + } + + /* this part of the buffer is not dirty or we are at end */ + /* of buffer or the buffer is fill: send data then */ + if ((!dirty_buffer[i]) || (i == DROWS * DCOLS / 8 - 1) || (buffer.bytes[3] == 128)) { + /* is there data to be sent in the buffer? */ + if (buffer.bytes[0] && buffer.bytes[3]) { + if ((err = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer.bytes, buffer.bytes[3] + 4)) != 0) + error("%s: Error sending display contents: %s", Name, usbErrorMessage(err)); + + buffer.bytes[0] = 0; + } + } + + /* this entry isn't dirty anymore */ + dirty_buffer[i] = 0; + } +} + +static int drv_GLCD2USB_brightness(int brightness) +{ + int err = 0; + + printf("setting bright to %d\n", brightness); + + if (brightness < 0) + brightness = 0; + if (brightness > 255) + brightness = 255; + + buffer.bytes[0] = GLCD2USB_RID_SET_BL; + buffer.bytes[1] = brightness; + if ((err = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer.bytes, 2)) != 0) { + error("%s: Error freeing display: %s\n", Name, usbErrorMessage(err)); + usbCloseDevice(dev); + return -1; + } + + return brightness; +} + +static void drv_GLCD2USB_timer(void __attribute__ ((unused)) * notused) +{ + /* request button state */ + static unsigned int last_but = 0; + int err = 0, len = 2; + + if ((err = usbGetReport(dev, USB_HID_REPORT_TYPE_FEATURE, GLCD2USB_RID_GET_BUTTONS, buffer.bytes, &len)) != 0) { + fprintf(stderr, "Error getting button state: %s\n", usbErrorMessage(err)); + return; + } + + int i; + + /* check if button state changed */ + if (buffer.bytes[1] ^ last_but) { + + /* send single keypad events for all changed buttons */ + for (i = 0; i < 4; i++) + if ((buffer.bytes[1] & (1 << i)) ^ (last_but & (1 << i))) + drv_generic_keypad_press(((buffer.bytes[1] & (1 << i)) ? 0x80 : 0) | i); + } + + last_but = buffer.bytes[1]; +} + +static int drv_GLCD2USB_start(const char *section) +{ + int brightness; + char *s; + int err = 0, len; + + if (sscanf(s = cfg_get(section, "font", "6x8"), "%dx%d", &XRES, &YRES) != 2 || XRES < 1 || YRES < 1) { + error("%s: bad %s.Font '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + free(s); + + if ((err = usbOpenDevice(&dev, IDENT_VENDOR_NUM, IDENT_VENDOR_STRING, + IDENT_PRODUCT_NUM, IDENT_PRODUCT_STRING)) != 0) { + if ((err = usbOpenDevice(&dev, IDENT_VENDOR_NUM_OLD, IDENT_VENDOR_STRING, + IDENT_PRODUCT_NUM_OLD, IDENT_PRODUCT_STRING)) != 0) { + error("%s: opening GLCD2USB device: %s", Name, usbErrorMessage(err)); + return -1; + } + } + + info("%s: Found device", Name); + + /* query display parameters */ + memset(&buffer, 0, sizeof(buffer)); + + len = sizeof(display_info_t); + if ((err = usbGetReport(dev, USB_HID_REPORT_TYPE_FEATURE, GLCD2USB_RID_GET_INFO, buffer.bytes, &len)) != 0) { + + error("%s: query display parameters: %s", Name, usbErrorMessage(err)); + usbCloseDevice(dev); + return -1; + } + + if (len < (int) sizeof(buffer.display_info)) { + error("%s: Not enough bytes in display info report (%d instead of %d)", + Name, len, (int) sizeof(buffer.display_info)); + usbCloseDevice(dev); + return -1; + } + + info("%s: display name = %s", Name, buffer.display_info.name); + info("%s: display resolution = %d * %d", Name, buffer.display_info.width, buffer.display_info.height); + info("%s: display flags: %x", Name, buffer.display_info.flags); + + /* TODO: check for supported features */ + + + /* save display size */ + DCOLS = buffer.display_info.width; + DROWS = buffer.display_info.height; + + /* allocate a offscreen buffer */ + video_buffer = malloc(DCOLS * DROWS / 8); + dirty_buffer = malloc(DCOLS * DROWS / 8); + memset(video_buffer, 0, DCOLS * DROWS / 8); + memset(dirty_buffer, 0, DCOLS * DROWS / 8); + + /* get access to display */ + buffer.bytes[0] = GLCD2USB_RID_SET_ALLOC; + buffer.bytes[1] = 1; /* 1=alloc, 0=free */ + if ((err = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer.bytes, 2)) != 0) { + error("%s: Error allocating display: %s", Name, usbErrorMessage(err)); + usbCloseDevice(dev); + return -1; + } + + /* regularly request key state. can be quite slow since the device */ + /* buffers button presses internally */ + timer_add(drv_GLCD2USB_timer, NULL, 100, 0); + + if (cfg_number(section, "Brightness", 0, 0, 255, &brightness) > 0) { + drv_GLCD2USB_brightness(brightness); + } + + return 0; +} + + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_brightness(RESULT * result, RESULT * arg1) +{ + double brightness; + + brightness = drv_GLCD2USB_brightness(R2N(arg1)); + SetResult(&result, R_NUMBER, &brightness); +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_graphic_draw(W) */ +/* using drv_generic_graphic_icon_draw(W) */ +/* using drv_generic_graphic_bar_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_GLCD2USB_list(void) +{ + printf("GLCD2USB homebrew USB interface for graphic displays"); + return 0; +} + +static int drv_GLCD2USB_keypad(const int num) +{ + const int keys[] = { WIDGET_KEY_LEFT, WIDGET_KEY_RIGHT, + WIDGET_KEY_CONFIRM, WIDGET_KEY_CANCEL + }; + + int val; + + /* check for key press event */ + if (num & 0x80) + val = WIDGET_KEY_PRESSED; + else + val = WIDGET_KEY_RELEASED; + + return val | keys[num & 0x03]; +} + +/* initialize driver & display */ +int drv_GLCD2USB_init(const char *section, const __attribute__ ((unused)) + int quiet) +{ + int ret; + + info("%s: %s", Name, "$Rev: 1134 $"); + + /* real worker functions */ + drv_generic_graphic_real_blit = drv_GLCD2USB_blit; + drv_generic_keypad_real_press = drv_GLCD2USB_keypad; + + /* start display */ + if ((ret = drv_GLCD2USB_start(section)) != 0) + return ret; + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + /* register plugins */ + AddFunction("LCD::brightness", 1, plugin_brightness); + + return 0; +} + + +/* close driver & display */ +int drv_GLCD2USB_quit(const __attribute__ ((unused)) + int quiet) +{ + int err; + + info("%s: shutting down.", Name); + drv_generic_graphic_quit(); + + /* release access to display */ + + buffer.bytes[0] = GLCD2USB_RID_SET_ALLOC; + buffer.bytes[1] = 0; /* 1=alloc, 0=free */ + if ((err = usbSetReport(dev, USB_HID_REPORT_TYPE_FEATURE, buffer.bytes, 2)) != 0) { + error("%s Error freeing display: %s", Name, usbErrorMessage(err)); + } + + /* clean up */ + if (dev != NULL) + usbCloseDevice(dev); + + if (video_buffer != NULL) { + free(video_buffer); + free(dirty_buffer); + } + + return (0); +} + + +DRIVER drv_GLCD2USB = { + .name = Name, + .list = drv_GLCD2USB_list, + .init = drv_GLCD2USB_init, + .quit = drv_GLCD2USB_quit, +}; diff --git a/drv_HD44780.c b/drv_HD44780.c index 93faa83..fcc0c27 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -1,9 +1,9 @@ -/* $Id: drv_HD44780.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_HD44780.c $ +/* $Id: drv_HD44780.c 1066 2009-11-19 04:32:13Z edman007 $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_HD44780.c $ * * new style driver for HD44780-based displays * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * Support for I2C bus @@ -63,12 +63,15 @@ #include "widget_text.h" #include "widget_icon.h" #include "widget_bar.h" +#include "widget_keypad.h" #include "drv.h" #include "drv_generic_text.h" #include "drv_generic_gpio.h" #ifdef WITH_PARPORT #include "drv_generic_parport.h" +#include "drv_generic_keypad.h" +#include "widget_keypad.h" #endif #ifdef WITH_I2C @@ -109,6 +112,7 @@ static unsigned char SIGNAL_ENABLE4; static unsigned char SIGNAL_GPO; #ifdef WITH_PARPORT +static unsigned char SIGNAL_GPI; static unsigned char SIGNAL_BACKLIGHT; static unsigned char SIGNAL_POWER; #endif @@ -124,7 +128,10 @@ static unsigned char SIGNAL_POWER; static int UseBusy = 0; #endif -/* buffer holding the GPO state */ +/* which data bits should have their logic inverted */ +static int invert_data_bits = 0; + +/* buffer holding the GPIO state */ #ifdef WITH_PARPORT static unsigned char GPO = 0; #endif @@ -143,13 +150,14 @@ typedef struct { #define CAP_BUSY4BIT (1<<5) #define CAP_HD66712 (1<<6) #define CAP_LCM162 (1<<7) +#define CAP_GPI (1<<8) #define BUS_PP CAP_PARPORT #define BUS_I2C CAP_I2C static MODEL Models[] = { - {0x01, "generic", CAP_PARPORT | CAP_I2C | CAP_GPO | CAP_BACKLIGHT}, + {0x01, "generic", CAP_PARPORT | CAP_I2C | CAP_GPO | CAP_GPI | CAP_BACKLIGHT}, {0x02, "Noritake", CAP_PARPORT | CAP_I2C | CAP_GPO | CAP_BRIGHTNESS}, {0x03, "Soekris", CAP_PARPORT | CAP_BUSY4BIT}, {0x04, "HD66712", CAP_PARPORT | CAP_I2C | CAP_GPO | CAP_BACKLIGHT | CAP_HD66712}, @@ -218,7 +226,7 @@ static void drv_HD_PP_busy(const int controller) /* Set RW, clear RS */ drv_generic_parport_control(SIGNAL_RW | SIGNAL_RS, SIGNAL_RW); } else { - drv_generic_parport_data(SIGNAL_RW); + drv_generic_parport_data(SIGNAL_RW ^ invert_data_bits); } /* Address set-up time */ @@ -228,7 +236,7 @@ static void drv_HD_PP_busy(const int controller) if (Bits == 8) { drv_generic_parport_control(enable, enable); } else { - drv_generic_parport_data(SIGNAL_RW | enable); + drv_generic_parport_data((SIGNAL_RW | enable) ^ invert_data_bits); } counter = 0; @@ -284,9 +292,9 @@ static void drv_HD_PP_busy(const int controller) drv_generic_parport_control(SIGNAL_RW | SIGNAL_RS, 0); } else { /* Lower EN */ - drv_generic_parport_data(SIGNAL_RW); + drv_generic_parport_data(SIGNAL_RW ^ invert_data_bits); ndelay(T_AH); - drv_generic_parport_data(0); + drv_generic_parport_data(0 ^ invert_data_bits); } /* set data-lines to output */ @@ -317,19 +325,19 @@ static void drv_HD_PP_nibble(const unsigned char controller, const unsigned char /* clear ENABLE */ /* put data on DB1..DB4 */ /* nibble already contains RS bit! */ - drv_generic_parport_data(nibble); + drv_generic_parport_data(nibble ^ invert_data_bits); /* Address set-up time */ ndelay(T_AS); /* rise ENABLE */ - drv_generic_parport_data(nibble | enable); + drv_generic_parport_data((nibble | enable) ^ invert_data_bits); /* Enable pulse width */ ndelay(T_PW); /* lower ENABLE */ - drv_generic_parport_data(nibble); + drv_generic_parport_data(nibble ^ invert_data_bits); } @@ -369,7 +377,7 @@ static void drv_HD_PP_command(const unsigned char controller, const unsigned cha enable |= SIGNAL_ENABLE4; /* put data on DB1..DB8 */ - drv_generic_parport_data(cmd); + drv_generic_parport_data(cmd ^ invert_data_bits); /* clear RW and RS */ drv_generic_parport_control(SIGNAL_RW | SIGNAL_RS, 0); @@ -435,7 +443,7 @@ static void drv_HD_PP_data(const unsigned char controller, const char *string, c } /* put data on DB1..DB8 */ - drv_generic_parport_data(*(string++)); + drv_generic_parport_data((*(string++)) ^ invert_data_bits); /* send command */ drv_generic_parport_toggle(enable, 1, T_PW); @@ -538,6 +546,8 @@ static int drv_HD_PP_load(const char *section) return -1; if ((SIGNAL_GPO = drv_generic_parport_wire_ctrl("GPO", "GND")) == 0xff) return -1; + if ((SIGNAL_GPI = drv_generic_parport_wire_ctrl("GPI", "GND")) == 0xff) + return -1; if ((SIGNAL_POWER = drv_generic_parport_wire_ctrl("POWER", "GND")) == 0xff) return -1; } @@ -549,6 +559,9 @@ static int drv_HD_PP_load(const char *section) if (SIGNAL_GPO == 0) { Capabilities &= ~CAP_GPO; } + if (SIGNAL_GPI == 0) { + Capabilities &= ~CAP_GPI; + } /* Timings */ @@ -598,7 +611,7 @@ static int drv_HD_PP_load(const char *section) SIGNAL_BACKLIGHT | SIGNAL_GPO | SIGNAL_POWER, 0); } else { drv_generic_parport_control(SIGNAL_BACKLIGHT | SIGNAL_GPO | SIGNAL_POWER, 0); - drv_generic_parport_data(0); + drv_generic_parport_data(0 ^ invert_data_bits); } /* set direction: write */ @@ -664,7 +677,7 @@ static void drv_HD_PP_stop(void) SIGNAL_RW | SIGNAL_ENABLE | SIGNAL_ENABLE2 | SIGNAL_ENABLE3 | SIGNAL_ENABLE4 | SIGNAL_BACKLIGHT | SIGNAL_GPO, 0); } else { - drv_generic_parport_data(0); + drv_generic_parport_data(0 ^ invert_data_bits); drv_generic_parport_control(SIGNAL_BACKLIGHT | SIGNAL_GPO | SIGNAL_POWER, 0); } @@ -962,7 +975,7 @@ static int drv_HD_GPO(const int num, const int val) } /* put data on DB1..DB8 */ - drv_generic_parport_data(GPO); + drv_generic_parport_data(GPO ^ invert_data_bits); /* 74HCT573 set-up time */ ndelay(T_GPO_ST); @@ -974,11 +987,38 @@ static int drv_HD_GPO(const int num, const int val) return v; } +static int drv_HD_GPI(const int num) +{ + int v; + + /* switch to read mode */ + drv_generic_parport_direction(1); + drv_generic_parport_control(SIGNAL_GPI, SIGNAL_GPI); + + /* 74HCT573 set-up time + enable pulse width */ + ndelay(T_GPO_ST + T_GPO_PW); + + /* read data from DB1..DB8 */ + v = drv_generic_parport_read() ^ invert_data_bits; + + /* switch back to write mode */ + drv_generic_parport_control(SIGNAL_GPI, 0); + drv_generic_parport_direction(0); + + return (v >> num) & 1; +} + #endif #ifdef WITH_PARPORT + +static int drv_HD_LCM162_keypad_handler(const int num) +{ + return num; +} + static void drv_HD_LCM162_timer(void __attribute__ ((unused)) * notused) { static unsigned char data = 0x00; @@ -1000,8 +1040,28 @@ static void drv_HD_LCM162_timer(void __attribute__ ((unused)) * notused) if (data != temp) { data = temp; + int KEYPAD_VAL = 0; keynum = (data & mask3 ? 1 : 0) + (data & mask5 ? 2 : 0); + switch (keynum) { + default: + case 0: + KEYPAD_VAL = WIDGET_KEY_CANCEL; + break; + case 1: + KEYPAD_VAL = WIDGET_KEY_UP; + break; + case 2: + KEYPAD_VAL = WIDGET_KEY_CONFIRM; + break; + case 3: + KEYPAD_VAL = WIDGET_KEY_DOWN; + break; + } + updown = (data & mask6 ? 1 : 0); + KEYPAD_VAL += updown ? WIDGET_KEY_PRESSED : WIDGET_KEY_RELEASED; + + drv_generic_keypad_press(KEYPAD_VAL); debug("key %d press %d", keynum, updown); } @@ -1013,7 +1073,7 @@ static void drv_HD_LCM162_timer(void __attribute__ ((unused)) * notused) static int drv_HD_start(const char *section, const int quiet) { char *model, *size, *bus; - int rows = -1, cols = -1, gpos = -1, i; + int rows = -1, cols = -1, gpos = -1, gpis = -1, i; int size_defined = 0; int size_missing = 0; @@ -1170,6 +1230,23 @@ static int drv_HD_start(const char *section, const int quiet) info("%s: using %d GPO's", Name, GPOS); } + if (cfg_number(section, "GPIs", 0, 0, 8, &gpis) < 0) + return -1; + if (gpis > 0 && !(Capabilities & CAP_GPI)) { + error("%s: Model '%s' does not support GPI's!", Name, Models[Model].name); + gpis = 0; + } + GPIS = gpis; + if (GPIS > 0) { + info("%s: using %d GPI's", Name, GPIS); + } + + if (cfg_number(section, "InvertDataBits", 0, 0, 256, &invert_data_bits) < 0) + return -1; + if (invert_data_bits) { + info("%s: inverting data bits (mask %02X)", Name, invert_data_bits); + } + if (drv_HD_load(section) < 0) { error("%s: start display failed!", Name); return -1; @@ -1212,6 +1289,7 @@ static int drv_HD_start(const char *section, const int quiet) #ifdef WITH_PARPORT if (Capabilities & CAP_LCM162) { timer_add(drv_HD_LCM162_timer, NULL, 10, 0); + drv_generic_keypad_real_press = drv_HD_LCM162_keypad_handler; } #endif @@ -1287,7 +1365,7 @@ int drv_HD_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1066 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -1301,6 +1379,7 @@ int drv_HD_init(const char *section, const int quiet) drv_generic_text_real_defchar = drv_HD_defchar; #ifdef WITH_PARPORT drv_generic_gpio_real_set = drv_HD_GPO; + drv_generic_gpio_real_get = drv_HD_GPI; #endif /* start display */ @@ -1332,6 +1411,10 @@ int drv_HD_init(const char *section, const int quiet) if ((ret = drv_generic_gpio_init(section, Name)) != 0) return ret; +#ifdef WITH_PARPORT + if ((ret = drv_generic_keypad_init(section, Name)) != 0) + return ret; +#endif /* register text widget */ wc = Widget_Text; wc.draw = drv_generic_text_draw; diff --git a/drv_IRLCD.c b/drv_IRLCD.c new file mode 100644 index 0000000..8a8f300 --- /dev/null +++ b/drv_IRLCD.c @@ -0,0 +1,406 @@ +/* $Id: drv_IRLCD.c 984 2009-02-28 06:07:10Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_IRLCD.c $ + * + ************************************************************************** + * Driver for IRLCD : simple USB1.1 LCD + IR Receiver based on ATtiny2313 * + ************************************************************************** + * Hardware from http://www.xs4all.nl/~dicks/avr/usbtiny/index.html : * + * [USBtiny LIRC compatible IR receiver and LCD controller] * + * Ths driver is based on LCD2USB software by Till Harbaum, adapted to * + * USBTiny protocol by Jean-Philippe Civade * + ************************************************************************** + * + * The IR receiving par is compatible with IgrPlug protocol + * and can be used from LIRC. + * + * Copyright (C) 2008 Jean-Philippe Civade <jp@civade.com> (for porting to IRLCD) + * Copyright (C) 2005 Till Harbaum <till@harbaum.org> (for LCD2USB friver) + * Copyright (C) 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_IRLCD + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +#include <termios.h> +#include <fcntl.h> +#include <ctype.h> +#include <sys/ioctl.h> +#include <sys/time.h> + +#include <usb.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +#include "drv_generic_text.h" + +/* vid/pid of IRLCD */ +#define LCD_USB_VENDOR 0x03EB /* for Atmel device */ +#define LCD_USB_DEVICE 0x0002 + +/* Protocole IR/LCD */ +#define LCD_INSTR 20 +#define LCD_DATA 21 + +static char Name[] = "IRLCD"; +static char *device_id = NULL, *bus_id = NULL; + +static usb_dev_handle *lcd; + +extern int got_signal; + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_IRLCD_open(char *bus_id, char *device_id) +{ + struct usb_bus *busses, *bus; + struct usb_device *dev; + + lcd = NULL; + + info("%s: scanning USB for IRLCD interface ...", Name); + + if (bus_id != NULL) + info("%s: scanning for bus id: %s", Name, bus_id); + + if (device_id != NULL) + info("%s: scanning for device id: %s", Name, device_id); + + usb_set_debug(0); + + usb_init(); + usb_find_busses(); + usb_find_devices(); + busses = usb_get_busses(); + + for (bus = busses; bus; bus = bus->next) { + /* search this bus if no bus id was given or if this is the given bus id */ + if (!bus_id || (bus_id && !strcasecmp(bus->dirname, bus_id))) { + + for (dev = bus->devices; dev; dev = dev->next) { + /* search this device if no device id was given or if this is the given device id */ + if (!device_id || (device_id && !strcasecmp(dev->filename, device_id))) { + + if ((dev->descriptor.idVendor == LCD_USB_VENDOR) && (dev->descriptor.idProduct == LCD_USB_DEVICE)) { + info("%s: found IRLCD interface on bus %s device %s", Name, bus->dirname, dev->filename); + lcd = usb_open(dev); + if (usb_claim_interface(lcd, 0) < 0) { + info("%s: WRNING! usb_claim_interface() failed!", Name); + /* try to proceed anyway... */ + } + return 0; + } + } + } + } + } + return -1; +} + + +static int drv_IRLCD_close(void) +{ + usb_release_interface(lcd, 0); + usb_close(lcd); + + return 0; +} + + +/* Send a buffer to lcd via a control message */ +static int drv_IRLCD_send(int request, unsigned char *buffer, int size) +{ + if (usb_control_msg(lcd, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, /* bRequestType */ + request, /* bRequest (LCD_INSTR / LCD_DATA) */ + 0, /* wValue (0) */ + 0, /* wIndex (0) */ + (char *) buffer, /* pointer to destination buffer */ + size, /* wLength */ + 1000) < 0) { /* Timeout in millisectonds */ + error("%s: USB request failed! Trying to reconnect device.", Name); + + usb_release_interface(lcd, 0); + usb_close(lcd); + + /* try to close and reopen connection */ + if (drv_IRLCD_open(bus_id, device_id) < 0) { + error("%s: could not re-detect IRLCD USB LCD", Name); + got_signal = -1; + return -1; + } + /* and try to re-send command */ + if (usb_control_msg(lcd, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, /* bRequestType */ + request, /* bRequest (LCD_INSTR / LCD_DATA) */ + 0, /* wValue (0) */ + 0, /* wIndex (0) */ + (char *) buffer, /* pointer to destination buffer */ + size, /* wLength */ + 1000) < 0) { /* Timeout in millisectonds */ + error("%s: retried USB request failed, aborting!", Name); + got_signal = -1; + return -1; + } + + info("%s: Device successfully reconnected.", Name); + } + + return 0; +} + + +/* text mode displays only */ +static void drv_IRLCD_clear(void) +{ + unsigned char cmd[1]; + + cmd[0] = 0x01; /* clear */ + drv_IRLCD_send(LCD_INSTR, cmd, 1); + cmd[0] = 0x03; /* home */ + drv_IRLCD_send(LCD_INSTR, cmd, 1); +} + + +/* text mode displays only */ +static void drv_IRLCD_write(const int row, const int col, const char *data, int len) +{ + unsigned char cmd[1]; + static int pos; + + /* for 2 lines display */ + pos = (row % 2) * 64 + (row / 2) * 20 + col; + + /* do the cursor positioning here */ + cmd[0] = 0x80 | pos; + + /* do positionning */ + drv_IRLCD_send(LCD_INSTR, cmd, 1); + + /* send string to the display */ + drv_IRLCD_send(LCD_DATA, (unsigned char *) data, len); + +} + +/* text mode displays only */ +static void drv_IRLCD_defchar(const int ascii, const unsigned char *matrix) +{ + unsigned char cmd[10]; + int i; + + /* Write to CGRAM */ + cmd[0] = 0x40 | 8 * ascii; + drv_IRLCD_send(LCD_INSTR, cmd, 1); + + + /* send bitmap to the display */ + for (i = 0; i < 8; i++) { + cmd[i] = matrix[i] & 0x1f; + } + drv_IRLCD_send(LCD_DATA, cmd, 8); +} + + +/* start text mode display */ +static int drv_IRLCD_start(const char *section) +{ + int rows = -1, cols = -1; + char *s; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* bus id and device id are strings and not just intergers, since */ + /* the windows port of libusb treats them as strings. And this way */ + /* we keep windows compatibility ... just in case ... */ + bus_id = cfg_get(section, "Bus", NULL); + device_id = cfg_get(section, "Device", NULL); + + if (drv_IRLCD_open(bus_id, device_id) < 0) { + error("%s: could not find a IRLC USB LCD", Name); + return -1; + } + + /* reset & initialize display */ + drv_IRLCD_clear(); /* clear display */ + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ +/* no plugins capabilities */ + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + +/* list models */ +int drv_IRLCD_list(void) +{ + printf("USBtiny LCD controller"); + return 0; +} + +/* initialize driver & display */ +int drv_IRLCD_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int asc255bug; + int ret; + + info("%s: %s", Name, "$Rev: 984 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 8; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 2; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_IRLCD_write; + drv_generic_text_real_defchar = drv_IRLCD_defchar; + + /* start display */ + if ((ret = drv_IRLCD_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, " www.civade.com")) { + sleep(3); + drv_IRLCD_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + /* most displays have a full block on ascii 255, but some have kind of */ + /* an 'inverted P'. If you specify 'asc255bug 1 in the config, this */ + /* char will not be used, but rendered by the bar driver */ + cfg_number(section, "asc255bug", 0, 0, 1, &asc255bug); + drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ + if (!asc255bug) + drv_generic_text_bar_add_segment(255, 255, 255, 255); /* ASCII 255 = block */ + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register icon widget */ + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + + return 0; +} + + +/* close driver & display */ +/* use this function for a text display */ +int drv_IRLCD_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + /* clear display */ + drv_IRLCD_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + debug("closing usb connection"); + drv_IRLCD_close(); + + return (0); +} + +/* use this one for a text display */ +DRIVER drv_IRLCD = { + .name = Name, + .list = drv_IRLCD_list, + .init = drv_IRLCD_init, + .quit = drv_IRLCD_quit, +}; diff --git a/drv_Image.c b/drv_Image.c index fb317b9..7f8a005 100644 --- a/drv_Image.c +++ b/drv_Image.c @@ -1,9 +1,9 @@ -/* $Id: drv_Image.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Image.c $ +/* $Id: drv_Image.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Image.c $ * * new style Image (PPM/PNG) Driver for LCD4Linux * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -80,7 +80,7 @@ static char Name[] = "Image"; -static enum { PPM, PNG } Format; +static enum { NIL, PPM, PNG } Format; static int pixel = -1; /* pointsize in pixel */ static int pgap = 0; /* gap between points */ @@ -114,14 +114,14 @@ static int drv_IMG_flush_PPM(void) if (bitbuf == NULL) { if ((bitbuf = malloc(xsize * ysize * sizeof(*bitbuf))) == NULL) { - error("%s: malloc(%d) failed: %s", Name, (int) xsize * ysize * sizeof(*bitbuf), strerror(errno)); + error("%s: malloc() failed: %s", Name, strerror(errno)); return -1; } } if (rowbuf == NULL) { if ((rowbuf = malloc(3 * xsize * sizeof(*rowbuf))) == NULL) { - error("Raster: malloc(%d) failed: %s", (int) 3 * xsize * sizeof(*rowbuf), strerror(errno)); + error("Raster: malloc() failed: %s", strerror(errno)); return -1; } } @@ -266,6 +266,8 @@ static void drv_IMG_flush(void) drv_IMG_flush_PNG(); #endif break; + default: + break; } } @@ -315,11 +317,21 @@ static int drv_IMG_start(const char *section) return -1; } + Format = NIL; + +#ifdef WITH_PPM if (strcmp(s, "PPM") == 0) { Format = PPM; - } else if (strcmp(s, "PNG") == 0) { + } +#endif + +#ifdef WITH_PNG + if (strcmp(s, "PNG") == 0) { Format = PNG; - } else { + } +#endif + + if (Format == NIL) { error("%s: bad %s.Format '%s' from %s", Name, section, s, cfg_source()); free(s); return -1; @@ -411,7 +423,12 @@ static int drv_IMG_start(const char *section) /* list models */ int drv_IMG_list(void) { - printf("PPM PNG"); +#ifdef WITH_PPM + printf("PPM "); +#endif +#ifdef WITH_PNG + printf("PNG "); +#endif return 0; } @@ -422,7 +439,7 @@ int drv_IMG_init(const char *section, const __attribute__ ((unused)) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 840 $"); /* real worker functions */ drv_generic_graphic_real_blit = drv_IMG_blit; diff --git a/drv_LCD2USB.c b/drv_LCD2USB.c index ae3fccf..5e2fc72 100644 --- a/drv_LCD2USB.c +++ b/drv_LCD2USB.c @@ -1,7 +1,7 @@ -/* $Id: drv_LCD2USB.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LCD2USB.c $ +/* $Id: drv_LCD2USB.c 1130 2010-10-31 19:21:45Z harbaum $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LCD2USB.c $ * - * driver for USB2LCD display interface + * driver for LCD2USB display interface * see http://www.harbaum.org/till/lcd2usb for schematics * * Copyright 2005 Till Harbaum <till@harbaum.org> @@ -98,7 +98,6 @@ static char *device_id = NULL, *bus_id = NULL; static usb_dev_handle *lcd; static int controllers = 0; -extern int usb_debug; extern int got_signal; /****************************************/ @@ -120,7 +119,7 @@ static int drv_L2U_open(char *bus_id, char *device_id) if (device_id != NULL) info("%s: scanning for device id: %s", Name, device_id); - usb_debug = 0; + usb_set_debug(0); usb_init(); usb_find_busses(); @@ -570,7 +569,7 @@ static void plugin_brightness(RESULT * result, RESULT * arg1) /* list models */ int drv_L2U_list(void) { - printf("generic"); + printf("LCD2USB homebrew USB interface for HD44780 text displays"); return 0; } @@ -582,7 +581,7 @@ int drv_L2U_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1130 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_LCDLinux.c b/drv_LCDLinux.c index 0f9f284..7f91094 100644 --- a/drv_LCDLinux.c +++ b/drv_LCDLinux.c @@ -1,10 +1,10 @@ -/* $Id: drv_LCDLinux.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LCDLinux.c $ +/* $Id: drv_LCDLinux.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LCDLinux.c $ * * driver for the LCD-Linux HD44780 kernel driver * http://lcd-linux.sourceforge.net * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -162,7 +162,7 @@ static int drv_LL_start(const char *section, const int quiet) return -1; } info("%s: %dx%d display with %d controllers, flags=0x%02lx:", - Name, buf.cntr_cols, buf.cntr_rows, buf.num_cntr, buf.flags); + Name, buf.cntr_cols, buf.cntr_rows * buf.num_cntr, buf.num_cntr, buf.flags); info("%s: busy-flag checking %sabled", Name, (buf.flags & HD44780_CHECK_BF) ? "en" : "dis"); info("%s: bus width %d bits", Name, (buf.flags & HD44780_4BITS_BUS) ? 4 : 8); info("%s: font size %s", Name, (buf.flags & HD44780_5X10_FONT) ? "5x10" : "5x8"); @@ -175,14 +175,14 @@ static int drv_LL_start(const char *section, const int quiet) commit = 1; } - if ((rows > 0 && rows != buf.cntr_rows) || (cols > 0 && cols != buf.cntr_cols)) { + if ((rows > 0 && rows != buf.cntr_rows * buf.num_cntr) || (cols > 0 && cols != buf.cntr_cols)) { info("%s: changing size to %dx%d", Name, cols, rows); - buf.cntr_rows = rows; + buf.cntr_rows = rows / buf.num_cntr; buf.cntr_cols = cols; commit = 1; } - DROWS = buf.cntr_rows; + DROWS = buf.cntr_rows * buf.num_cntr; DCOLS = buf.cntr_cols; /* overwrite busy-flag checking from lcd4linux.conf */ @@ -259,7 +259,7 @@ static int drv_LL_start(const char *section, const int quiet) /* list models */ int drv_LL_list(void) { - printf("generic"); + printf("LCD-Linux HD44780 kernel driver"); return 0; } @@ -271,7 +271,7 @@ int drv_LL_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_LCDTerm.c b/drv_LCDTerm.c index 8255c3b..13556b9 100644 --- a/drv_LCDTerm.c +++ b/drv_LCDTerm.c @@ -1,10 +1,10 @@ -/* $Id: drv_LCDTerm.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LCDTerm.c $ +/* $Id: drv_LCDTerm.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LCDTerm.c $ * * driver for the LCDTerm serial-to-HD44780 adapter boards * http://www.bobblick.com/techref/projects/lcdterm/lcdterm.html * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -186,7 +186,7 @@ static int drv_LT_start(const char *section, const int quiet) /* list models */ int drv_LT_list(void) { - printf("generic"); + printf("LCDTerm serial-to-HD44780 adapter board"); return 0; } @@ -198,7 +198,7 @@ int drv_LT_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_LEDMatrix.c b/drv_LEDMatrix.c index 4020a6f..f4b31a8 100644 --- a/drv_LEDMatrix.c +++ b/drv_LEDMatrix.c @@ -1,5 +1,5 @@ -/* $Id: drv_LEDMatrix.c 776 2007-02-26 10:34:52Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LEDMatrix.c $ +/* $Id: drv_LEDMatrix.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LEDMatrix.c $ * * LED matrix driver for LCD4Linux * (see http://www.harbaum.org/till/ledmatrix for hardware) @@ -252,6 +252,7 @@ static int drv_LEDMatrix_start(const char *section) /* list models */ int drv_LEDMatrix_list(void) { + printf("LEDMATRIX by Till Harbaum"); return 0; } diff --git a/drv_LPH7508.c b/drv_LPH7508.c index bb33a9a..013c77a 100644 --- a/drv_LPH7508.c +++ b/drv_LPH7508.c @@ -1,9 +1,9 @@ -/* $Id: drv_LPH7508.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LPH7508.c $ +/* $Id: drv_LPH7508.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LPH7508.c $ * * driver for Pollin LPH7508 * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -454,7 +454,7 @@ int drv_L7_init(const char *section, const int quiet) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 840 $"); /* real worker functions */ drv_generic_graphic_real_blit = drv_L7_blit; diff --git a/drv_LUIse.c b/drv_LUIse.c index 4ebec53..644d3b4 100644 --- a/drv_LUIse.c +++ b/drv_LUIse.c @@ -1,5 +1,5 @@ -/* $Id: drv_LUIse.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_LUIse.c $ +/* $Id: drv_LUIse.c 798 2007-05-04 11:35:52Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LUIse.c $ * * LUIse lcd4linux driver * @@ -131,7 +131,7 @@ static int drv_LUIse_start(const char *section) return -1; } if (sscanf(s, "%d", &devNum) < 0 || devNum > 4) { - error("s: bad DeviceNum '%s' from %s", Name, s, cfg_source()); + error("%s: bad DeviceNum '%s' from %s", Name, s, cfg_source()); return -1; } info("%s: using DeviceNum '%d'", Name, devNum); @@ -270,7 +270,7 @@ int drv_LUIse_init(const char *section, const int quiet) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 798 $"); /* real worker functions */ drv_generic_graphic_real_blit = drv_LUIse_blit; diff --git a/drv_LW_ABP.c b/drv_LW_ABP.c new file mode 100644 index 0000000..c597edb --- /dev/null +++ b/drv_LW_ABP.c @@ -0,0 +1,682 @@ +/* $Id: drv_LW_ABP.c 1071 2009-11-22 05:27:53Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_LW_ABP.c $ + * + * driver for Logic Way GmbH ABP08 (serial) and ABP09 (USB) appliance control panels + * http://www.logicway.de/pages/mde-hardware.shtml#ABP.AMC + * + * Copyright (C) 2009 Arndt Kritzner <kritzner@logicway.de> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_LW_ABP + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <time.h> +#include <errno.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "timer.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_bar.h" +#include "widget_keypad.h" +#include "drv.h" + +/* text mode display? */ +#include "drv_generic_text.h" +#include "drv_generic_keypad.h" + +/* serial port? */ +#include "drv_generic_serial.h" + +/* i2c bus? */ +#ifdef WITH_I2C +#include "drv_generic_i2c.h" +#endif + +#define KEY_UP 4 +#define KEY_DOWN 3 +#define KEY_LEFT 2 +#define KEY_RIGHT 1 + +static char Name[] = "LW_ABP"; +static char logicway[] = "www.logicway.de"; + +/* ring buffer for bytes received from the display */ +static unsigned char RingBuffer[256]; +static unsigned int RingRPos = 0; +static unsigned int RingWPos = 0; + +static int button = -1; +static char *colors[] = + { "r 0", "r 1", "g 0", "g 1", "b 0", "b 1", "c 0", "c 1", "m 0", "m 1", "y 0", "y 1", "w 0", "w 1", NULL }; + +#define TIMESYNC_FIRST 600 +#define TIMESYNC_INTERVAL 24*3600 +static time_t next_timesync; + +static char *switchcontact = NULL; +static int statresult = 0; +static time_t switchcontact_lastchange = 0; +static time_t switchcontact_time = 0; +#define SWITCH_ACTION_DURATION 1000 + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_LW_ABP_open(const char *section) +{ + /* open serial port */ + /* don't mind about device, speed and stuff, this function will take care of */ + + if (drv_generic_serial_open(section, Name, 0) < 0) + return -1; + + return 0; +} + + +static int drv_LW_ABP_close(void) +{ + drv_generic_serial_close(); + + return 0; +} + + +/* dummy function that sends something to the display */ +static void drv_LW_ABP_send(const char *data, const unsigned int len) +{ + /* send data to the serial port is easy... */ + drv_generic_serial_write(data, len); +} + + +/* text mode displays only */ +static void drv_LW_ABP_reset(void) +{ + char cmd[] = "lcd init\r\n"; + + /* do whatever is necessary to initialize the display */ + drv_LW_ABP_send(cmd, strlen(cmd)); +} + +static void drv_LW_ABP_clear(void) +{ + char cmd[] = "lcd clear\r\n"; + + /* do whatever is necessary to clear the display */ + drv_LW_ABP_send(cmd, strlen(cmd)); +} + +static int drv_LW_ABP_time(unsigned char force) +{ + char cmd[] = "date set "; + char command[50]; + time_t t = time(NULL); + + if (force || (t > next_timesync)) { + /* do whatever is necessary to set clock on the display */ + sprintf(command, "%s%lu\r\n", cmd, (unsigned long) t); + drv_LW_ABP_send(command, strlen(command)); + next_timesync = t + TIMESYNC_INTERVAL; + info("%s: synced time to %lu, next is %lu\n", Name, (unsigned long) t, (unsigned long) next_timesync); + return 1; + } + + return 0; +} + +static int drv_LW_ABP_switchcontact(void) +{ + char cmd[] = "switch time "; + char command[50]; + struct stat statinfo; + FILE *configfile; + int scanresult; + int config_entries; + char inputline[101]; + if ((switchcontact != NULL) && (*switchcontact != '\0')) { + if (stat(switchcontact, &statinfo) == -1) { + if (statresult != -1) { + error("%s: specified switch contact control file %s not found", Name, switchcontact); + switchcontact_time = 0; + sprintf(command, "%s%lu %u\r\n", cmd, (unsigned long) switchcontact_time, SWITCH_ACTION_DURATION); + drv_LW_ABP_send(command, strlen(command)); + info("%s: switchtime deactivated", Name); + statresult = -1; + } + } else { + if (statresult == -1) { + info("%s: specified switch contact control file %s appeared", Name, switchcontact); + statresult = 0; + } + if ((switchcontact_lastchange == 0) || (switchcontact_lastchange < statinfo.st_mtime)) { + info("%s: specified switch contact control file %s has changed (%lu < %lu)", Name, switchcontact, + (unsigned long) switchcontact_lastchange, (unsigned long) statinfo.st_mtime); + switchcontact_lastchange = statinfo.st_mtime; + configfile = fopen(switchcontact, "r"); + if (configfile == NULL) { + error("%s: could not open specified switch contact control file %s", Name, switchcontact); + } else { + config_entries = 0; + while (!feof(configfile)) { + if (fgets(inputline, 100, configfile) != NULL) { + if ((scanresult = sscanf(inputline, "switchtime=%lu", &switchcontact_time)) == 1) { + info("%s: switchtime read %lu (file %s)", Name, (unsigned long) switchcontact_time, + switchcontact); + config_entries++; + } + } + } + fclose(configfile); + if (config_entries > 0) { + if (switchcontact_time < time(NULL)) { + switchcontact_time = 0; + info("%s: switchtime is in past %lu (now %lu), so deactivated", Name, + (unsigned long) switchcontact_time, time(NULL)); + } + } else { + switchcontact_time = 0; + } + if (switchcontact_time != 0) { + sprintf(command, "%s%lu %u\r\n", cmd, (unsigned long) switchcontact_time, + SWITCH_ACTION_DURATION); + drv_LW_ABP_send(command, strlen(command)); + info("%s: switchtime set to %lu", Name, (unsigned long) switchcontact_time); + } else { + sprintf(command, "%s%lu %u\r\n", cmd, (unsigned long) switchcontact_time, + SWITCH_ACTION_DURATION); + drv_LW_ABP_send(command, strlen(command)); + info("%s: switchtime deactivated", Name); + } + } + } + } + } + + return 0; +} + +/* text mode displays only */ +static void drv_LW_ABP_write(const int row, const int col, const char *data, int len) +{ + char cmd[] = "lcd set line "; + char row_[5]; + char col_[5]; + + /* do the cursor positioning here */ + drv_LW_ABP_send(cmd, strlen(cmd)); + sprintf(row_, "%d", row + 1); + drv_LW_ABP_send(row_, strlen(row_)); + if (col > 0) { + drv_LW_ABP_send(",", 1); + sprintf(col_, "%d", col + 1); + drv_LW_ABP_send(col_, strlen(col_)); + } + drv_LW_ABP_send(" ", 1); + + /* send string to the display */ + drv_LW_ABP_send(data, len); + drv_LW_ABP_send("\r\n", 2); + +} + +static unsigned char byte(int pos) +{ + if (pos >= 0) { + pos += RingRPos; + if ((unsigned) pos >= sizeof(RingBuffer)) + pos -= sizeof(RingBuffer); + } else { + pos += RingWPos; + if (pos < 0) + pos += sizeof(RingBuffer); + } + return RingBuffer[pos]; +} + +static void drv_LW_ABP_process_button(void) +{ + /* Key Activity */ + debug("%s: Key Activity: %d", Name, button); + drv_generic_keypad_press(button); +} + +static int drv_LW_ABP_poll(void) +{ + char received[100]; + + /* read into RingBuffer */ + while (1) { + char buffer[32]; + int num, n; + num = drv_generic_serial_poll(buffer, sizeof(buffer)); + if (num <= 0) + break; + /* put result into RingBuffer */ + for (n = 0; n < num; n++) { + RingBuffer[RingWPos++] = (unsigned char) buffer[n]; + if (RingWPos >= sizeof(RingBuffer)) + RingWPos = 0; + } + } + + received[0] = '\0'; + + /* process RingBuffer */ + while (1) { + char command[32]; + int n, num; + /* packet size */ + num = RingWPos - RingRPos; + if (num < 0) + num += sizeof(RingBuffer); + /* minimum packet size=3 */ + if (num < 1) { + if (strlen(received) > 0) { + debug("%s: received: %s", Name, received); + } + return 0; + } + if (byte(0) != '[') { + goto GARBAGE; + } + for (n = 0; (n < num) && ((unsigned) n < (sizeof(command) - 1)); n++) { + command[n] = byte(n); + if (command[n] == ']') { + n++; + break; + } + } + command[n] = '\0'; + if (command[n - 1] != ']') { + if (strlen(command) < 4) { + if (strlen(received) > 0) { + debug("%s: received: %s", Name, received); + } + return 0; + } + goto GARBAGE; + } + info("%s: command read from keypad: %s\n", Name, command); + if (sscanf(command, "[T%d]", &button) == 1) { + info("%s: button %d pressed\n", Name, button); + } else { + goto GARBAGE; + } + /* increment read pointer */ + RingRPos += strlen(command); + if (RingRPos >= sizeof(RingBuffer)) + RingRPos -= sizeof(RingBuffer); + /* a packet arrived */ + if (strlen(received) > 0) { + debug("%s: received: %s", Name, received); + } + return 1; + GARBAGE: + switch (byte(0)) { + case '\n': + case '\r': + case '>': + if (strlen(received) > 0) { + debug("%s: received: %s", Name, received); + received[0] = '\0'; + } + break; + default: + if (byte(0) < ' ') + debug("%s: dropping garbage byte %02x", Name, byte(0)); + else if ((strlen(received) + 2) > sizeof(received)) { + debug("%s: received: %s", Name, received); + received[0] = '\0'; + } + sprintf(received, "%s%c", received, byte(0)); + break; + } + RingRPos++; + if (RingRPos >= sizeof(RingBuffer)) + RingRPos = 0; + continue; + } + + /* not reached */ + return 0; +} + +static void drv_LW_ABP_timer(void __attribute__ ((unused)) * notused) +{ + while (drv_LW_ABP_poll()) { + drv_LW_ABP_process_button(); + } + + drv_LW_ABP_time(0); + drv_LW_ABP_switchcontact(); +} + +static int drv_LW_ABP_keypad(const int num) +{ + int val = 0; + + switch (num) { + case KEY_UP: + debug("%s: Key Up", Name); + val += WIDGET_KEY_PRESSED; + val += WIDGET_KEY_UP; + break; + case KEY_DOWN: + debug("%s: Key Down", Name); + val += WIDGET_KEY_PRESSED; + val += WIDGET_KEY_DOWN; + break; + case KEY_LEFT: + debug("%s: Key Left / Cancel", Name); + val += WIDGET_KEY_PRESSED; + val += WIDGET_KEY_LEFT; +// val += WIDGET_KEY_CANCEL; + break; + case KEY_RIGHT: + debug("%s: Key Right / Confirm", Name); + val += WIDGET_KEY_PRESSED; + val += WIDGET_KEY_RIGHT; +// val += WIDGET_KEY_CONFIRM; + break; + default: + debug("%s: Unbound Key '%d'", Name, num); + break; + } + + return val; +} + +static char *drv_LW_ABP_background(char *color) +{ + static char *Background = NULL; + char cmd[] = "lcd set color "; + int idx; + if (color != NULL) { + for (idx = 0; colors[idx] != NULL; idx++) { + if (strcmp(color, colors[idx]) == 0) + break; + } + if (colors[idx] != NULL) { + Background = colors[idx]; + debug("%s: set background color %s", Name, Background); + drv_LW_ABP_send(cmd, strlen(cmd)); + drv_LW_ABP_send(color, strlen(color)); + drv_LW_ABP_send("\r\n", 2); + } + } + return Background; +} + +static int drv_LW_ABP_contrast(int contrast) +{ + return contrast; +} + + +/* start text mode display */ +static int drv_LW_ABP_start(const char *section) +{ + int contrast; + int rows = -1, cols = -1; + char *s; + char *background; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + next_timesync = time(NULL) + TIMESYNC_FIRST; + + /* open communication with the display */ + if (drv_LW_ABP_open(section) < 0) { + return -1; + } + + drv_LW_ABP_reset(); /* initialize display */ + + background = cfg_get(section, "Background", NULL); + if ((background != NULL) && (*background != '\0')) { + if (drv_LW_ABP_background(background) == NULL) { + debug("%s: wrong background color specified: %s", Name, background); + } + } + + switchcontact = cfg_get(section, "Switchcontact", NULL); + + if (cfg_number(section, "Contrast", 0, 0, 255, &contrast) > 0) { + drv_LW_ABP_contrast(contrast); + } + + drv_LW_ABP_clear(); /* clear display */ + + return 0; +} + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_contrast(RESULT * result, RESULT * arg1) +{ + double contrast; + + contrast = drv_LW_ABP_contrast(R2N(arg1)); + SetResult(&result, R_NUMBER, &contrast); +} + +static void plugin_background(RESULT * result, const int argc, RESULT * argv[]) +{ + char *color; + + switch (argc) { + case 0: + color = drv_LW_ABP_background(NULL); + SetResult(&result, R_STRING, &color); + break; + case 1: + color = drv_LW_ABP_background(R2S(argv[0])); + SetResult(&result, R_STRING, &color); + break; + default: + error("%s.backlight(): wrong number of parameters (%d)", Name, argc); + SetResult(&result, R_STRING, ""); + } +} + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_LW_ABP_list(void) +{ + printf("Logic Way ABP driver"); + return 0; +} + + +/* initialize driver & display */ +/* use this function for a text display */ +int drv_LW_ABP_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 1071 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 0; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 10; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_LW_ABP_write; + drv_generic_keypad_real_press = drv_LW_ABP_keypad; + + /* regularly process display answers */ + timer_add(drv_LW_ABP_timer, NULL, 100, 0); + + /* start display */ + if ((ret = drv_LW_ABP_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, logicway)) { + sleep(3); + drv_LW_ABP_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* initialize generic key pad driver */ + if ((ret = drv_generic_keypad_init(section, Name)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + + /* register plugins */ + AddFunction("LCD::contrast", 1, plugin_contrast); + AddFunction("LCD::background", -1, plugin_background); + + return 0; +} + + + +/* close driver & display */ +/* use this function for a text display */ +int drv_LW_ABP_quit(const int quiet) +{ + char switchactive[] = "switch scheduled"; + char timeinfo[17]; + struct tm switchtime_info; + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + drv_generic_keypad_quit(); + + /* clear display */ + drv_LW_ABP_clear(); + + /* say goodbye... */ + if (switchcontact_time < time(NULL)) { + switchcontact_time = 0; + info("%s: switchtime is in past %lu (now %lu), so deactivated", Name, (unsigned long) switchcontact_time, + time(NULL)); + } + if (switchcontact_time == 0) { + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + } else { + drv_LW_ABP_write(0, 0, logicway, strlen(logicway)); + drv_LW_ABP_write(1, 0, switchactive, strlen(switchactive)); + localtime_r(&switchcontact_time, &switchtime_info); + if (strftime(timeinfo, sizeof(timeinfo), "for %a %X", &switchtime_info) > 0) { + drv_LW_ABP_write(2, 0, timeinfo, strlen(timeinfo)); + } + } + + debug("closing connection"); + drv_LW_ABP_close(); + + return (0); +} + + +/* use this one for a text display */ +DRIVER drv_LW_ABP = { + .name = Name, + .list = drv_LW_ABP_list, + .init = drv_LW_ABP_init, + .quit = drv_LW_ABP_quit, +}; diff --git a/drv_M50530.c b/drv_M50530.c index b3b3c4b..45518b2 100644 --- a/drv_M50530.c +++ b/drv_M50530.c @@ -1,9 +1,9 @@ -/* $Id: drv_M50530.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_M50530.c $ +/* $Id: drv_M50530.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_M50530.c $ * * new style driver for M50530-based displays * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -95,7 +95,7 @@ typedef struct { } MODEL; static MODEL Models[] = { - {0x01, "generic"}, + {0x01, "M50530"}, {0xff, "Unknown"} }; @@ -593,7 +593,7 @@ int drv_M5_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = -1; /* pixel width of one char */ diff --git a/drv_MatrixOrbital.c b/drv_MatrixOrbital.c index 26da0fd..8f844c9 100644 --- a/drv_MatrixOrbital.c +++ b/drv_MatrixOrbital.c @@ -1,9 +1,9 @@ -/* $Id: drv_MatrixOrbital.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_MatrixOrbital.c $ +/* $Id: drv_MatrixOrbital.c 1140 2011-01-05 03:49:07Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_MatrixOrbital.c $ * * new style driver for Matrix Orbital serial display modules * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -58,6 +58,8 @@ static char Name[] = "MatrixOrbital"; static int Model; static int Protocol; +static char dispBuffer[4][20]; + typedef struct { int type; char *name; @@ -98,6 +100,8 @@ static MODEL Models[] = { {0x36, "LK202-24-USB", 2, 20, 8, 8, 2}, {0x38, "LK204-24-USB", 4, 20, 8, 8, 2}, {0x39, "VK204-24-USB", 4, 20, 8, 8, 2}, + {0x40, "DE-LD011", 2, 16, 0, 0, 3}, /* Sure electronics USB LCD board Rev.I */ + {0x41, "DE-LD021", 4, 20, 0, 0, 3}, {0xff, "Unknown", -1, -1, 0, 0, 0} }; @@ -106,8 +110,29 @@ static MODEL Models[] = { /*** hardware dependant functions ***/ /****************************************/ +static void drv_MO_write(const int row, const int col, const char *data, const int len) +{ + char cmd[5] = "\376Gyx"; + + if (Models[Model].protocol == 3) { // Sure electronics USB LCD board - full line output + cmd[2] = (char) 1; + cmd[3] = (char) row + 1; + strncpy(&(dispBuffer[row][col]), data, len); + drv_generic_serial_write(cmd, 4); + drv_generic_serial_write(dispBuffer[row], Models[Model].cols); + } else { + cmd[2] = (char) col + 1; + cmd[3] = (char) row + 1; + drv_generic_serial_write(cmd, 4); + drv_generic_serial_write(data, len); + } +} + + static void drv_MO_clear(void) { + int i, j; + switch (Protocol) { case 1: drv_generic_serial_write("\014", 1); /* Clear Screen */ @@ -115,19 +140,17 @@ static void drv_MO_clear(void) case 2: drv_generic_serial_write("\376\130", 2); /* Clear Screen */ break; - } -} - -static void drv_MO_write(const int row, const int col, const char *data, const int len) -{ - char cmd[5] = "\376Gyx"; - - cmd[2] = (char) col + 1; - cmd[3] = (char) row + 1; - drv_generic_serial_write(cmd, 4); - - drv_generic_serial_write(data, len); + case 3: + /* Sure electronics USB LCD board - clear buffer */ + for (i = 0; i < Models[Model].rows; i++) { + for (j = 0; j < Models[Model].cols; j++) { + dispBuffer[i][j] = ' '; + } + drv_MO_write(1, i + 1, dispBuffer[i], Models[Model].cols); + } + break; + } } @@ -302,6 +325,14 @@ static int drv_MO_start(const char *section, const int quiet) Model = -1; } + if (Model != -1 && Models[Model].protocol == 3) { // Sure electronics USB LCD board - full line output + int i, j; + for (i = 0; i < Models[Model].rows; i++) { // Clear buffer + for (j = 0; j < Models[Model].cols; j++) { + dispBuffer[i][j] = ' '; + } + } + } if (drv_generic_serial_open(section, Name, 0) < 0) return -1; @@ -462,8 +493,9 @@ int drv_MO_init(const char *section, const int quiet) { WIDGET_CLASS wc; int ret; + int asc255bug; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1140 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -496,8 +528,13 @@ int drv_MO_init(const char *section, const int quiet) return ret; /* add fixed chars to the bar driver */ + /* most displays have a full block on ascii 255, but some have kind of */ + /* an 'inverted P'. If you specify 'asc255bug 1 in the config, this */ + /* char will not be used, but rendered by the bar driver */ + cfg_number(section, "asc255bug", 0, 0, 1, &asc255bug); drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ - drv_generic_text_bar_add_segment(255, 255, 255, 255); /* ASCII 255 = block */ + if (!asc255bug) + drv_generic_text_bar_add_segment(255, 255, 255, 255); /* ASCII 255 = block */ /* initialize generic GPIO driver */ if ((ret = drv_generic_gpio_init(section, Name)) != 0) @@ -538,11 +575,15 @@ int drv_MO_quit(const int quiet) /* clear display */ drv_MO_clear(); + usleep(300000); + /* say goodbye... */ if (!quiet) { drv_generic_text_greet("goodbye!", NULL); } + usleep(300000); + drv_generic_serial_close(); return (0); diff --git a/drv_MatrixOrbitalGX.c b/drv_MatrixOrbitalGX.c new file mode 100644 index 0000000..5906f1f --- /dev/null +++ b/drv_MatrixOrbitalGX.c @@ -0,0 +1,571 @@ +/* $Id: drv_MatrixOrbitalGX.c 975 2009-02-27 18:50:20Z abbas $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_MatrixOrbitalGX.c $ + * + * driver for Matrix Orbital GX Series Graphic(240x64) displays from matrixorbital.com + * + * Copyright (C) 2009 Abbas Kosan <abbaskosan@gmail.com> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team + * <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_MatrixOrbitalGX + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> +//#include <termios.h> +//#include <fcntl.h> +//#include <sys/ioctl.h> +//#include <sys/time.h> + +#include <usb.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +#include "drv_generic_graphic.h" + +#define MatrixOrbitalGX_VENDOR 0x1b3d +#define MatrixOrbitalGX_DEVICE_1 0x000a +#define MatrixOrbitalGX_DEVICE_2 0x000b +#define MatrixOrbitalGX_DEVICE_3 0x000c + +/********Matrix Orbital GX Series*********/ +#define INTERFACE_ 0 +#define BULK_OUT_ENDPOINT 0x05 +#define BULK_IN_ENDPOINT 0x82 + +#define SCREEN_H 64 +#define SCREEN_W 240 +#define SCREEN_SIZE (SCREEN_H * SCREEN_W) +/*****************************************/ + +#if 1 +#define DEBUG(x) debug("%s(): %s", __FUNCTION__, x); +#else +#define DEBUG(x) +#endif + + +static char Name[] = "MatrixOrbitalGX"; +static unsigned char *MOGX_framebuffer; + +/* used to display white text on blue background or inverse */ +static unsigned char invert = 0x00; +static unsigned char backlight_RGB = 0; + +static usb_dev_handle *lcd_dev; + +/* +int mygetch(void) +{ + struct termios oldt, newt; + int ch; + tcgetattr( STDIN_FILENO, &oldt ); + newt = oldt; + newt.c_lflag &= ~( ICANON | ECHO ); + tcsetattr( STDIN_FILENO, TCSANOW, &newt ); + ch = getchar(); + tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); + return ch; +} +*/ + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_MOGX_open(void) +{ + struct usb_bus *busses, *bus; + struct usb_device *dev; + char driver[1024]; + char product[1024]; + char manufacturer[1024]; + char serialnumber[1024]; + int ret; + + lcd_dev = NULL; + + info("%s: scanning for Matrix Orbital GX Series LCD...", Name); + + usb_set_debug(0); + + usb_init(); + usb_find_busses(); + usb_find_devices(); + busses = usb_get_busses(); + + for (bus = busses; bus; bus = bus->next) { + for (dev = bus->devices; dev; dev = dev->next) { + if ((dev->descriptor.idVendor == MatrixOrbitalGX_VENDOR) && + ((dev->descriptor.idProduct == MatrixOrbitalGX_DEVICE_1) || + (dev->descriptor.idProduct == MatrixOrbitalGX_DEVICE_2) || + (dev->descriptor.idProduct == MatrixOrbitalGX_DEVICE_3))) { + + /* At the moment, I have information for only this LCD */ + if (dev->descriptor.idProduct == MatrixOrbitalGX_DEVICE_2) + backlight_RGB = 0; + + info("%s: found Matrix Orbital GX Series LCD on bus %s device %s", Name, bus->dirname, dev->filename); + + lcd_dev = usb_open(dev); + + ret = usb_get_driver_np(lcd_dev, 0, driver, sizeof(driver)); + + if (ret == 0) { + info("%s: interface 0 already claimed by '%s'", Name, driver); + info("%s: attempting to detach driver...", Name); + if (usb_detach_kernel_driver_np(lcd_dev, 0) < 0) { + error("%s: usb_detach_kernel_driver_np() failed!", Name); + return -1; + } + } + + usb_set_configuration(lcd_dev, 1); + usleep(100); + + if (usb_claim_interface(lcd_dev, 0) < 0) { + error("%s: usb_claim_interface() failed!", Name); + return -1; + } + + usb_set_altinterface(lcd_dev, 0); + + usb_get_string_simple(lcd_dev, dev->descriptor.iProduct, product, sizeof(product)); + usb_get_string_simple(lcd_dev, dev->descriptor.iManufacturer, manufacturer, sizeof(manufacturer)); + usb_get_string_simple(lcd_dev, dev->descriptor.iSerialNumber, serialnumber, sizeof(serialnumber)); + + info("%s: Manufacturer='%s' Product='%s' SerialNumber='%s'", Name, manufacturer, product, serialnumber); + + return 0; + } + } + } + error("%s: could not find a Matrix Orbital GX Series LCD", Name); + return -1; +} + +static void drv_MOGX_send(const unsigned char *data, const unsigned int size) +{ + int ret; + + //unsigned char rcv_buffer[64] = ""; + + ret = usb_bulk_write(lcd_dev, BULK_OUT_ENDPOINT, (char *) data, size, 1000); + + //info("%s written %d bytes\n", __FUNCTION__, ret); + + //ret = usb_bulk_read(lcd_dev, BULK_IN_ENDPOINT, (char *) rcv_buffer,64,1000); + + //printf("\nReply : "); + //for (i=0;i<ret;i++) + //printf("%3x",rcv_buffer[i]); +} + +static int drv_MOGX_close(void) +{ + /* close whatever port you've opened */ + usb_release_interface(lcd_dev, 0); + usb_close(lcd_dev); + + return 0; +} + +/* Send framebuffer to lcd */ +static void drv_MOGX_update_lcd() +{ + unsigned char cmd[3852] = { 0x38, 0x46, 0x42, 0x46, 0x50, 0x00, 0x00, 0x07, 0x80, 0xff, 0xff }; + /* + index : index of pixel_byte in cmd[] + bit : pixel of each pixel_byte + x : index of pixel in framebuffer + pixel_byte : each 8 pixel in framebuffer = 1 byte + */ + int index, bit, x = 0; + unsigned int cmd_length = 0; + unsigned char pixel_byte; + + //info("In %s\n", __FUNCTION__); + + for (index = 0; index < (SCREEN_SIZE / 8); index++) { + pixel_byte = 0x00; + for (bit = 7; bit >= 0; bit--) { + if (MOGX_framebuffer[x] ^ invert) + pixel_byte |= (1 << bit); + else + pixel_byte &= ~(1 << bit); + x++; + } + + if (pixel_byte == 0xc0) { + cmd[11 + cmd_length] = 0xdb; + cmd_length++; + cmd[11 + cmd_length] = 0xdc; + cmd_length++; + } else if (pixel_byte == 0xdb) { + cmd[11 + cmd_length] = 0xdb; + cmd_length++; + cmd[11 + cmd_length] = 0xdd; + cmd_length++; + } else { + cmd[11 + cmd_length] = pixel_byte; + cmd_length++; + } + } + /* finish command */ + cmd[11 + cmd_length] = 0xc0; + + //info("In %s - %s \n", __FUNCTION__, cmd_img); + /* send command which includes framebuffer */ + drv_MOGX_send(cmd, cmd_length + 12); +} + +static void drv_MOGX_blit(const int row, const int col, const int height, const int width) +{ + int r, c; + + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) + MOGX_framebuffer[r * SCREEN_W + c] = drv_generic_graphic_black(r, c); + } + drv_MOGX_update_lcd(); +} + +void drv_MOGX_clear(void) +{ + //info("In %s\n", __FUNCTION__); + memset(MOGX_framebuffer, 0x00, SCREEN_SIZE); + /* clear the screen */ + drv_MOGX_update_lcd(); +} + +/* TODO : I am not sure for contrast function (command) + Don't try to adjust contrast until contrast function is checked and fixed +*/ +/* +static int drv_MOGX_contrast(int contrast) +{ + unsigned char cmd[11] = {0x18,0x4c,0x43,0x53,0x43,0x00,0x00,0x00,0x01,0x00,0xc0}; + + // adjust limits according to the display + if (contrast < 0) + contrast = 0; + if (contrast > 255) + contrast = 255; + + // send contrast command + cmd[9] = contrast; + drv_MOGX_send(cmd, 11); + + return contrast; +} +*/ + +/* backlight function used in plugin */ +static int drv_MOGX_backlight(int backlight) +{ + unsigned char cmd[13] = { 0x18, 0x4c, 0x43, 0x53, 0x48, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc0 }; + + if (backlight < 0) + backlight = 0; + if (backlight >= 255) + backlight = 255; + + cmd[10] = backlight; + drv_MOGX_send(cmd, 13); + + return backlight; +} + +/* backlightRGB function used in plugin */ +static int drv_MOGX_backlightRGB(int backlight_R, int backlight_G, int backlight_B) +{ + /* + TODO : Function should be tested for three color LCD + */ + //unsigned char cmd1[11] = {0x18,0x4c,0x43,0x53,0x42,0x00,0x00,0x00,0x01,0xff,0xc0}; + unsigned char cmd2[13] = { 0x18, 0x4c, 0x43, 0x53, 0x48, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc0 }; + + if (backlight_R < 0) + backlight_R = 0; + if (backlight_R >= 255) + backlight_R = 255; + + if (backlight_G < 0) + backlight_G = 0; + if (backlight_G >= 255) + backlight_G = 255; + + if (backlight_B < 0) + backlight_B = 0; + if (backlight_B >= 255) + backlight_B = 255; + + //cmd1[9] = backlight; + cmd2[9] = backlight_R; + cmd2[10] = backlight_G; + cmd2[11] = backlight_B; + //drv_MOGX_send(cmd1, 11); + drv_MOGX_send(cmd2, 13); + + return backlight_R + backlight_G + backlight_B; +} + +/* start graphic display */ +static int drv_MOGX_start(const char *section, const __attribute__ ((unused)) + int quiet) +{ + char *s; + int value1, value2, value3; + + /* read display size from config */ + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + + DROWS = -1; + DCOLS = -1; + if (sscanf(s, "%dx%d", &DCOLS, &DROWS) != 2 || DCOLS < 1 || DROWS < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + return -1; + } + + s = cfg_get(section, "Font", "6x8"); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); + return -1; + } + + XRES = -1; + YRES = -1; + if (sscanf(s, "%dx%d", &XRES, &YRES) != 2 || XRES < 1 || YRES < 1) { + error("%s: bad %s.Font '%s' from %s", Name, section, s, cfg_source()); + return -1; + } + + /* Fixme: provider other fonts someday... */ + if (XRES != 6 && YRES != 8) { + error("%s: bad Font '%s' from %s (only 6x8 at the moment)", Name, s, cfg_source()); + return -1; + } + + if (cfg_number(section, "Invert", 0, 0, 1, &value1) > 0) + if (value1 > 0) { + info("%s: Display is inverted", Name); + invert = 0x01; + } + + /* open communication with the display */ + if (drv_MOGX_open() < 0) { + return -1; + } + + /* Init framebuffer buffer */ + MOGX_framebuffer = (unsigned char *) malloc(SCREEN_SIZE * sizeof(unsigned char)); + if (!MOGX_framebuffer) { + error("%s: framebuffer could not be allocated: malloc() failed", Name); + return -1; + } + + memset(MOGX_framebuffer, 0x00, SCREEN_SIZE); + //info("%s framebuffer zeroed", __FUNCTION__); + +/* TODO : I am not sure for contrast function (command) + Don't try to adjust contrast until contrast function is checked and fixed +*/ +/* + if (cfg_number(section, "Contrast", 0, 0, 255, &value1) > 0) { + info("%s: Setting contrast to %d", Name, value1); + drv_MOGX_contrast(value1); + } +*/ + /* if lcd has three color backlight call the backlightRGB function */ + if (backlight_RGB) { + if ((cfg_number(section, "Backlight_R", 0, 0, 255, &value1) > 0) && + (cfg_number(section, "Backlight_G", 0, 0, 255, &value2) > 0) && + (cfg_number(section, "Backlight_B", 0, 0, 255, &value3) > 0)) { + info("%s: Setting backlight to %d,%d,%d (RGB)", Name, value1, value2, value3); + drv_MOGX_backlightRGB(value1, value2, value3); + } + } else { + if ((cfg_number(section, "Backlight", 0, 0, 255, &value1) > 0)) { + info("%s: Setting backlight to %d", Name, value1); + drv_MOGX_backlight(value1); + } + } + + //info("In %s\n", __FUNCTION__); + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ +/* TODO : I am not sure for contrast function (command) + Don't try to adjust contrast until contrast function is checked and fixed +*/ +/* +static void plugin_contrast(RESULT * result, RESULT * arg1) +{ + double contrast; + + contrast = drv_MOGX_contrast(R2N(arg1)); + SetResult(&result, R_NUMBER, &contrast); +} +*/ + +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + double backlight; + + backlight = drv_MOGX_backlight(R2N(arg1)); + SetResult(&result, R_NUMBER, &backlight); +} + +static void plugin_backlightRGB(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT * arg3) +{ + double backlight; + + backlight = drv_MOGX_backlightRGB(R2N(arg1), R2N(arg2), R2N(arg3)); + SetResult(&result, R_NUMBER, &backlight); +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_MOGX_list(void) +{ + printf("Matrix Orbital GX Series driver"); + return 0; +} + +/* initialize driver & display */ +int drv_MOGX_init(const char *section, const int quiet) +{ + int ret; + + //info("%s: %s", Name, "$Rev: 2$"); + //info("Matrix Orbital GX Series LCD initialization\n"); + + /* real worker functions */ + drv_generic_graphic_real_blit = drv_MOGX_blit; + + /* start display */ + if ((ret = drv_MOGX_start(section, quiet)) != 0) + return ret; + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_graphic_greet(buffer, "http://www.matrixorbital.com")) { + sleep(3); + drv_generic_graphic_clear(); + } + } + + /* register plugins */ + /* TODO : I am not sure for contrast function (command) + Don't try to adjust contrast until contrast function is checked and fixed + */ + //AddFunction("LCD::contrast", 1, plugin_contrast); + if (backlight_RGB) + AddFunction("LCD::backlightRGB", 3, plugin_backlightRGB); + else + AddFunction("LCD::backlight", 1, plugin_backlight); + + //info("In %s\n", __FUNCTION__); + + memset(MOGX_framebuffer, 0x00, SCREEN_SIZE); + //DEBUG("zeroed"); + + return 0; +} + + + +/* close driver & display */ +int drv_MOGX_quit(const __attribute__ ((unused)) + int quiet) +{ + info("%s: shutting down.", Name); + + /* clear display */ + drv_MOGX_clear(); + + drv_generic_graphic_quit(); + + //debug("closing connection"); + drv_MOGX_close(); + + if (MOGX_framebuffer) { + free(MOGX_framebuffer); + } + + return (0); +} + +/* use this one for a graphic display */ +DRIVER drv_MatrixOrbitalGX = { + .name = Name, + .list = drv_MOGX_list, + .init = drv_MOGX_init, + .quit = drv_MOGX_quit, +}; diff --git a/drv_MilfordInstruments.c b/drv_MilfordInstruments.c index 62804bf..ed49ab8 100644 --- a/drv_MilfordInstruments.c +++ b/drv_MilfordInstruments.c @@ -1,5 +1,5 @@ -/* $Id: drv_MilfordInstruments.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_MilfordInstruments.c $ +/* $Id: drv_MilfordInstruments.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_MilfordInstruments.c $ * * driver for Milford Instruments 'BPK' piggy-back serial interface board * for standard Hitachi 44780 compatible lcd modules. @@ -8,7 +8,7 @@ * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the MatrixOrbital driver which is - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * * This file is part of LCD4Linux. * @@ -199,7 +199,7 @@ int drv_MI_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 840 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -1,9 +1,9 @@ -/* $Id: drv_NULL.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_NULL.c $ +/* $Id: drv_NULL.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_NULL.c $ * * NULL driver (for testing) * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -117,7 +117,7 @@ static int drv_NULL_start(const char *section) /* list models */ int drv_NULL_list(void) { - printf("generic"); + printf("NULL driver for testing purposes"); return 0; } @@ -129,7 +129,7 @@ int drv_NULL_init(const char *section, const __attribute__ ((unused)) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 6; /* pixel width of one char */ diff --git a/drv_Noritake.c b/drv_Noritake.c index 3725431..011ff35 100644 --- a/drv_Noritake.c +++ b/drv_Noritake.c @@ -1,5 +1,5 @@ -/* $Id: drv_Noritake.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Noritake.c $ +/* $Id: drv_Noritake.c 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Noritake.c $ * * Driver for a Noritake GU128x32-311 graphical display. * @@ -330,7 +330,7 @@ int drv_Noritake_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 771 $"); /* start display */ if ((ret = drv_Noritake_start(section)) != 0) diff --git a/drv_PHAnderson.c b/drv_PHAnderson.c new file mode 100644 index 0000000..667d0b0 --- /dev/null +++ b/drv_PHAnderson.c @@ -0,0 +1,416 @@ +/* $Id: drv_PHAnderson.c 840 2008-11-19 23:56:42 guimli $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_PHAnderson.c $ + * + * driver for the PHAnderson serial-to-HD44780 adapter boards + * http://www.phanderson.com/lcd106/lcd107.html + * http://moderndevice.com/Docs/LCD117CommandSummary.doc + * http://wulfden.org/TheShoppe/k107/index.shtml + * + * Copyright (C) 2008 Nicolas Weill <guimli@free.fr> + * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_PHAnderson + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <unistd.h> +#include <string.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" +#include "drv_generic_text.h" +#include "drv_generic_serial.h" + +#define PHAnderson_CMD '?' + +static char Name[] = "PHAnderson"; + +static int T_READ, T_WRITE, T_BOOT; + + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_PHAnderson_open(const char *section) +{ + if (drv_generic_serial_open(section, Name, 0) < 0) + return -1; + + return 0; +} + + +static int drv_PHAnderson_close(void) +{ + drv_generic_serial_close(); + + return 0; +} + + +static void drv_PHAnderson_send(const char *data, const unsigned int len) +{ + char buffer[255]; + unsigned int i, j; + + j = 0; + for (i = 0; i < len; i++) { + if (data[i] < 8) { + buffer[j++] = '?'; + buffer[j++] = '0' + data[i]; + drv_generic_serial_write(buffer, j); + udelay(T_READ); + + j = 0; + } else { + buffer[j++] = data[i]; + } + } + + if (j > 0) { + drv_generic_serial_write(buffer, j); + } +} + + +static void drv_PHAnderson_clear(void) +{ + char cmd[2]; + + cmd[0] = '?'; + cmd[1] = 'f'; + drv_PHAnderson_send(cmd, 2); +} + + +static void drv_PHAnderson_write(const int row, const int col, const char *data, int len) +{ + char cmd[7]; + + cmd[0] = '?'; + cmd[1] = 'y'; + cmd[2] = row + '0'; + cmd[3] = '?'; + cmd[4] = 'x'; + cmd[5] = col / 10 + '0'; + cmd[6] = col % 10 + '0'; + drv_PHAnderson_send(cmd, 7); + + drv_PHAnderson_send(data, len); +} + + +static void drv_PHAnderson_defchar(const int ascii, const unsigned char *matrix) +{ + char cmd[19]; + int i; + + cmd[0] = '?'; + cmd[1] = 'D'; + cmd[2] = ascii + '0'; + + for (i = 0; i < 8; i++) { + cmd[i * 2 + 3] = ((matrix[i] >> 4) & 1) + '0'; + cmd[i * 2 + 4] = (((matrix[i] & 0x0F) < 10) ? (matrix[i] & 0x0F) + '0' : (matrix[i] & 0x0F) + '7'); + } + drv_PHAnderson_send(cmd, 19); + udelay(T_WRITE); +} + + +static int drv_PHAnderson_blacklight(int blacklight) +{ + char cmd[4]; + + if (blacklight < 0) + blacklight = 0; + if (blacklight > 255) + blacklight = 255; + + cmd[0] = '?'; + cmd[1] = 'B'; + cmd[2] = (((blacklight >> 4) < 10) ? (blacklight >> 4) + '0' : (blacklight >> 4) + '7'); + cmd[3] = (((blacklight & 0x0F) < 10) ? (blacklight & 0x0F) + '0' : (blacklight & 0x0F) + '7'); + drv_PHAnderson_send(cmd, 4); + udelay(T_WRITE); + + return blacklight; +} + +static int drv_PHAnderson_bootscreen(const char *bootmsg) +{ + char cmd[255]; + int i, j, k; + + i = 0; + j = 0; + k = 0; + + if (bootmsg == NULL || *bootmsg == '\0') { + cmd[0] = '?'; + cmd[1] = 'S'; + cmd[2] = '0'; + drv_PHAnderson_send(cmd, 3); + udelay(T_WRITE); + } else { + cmd[0] = '?'; + cmd[1] = 'S'; + cmd[2] = '2'; + drv_PHAnderson_send(cmd, 3); + udelay(T_WRITE); + cmd[0] = '?'; + cmd[1] = 'C'; + for (i = 0; i < DROWS; i++) { + cmd[2] = '0' + i; + for (k = 0; k < DCOLS; k++) { + if (bootmsg[j] != '\0') { + cmd[3 + k] = bootmsg[j]; + j++; + } else { + cmd[3 + k] = ' '; + } + } + drv_PHAnderson_send(cmd, k + 3); + udelay(T_BOOT); + } + } + + return j; +} + +static int drv_PHAnderson_start(const char *section) +{ + int blacklight; + int rows = -1, cols = -1; + char *s; + char cmd[255]; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* PHAnderson execution timings [milliseconds] + * we use the worst-case default values, but allow + * modification from the config file. + */ + + T_WRITE = timing(Name, section, "WRITE", 170, "ms") * 1000; /* write eeprom time */ + T_READ = timing(Name, section, "READ", 10, "ms") * 1000; /* read eeprom time */ + T_BOOT = timing(Name, section, "BOOT", 300, "ms") * 1000; /* boot screen write eeprom time */ + + if (drv_PHAnderson_open(section) < 0) { + return -1; + } + + /* Define screen size */ + cmd[0] = '?'; + cmd[1] = 'G'; + cmd[2] = rows + '0'; + cmd[3] = (cols / 10) + '0'; + cmd[4] = (cols % 10) + '0'; + drv_PHAnderson_send(cmd, 5); + udelay(T_WRITE); + + /* Hide cursor */ + cmd[0] = '?'; + cmd[1] = 'c'; + cmd[2] = '0'; + drv_PHAnderson_send(cmd, 3); + udelay(T_WRITE); + + if (cfg_number(section, "Blacklight", 0, 0, 255, &blacklight) > 0) { + drv_PHAnderson_blacklight(blacklight); + } + + s = cfg_get(section, "Bootscreen", NULL); + printf(s); + drv_PHAnderson_bootscreen(s); + + drv_PHAnderson_clear(); /* clear display */ + + return 0; +} + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_blacklight(RESULT * result, RESULT * arg1) +{ + double blacklight; + + blacklight = drv_PHAnderson_blacklight(R2N(arg1)); + SetResult(&result, R_NUMBER, &blacklight); +} + +static void plugin_bootscreen(RESULT * result, RESULT * arg1) +{ + double bootmsg; + + bootmsg = drv_PHAnderson_bootscreen(R2S(arg1)); + SetResult(&result, R_NUMBER, &bootmsg); +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_PHAnderson_list(void) +{ + printf("PHAnderson serial-to-HD44780 adapter"); + return 0; +} + +int drv_PHAnderson_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 840 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 8; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 7; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_PHAnderson_write; + drv_generic_text_real_defchar = drv_PHAnderson_defchar; + + /* start display */ + if ((ret = drv_PHAnderson_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "www.bwct.de")) { + sleep(3); + drv_PHAnderson_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + drv_generic_text_bar_add_segment(0, 0, 0, 32); /* ASCII 32 = blank */ + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register icon widget */ + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + + /* register plugins */ + AddFunction("LCD::blacklight", 1, plugin_blacklight); + + AddFunction("LCD::bootscreen", 1, plugin_bootscreen); + + return 0; +} + + +int drv_PHAnderson_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + drv_PHAnderson_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + debug("closing connection"); + drv_PHAnderson_close(); + + return (0); +} + + +DRIVER drv_PHAnderson = { + .name = Name, + .list = drv_PHAnderson_list, + .init = drv_PHAnderson_init, + .quit = drv_PHAnderson_quit, +}; diff --git a/drv_PICGraphic.c b/drv_PICGraphic.c new file mode 100644 index 0000000..714ccbd --- /dev/null +++ b/drv_PICGraphic.c @@ -0,0 +1,478 @@ +/* $Id: drv_PICGraphic.c 1141 2011-01-23 17:01:08Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_PICGraphic.c $ + * + * PICGraphic lcd4linux driver + * + * Copyright (C) 2009 Peter Bailey <peter.eldridge.bailey@gmail.com> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_PICGraphic + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <strings.h> +#include <errno.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" +#include "timer.h" + +#include "drv_generic_graphic.h" +#include "drv_generic_gpio.h" +#include "drv_generic_serial.h" + +#define min(a,b) (a < b ? a : b) + +static char Name[] = "PICGraphic"; + +//#define partialFrame + +/* example config: + +Display PICGraphic { + Driver 'PICGraphic' + Port '/dev/ttyS1' + Contrast 8 +# these could be automatic + Size '48x128' + Speed 115200 + Font '6x8' +} + +*/ + +/* +typedef struct { + char *name; + int columns; + int rows; + int max_contrast; + int default_contrast; + int gpo; + int protocol; +} MODEL; +*/ + +static char *fbPG = 0, delayDone = 0; + +void drv_PICGraphic_delay(void *arg) +{ + (void) arg; + delayDone = 1; + debug("delay done"); +} + + +/****************************************/ +/*** hardware-dependent functions ***/ +/****************************************/ +static int drv_PICGraphic_open(const char *section) +{ + /* open serial port */ + if (drv_generic_serial_open(section, Name, 0) < 0) + return -1; + + return 0; +} + + +static int drv_PICGraphic_close(void) +{ + /* close opened serial port */ + return drv_generic_serial_close(); +} + +static void convert2ASCII(char input, char *output) +{ + unsigned char temp = input >> 4; + if (temp < 10) + output[0] = temp + '0'; + else + output[0] = temp - 10 + 'a'; + input &= 0xf; + if (input < 10) + output[1] = input + '0'; + else + output[1] = input - 10 + 'a'; +} + +static void drv_PICGraphic_send(const char *data, const unsigned int len) +{ + unsigned int i; + char hexDigits[3]; + hexDigits[2] = 0; + drv_generic_serial_write(data, len); + info("sending %d bytes: ", len); + for (i = 0; i < min(10, len); i++) { // min(10, len) + convert2ASCII(data[i], hexDigits); + debug("0x%s (%c)", hexDigits, data[i]); + } +} + +static int drv_PICGraphic_recv(char *dest, const unsigned int len, const char *expect) +{ + unsigned int bytes = 0; + int status; + while (bytes < len) { + status = drv_generic_serial_read((char *) dest + bytes, 1); + if (status == 1) { + if (dest[bytes] != 0xa && dest[bytes] != 0xd) { + if (dest[bytes] != '@') { + bytes += status; + } + } + } else { + info("error receiving response: %d", status); + return status; + } + usleep(10000); + } + status = strncmp((const char *) dest, expect, len); + if (!status) { + return 0; + } else { + return 1; + } + +} + +static void drv_PICGraphic_blit(const int row, const int col, const int height, const int width) +{ + /* update a rectangular portion of the display */ + int r, c, index, status; + unsigned char cmd[5]; + + debug("blit from (%d,%d) to (%d,%d) out of (%d,%d)", row, col, row + height, col + width, DROWS, DCOLS); + if (!fbPG) + return; + for (c = min(col, DCOLS - 1); c < min(col + width, DCOLS); c++) { + for (r = min(row, DROWS - 1); r < min(row + height, DROWS); r++) { + index = DCOLS * (r / 8) + c; + if (index < 0 || index >= DCOLS * DROWS / 8) { + error("index too large: %d, r: %d, c: %d", index, r, c); + break; + } + if (drv_generic_graphic_black(r, c)) { + fbPG[index] |= (1 << (r % 8)); + } else { + fbPG[index] &= ~(1 << (r % 8)); + } + } + } + + // send rectangular portion with height divisible by 8 +#ifdef partialFrame + if (delayDone) { + delayDone = 0; + int row8, height8; + row8 = 8 * (row / 8); + height8 = 8 * (height / 8) + !!(height % 8); + info("sending blit"); + cmd[0] = 'b'; + cmd[1] = row8; + cmd[2] = col; + cmd[3] = height8; + cmd[4] = width; + drv_PICGraphic_send(cmd, 5); + for (r = min(row8, DROWS - 1); r < min(row8 + height8, DROWS); r += 8) { + drv_PICGraphic_send(fbPG + DCOLS * (r / 8) + col, width); + } + } +#else + // send full frame + if (delayDone) { + delayDone = 0; + info("sending frame"); + cmd[0] = 'f'; + drv_PICGraphic_send((char *) cmd, 1); + drv_PICGraphic_send(fbPG, DROWS * DCOLS / 8); + usleep(20000); + // wait for reception of confirmation code + status = drv_PICGraphic_recv((char *) cmd, 2, "ff"); + if (!status) { + info("received ff from device"); + } else { + info("did not receive ff from device"); + } + + } +#endif +} + +static int drv_PICGraphic_GPO(const int num, const int val) +{ + char cmd[3]; + + cmd[0] = 'g'; + cmd[1] = val ? 's' : 'c'; + cmd[2] = num; + + // todo: fixme +// drv_PICGraphic_send(cmd, 3); + + return 0; +} + +static int drv_PICGraphic_GPI(const int num) +{ + char cmd[3]; + int ret = 0; + + cmd[0] = 'g'; + cmd[1] = 'r'; + cmd[2] = num; + + // todo: fixme +// drv_PICGraphic_send(cmd, 3); +// ret = drv_generic_serial_read(cmd, 1); + + if (ret) + return -1; + else + return cmd[0]; +} + +/* example function used in a plugin */ +static int drv_PICGraphic_contrast(int contrast) +{ + char cmd[2]; + + /* adjust limits according to the display */ + if (contrast < 0) + contrast = 0; + if (contrast > 15) + contrast = 15; + + /* call a 'contrast' function */ + cmd[0] = 'c'; + cmd[1] = contrast; + // todo: fixme +// drv_PICGraphic_send(cmd, 2); + + return contrast; +} + +/* start graphic display */ +static int drv_PICGraphic_start2(const char *section) +{ + char *s; + char cmd[2]; + int contrast, status, tick, tack; + + /* read display size from config */ + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + + DROWS = -1; + DCOLS = -1; + if (sscanf(s, "%dx%d", &DCOLS, &DROWS) != 2 || DCOLS < 1 || DROWS < 1) { + error("%s: bad Size '%s' from %s", Name, s, cfg_source()); + return -1; + } + + s = cfg_get(section, "Font", "6x8"); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); + return -1; + } + + XRES = -1; + YRES = -1; + if (sscanf(s, "%dx%d", &XRES, &YRES) != 2 || XRES < 1 || YRES < 1) { + error("%s: bad Font '%s' from %s", Name, s, cfg_source()); + return -1; + } + + if (XRES != 6 && YRES != 8) { + error("%s: bad Font '%s' from %s (only 6x8 at the moment)", Name, s, cfg_source()); + return -1; + } + + /* you surely want to allocate a framebuffer or something... */ + fbPG = calloc(DCOLS * DROWS / 8, 1); + if (!fbPG) { + error("failed to allocate framebuffer"); + return -1; + } + + info("allocated framebuffer with size %d", DCOLS * DROWS / 8); + if (cfg_number("Variables", "tick", 500, 100, 0, &tick) > 0 && + cfg_number("Variables", "tack", 500, 100, 0, &tack) > 0) { + info("tick & tack read from config"); + timer_add(drv_PICGraphic_delay, 0, min(tick, tack), 0); // + } else { + info("tick & tack not read from config"); + timer_add(drv_PICGraphic_delay, 0, 80, 0); // + } + + /* open communication with the display */ + if (drv_PICGraphic_open(section) < 0) { + return -1; + } + + /* reset & initialize display */ + cmd[0] = 'i'; + drv_PICGraphic_send(cmd, 1); + usleep(10000); + // wait for reception of confirmation code + status = drv_PICGraphic_recv(cmd, 2, "fi"); + + if (!status) { + info("received fi from device"); + } else { + info("did not receive fi from device"); + } + + if (cfg_number(section, "Contrast", 8, 0, 15, &contrast) > 0) { + drv_PICGraphic_contrast(contrast); + } + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_contrast(RESULT * result, RESULT * arg1) +{ + double contrast; + + contrast = drv_PICGraphic_contrast(R2N(arg1)); + SetResult(&result, R_NUMBER, &contrast); +} + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_PICGraphic_list(void) +{ + printf("PICGraphic serial-to-graphic by Peter Bailey"); + return 0; +} + +/* initialize driver & display */ +int drv_PICGraphic_init2(const char *section, const int quiet) +{ + int ret; + + /* real worker functions */ + drv_generic_graphic_real_blit = drv_PICGraphic_blit; + drv_generic_gpio_real_set = drv_PICGraphic_GPO; + drv_generic_gpio_real_get = drv_PICGraphic_GPI; + + /* start display */ + if ((ret = drv_PICGraphic_start2(section)) != 0) + return ret; + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_graphic_greet(buffer, NULL)) { + sleep(3); + drv_generic_graphic_clear(); // also clears main framebuffer + } + } + + /* register plugins */ + AddFunction("LCD::contrast", 1, plugin_contrast); + + return 0; +} + +/* close driver & display */ +/* use this function for a graphic display */ +int drv_PICGraphic_quit2(const int quiet) +{ + + info("%s: shutting down.", Name); + + /* clear display */ + drv_generic_graphic_clear(); + + drv_generic_gpio_quit(); + + + /* say goodbye... */ + if (!quiet) { + drv_generic_graphic_greet("goodbye!", NULL); + } + + info("freeing framebuffer"); + free(fbPG); + + drv_generic_graphic_quit(); + + debug("closing connection"); + drv_PICGraphic_close(); + + return (0); +} + +/* use this one for a graphic display */ +DRIVER drv_PICGraphic = { + .name = Name, + .list = drv_PICGraphic_list, + .init = drv_PICGraphic_init2, + .quit = drv_PICGraphic_quit2, +}; diff --git a/drv_Pertelian.c b/drv_Pertelian.c new file mode 100644 index 0000000..69b6580 --- /dev/null +++ b/drv_Pertelian.c @@ -0,0 +1,331 @@ +/* $Id: drv_Pertelian.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Pertelian.c $ + * + * Pertelian lcd4linux driver + * Copyright (C) 2007 Andy Powell <lcd4linux@automted.it> + * + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_Pertelian + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +#include "drv_generic_text.h" +#include "drv_generic_serial.h" + +static char Name[] = "Pertelian"; + +static unsigned char rowoffset[4] = { 0x80, 0x80 + 0x40, 0x80 + 0x14, 0x80 + 0x40 + 0x14 }; + +#define PERTELIAN_LCDCOMMAND 0xfe + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + + +static int drv_Pertelian_open(const char *section) +{ + if (drv_generic_serial_open(section, Name, 0) < 0) + return -1; + return 0; +} + + +static int drv_Pertelian_close(void) +{ + drv_generic_serial_close(); + return 0; +} + + +static void drv_Pertelian_send(const char *data, const unsigned int len) +{ + unsigned int i; + + /* Pertelian interface seems to offer no buffering at all + so we have to slow things down a tad yes 1usec is enough */ + + for (i = 0; i < len; i++) { + drv_generic_serial_write(&data[i], 1); + usleep(100); + } +} + + +static void drv_Pertelian_clear(void) +{ + char cmd[2]; + + cmd[0] = PERTELIAN_LCDCOMMAND; + cmd[1] = 0x01; + drv_Pertelian_send(cmd, 2); +} + + +static void drv_Pertelian_write(const int row, const int col, const char *data, int len) +{ + char cmd[3]; + + cmd[0] = PERTELIAN_LCDCOMMAND; + cmd[1] = ((rowoffset[row]) + (col)); + drv_Pertelian_send(cmd, 2); + drv_Pertelian_send(data, len); +} + + +static void drv_Pertelian_defchar(const int ascii, const unsigned char *matrix) +{ + char cmd[11] = ""; + int i; + + cmd[0] = PERTELIAN_LCDCOMMAND; + cmd[1] = (0x40 + (8 * ascii)); + for (i = 0; i < 8; i++) { + cmd[i + 2] = matrix[i] & 0x1f; + } + drv_Pertelian_send(cmd, 10); +} + + +static int drv_Pertelian_backlight(int backlight) +{ + char cmd[2]; + + if (backlight <= 0) + backlight = 2; + else if (backlight >= 1) + backlight = 3; + + cmd[0] = PERTELIAN_LCDCOMMAND; + cmd[1] = backlight; + + drv_Pertelian_send(cmd, 2); + + return backlight; +} + + +static int drv_Pertelian_start(const char *section) +{ + int backlight; + int rows = -1, cols = -1; + char *s; + char cmd[12] = ""; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* open communication with the display */ + if (drv_Pertelian_open(section) < 0) { + return -1; + } + + /* reset & initialize display */ + cmd[0] = PERTELIAN_LCDCOMMAND; + cmd[1] = 0x38; + cmd[2] = PERTELIAN_LCDCOMMAND; + cmd[3] = 0x06; + cmd[4] = PERTELIAN_LCDCOMMAND; + cmd[5] = 0x10; /* move cursor on data write */ + cmd[6] = PERTELIAN_LCDCOMMAND; + cmd[7] = 0x0c; + cmd[8] = 0x0c; + + drv_Pertelian_send(cmd, 8); + + if (cfg_number(section, "Backlight", 0, 0, 1, &backlight) > 0) { + drv_Pertelian_backlight(backlight); + } + + drv_Pertelian_clear(); /* clear display */ + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + double backlight = 0; + backlight = drv_Pertelian_backlight(R2N(arg1)); + SetResult(&result, R_NUMBER, &backlight); +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_Pertelian_list(void) +{ + printf("Pertelian X2040 displays"); + return 0; +} + + +/* initialize driver & display */ +int drv_Pertelian_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 975 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 8; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 2; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_Pertelian_write; + drv_generic_text_real_defchar = drv_Pertelian_defchar; + + + /* start display */ + if ((ret = drv_Pertelian_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "LinITX.com")) { + sleep(3); + drv_Pertelian_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ + + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register icon widget */ + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + AddFunction("LCD::backlight", 1, plugin_backlight); + return 0; +} + + +/* close driver & display */ +int drv_Pertelian_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + drv_generic_text_quit(); + + /* clear display */ + drv_Pertelian_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + drv_Pertelian_backlight(0); + debug("closing connection"); + drv_Pertelian_close(); + + return (0); +} + + +DRIVER drv_Pertelian = { + .name = Name, + .list = drv_Pertelian_list, + .init = drv_Pertelian_init, + .quit = drv_Pertelian_quit, +}; diff --git a/drv_RouterBoard.c b/drv_RouterBoard.c index a254fe4..0948255 100644 --- a/drv_RouterBoard.c +++ b/drv_RouterBoard.c @@ -1,5 +1,5 @@ -/* $Id: drv_RouterBoard.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_RouterBoard.c $ +/* $Id: drv_RouterBoard.c 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_RouterBoard.c $ * * driver for the "Router Board LCD port" * see port details at http://www.routerboard.com @@ -550,7 +550,7 @@ int drv_RB_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 771 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_Sample.c b/drv_Sample.c index 77effca..05df26b 100644 --- a/drv_Sample.c +++ b/drv_Sample.c @@ -1,9 +1,9 @@ -/* $Id: drv_Sample.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Sample.c $ +/* $Id: drv_Sample.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Sample.c $ * * sample lcd4linux driver * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -408,7 +408,7 @@ static void plugin_contrast(RESULT * result, RESULT * arg1) /* list models */ int drv_Sample_list(void) { - printf("generic"); + printf("Sample driver"); return 0; } @@ -420,7 +420,7 @@ int drv_Sample_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_ShuttleVFD.c b/drv_ShuttleVFD.c new file mode 100644 index 0000000..24fc434 --- /dev/null +++ b/drv_ShuttleVFD.c @@ -0,0 +1,429 @@ +/* $Id: drv_Sample.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Sample.c $ + * + * Shuttle SG33G5M VFD lcd4linux driver + * + * Copyright (C) 2009 Matthieu Crapet <mcrapet@gmail.com> + * based on the USBLCD driver. + * + * Shuttle SG33G5M VFD (20x1 character display. Each character cell is 5x8 pixels) + * - The display is driven by Princeton Technologies PT6314 VFD controller + * - Cypress CY7C63723C (receives USB commands and talk to VFD controller) + * + * LCD "prococol" : each message has a length of 8 bytes + * - 1 nibble: command (0x1, 0x3, 0x7, 0x9, 0xD) + * - 0x1 : clear text and icons (len=1) + * - 0x7 : icons (len=4) + * - 0x9 : text (len=7) + * - 0xD : set clock data (len=7) + * - 0x3 : display clock (internal feature) (len=1) + * - 1 nibble: message length (0-7) + * - 7 bytes : message data + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_ShuttleVFD + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#ifdef HAVE_USB_H +#include <usb.h> +#else +#error "ShuttleVFD: libusb required" +#endif + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_bar.h" // for DIRECTION +#include "drv.h" +#include "drv_generic_text.h" +#include "drv_generic_gpio.h" + + +/* + * Some hardware definitions + */ +// VFD USB properties +#define SHUTTLE_VFD_VENDOR_ID 0x051C +#define SHUTTLE_VFD_PRODUCT_ID1 0x0003 +#define SHUTTLE_VFD_PRODUCT_ID2 0x0005 // IR-receiver included +#define SHUTTLE_VFD_INTERFACE_NUM 1 + +// VFD physical dimensions +#define SHUTTLE_VFD_WIDTH 20 +#define SHUTTLE_VFD_HEIGHT 1 + +// VFD USB control message +#define SHUTTLE_VFD_PACKET_SIZE 8 +#define SHUTTLE_VFD_DATA_SIZE (SHUTTLE_VFD_PACKET_SIZE-1) +#define SHUTTLE_VFD_SUCCESS_SLEEP_USEC 25600 + + +/* Global static data */ +static char Name[] = "ShuttleVFD"; +static usb_dev_handle *lcd; +static unsigned char buffer[SHUTTLE_VFD_PACKET_SIZE]; + +/* Issues with the display module: + * - Can't set cursor position. Must save full buffer here. + * - Can't get icons status (on or off). Must save status here. + * - Clear command also clear text AND icons. + */ +static unsigned char fb[SHUTTLE_VFD_WIDTH * SHUTTLE_VFD_HEIGHT]; +static unsigned icons; + + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +/* look for device on USB bus */ +static int drv_ShuttleVFD_open(void) +{ + struct usb_bus *bus; + struct usb_device *dev; + + int vendor_id = SHUTTLE_VFD_VENDOR_ID; + int interface = SHUTTLE_VFD_INTERFACE_NUM; + + lcd = NULL; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + + for (bus = usb_get_busses(); bus != NULL; bus = bus->next) { + for (dev = bus->devices; dev != NULL; dev = dev->next) { + if (dev->descriptor.idVendor == vendor_id && ((dev->descriptor.idProduct == SHUTTLE_VFD_PRODUCT_ID1) || + (dev->descriptor.idProduct == SHUTTLE_VFD_PRODUCT_ID2))) { + + unsigned int v = dev->descriptor.bcdDevice; + + info("%s: found ShuttleVFD V%1d%1d.%1d%1d on bus %s device %s", Name, + (v & 0xF000) >> 12, (v & 0xF00) >> 8, (v & 0xF0) >> 4, (v & 0xF), bus->dirname, dev->filename); + + lcd = usb_open(dev); + } + } + } + + if (lcd != NULL) { + if (usb_claim_interface(lcd, interface) < 0) { + usb_close(lcd); + error("%s: usb_claim_interface() failed!", Name); + error("%s: root permissions maybe required?", Name); + return -1; + } + } else { + error("%s: could not find ShuttleVFD", Name); + return -1; + } + + return 0; +} + + +static int drv_ShuttleVFD_close(void) +{ + int interface = SHUTTLE_VFD_INTERFACE_NUM; + + usb_release_interface(lcd, interface); + usb_close(lcd); + return 0; +} + + +static void drv_ShuttleVFD_send(unsigned char packet[SHUTTLE_VFD_PACKET_SIZE]) +{ + if (usb_control_msg(lcd, 0x21, // requesttype + 0x09, // request + 0x0200, // value + 0x0001, // index + (char *) packet, SHUTTLE_VFD_PACKET_SIZE, 100) == SHUTTLE_VFD_PACKET_SIZE) { + + udelay(SHUTTLE_VFD_SUCCESS_SLEEP_USEC); + } else { + debug("usb_control_msg failed"); + } +} + + +/* Clear full display and icons. */ +static void drv_ShuttleVFD_clear(void) +{ + // Update local framebuffer mirror + memset(fb, ' ', SHUTTLE_VFD_HEIGHT * SHUTTLE_VFD_WIDTH); + + buffer[0] = (1 << 4) + 1; + buffer[1] = 0x1; + drv_ShuttleVFD_send(buffer); +} + + +static void drv_ShuttleVFD_reset_cursor(void) +{ + buffer[0] = (1 << 4) + 1; + buffer[1] = 0x2; + drv_ShuttleVFD_send(buffer); +} + + +/* text mode displays only */ +static void drv_ShuttleVFD_write(const int row, const int col, const char *data, int len) +{ + unsigned char *p; + int i; + + // Update local framebuffer mirror + memcpy(fb + (row * SHUTTLE_VFD_WIDTH) + col, data, len); + + p = fb; + len = SHUTTLE_VFD_WIDTH; + + drv_ShuttleVFD_reset_cursor(); + + while (len > 0) { + if (len > 7) + buffer[0] = (9 << 4) + 7; + else + buffer[0] = (9 << 4) + len; + + for (i = 0; i < 7 && len--; i++) { + buffer[i + 1] = *p++; + } + + drv_ShuttleVFD_send(buffer); + } +} + + +static void drv_ShuttleVFD_defchar(const int ascii, const unsigned char *matrix) +{ + (void) matrix; + debug("%s: not available (ascii=%d)", Name, ascii); +} + + +static int drv_ShuttleVFD_start(const char *section) +{ + char *port; + + port = cfg_get(section, "Port", NULL); + + if (port == NULL || *port == '\0') { + error("%s: no '%s.Port' entry from %s", Name, section, cfg_source()); + return -1; + } + + if (strcasecmp(port, "libusb") != 0) { + error("%s: libusb expected", Name); + error("%s: compile lcd4linux with libusb support!", Name); + return -1; + } + + DROWS = SHUTTLE_VFD_HEIGHT; + DCOLS = SHUTTLE_VFD_WIDTH; + + /* open communication with the display */ + if (drv_ShuttleVFD_open() < 0) { + return -1; + } + + drv_ShuttleVFD_clear(); /* clear display */ + return 0; +} + + +/* VFD Icons. Add +1 in lcd4linux.conf (GPO1..GPIO27) + * 0: television + * 1: cd/dvd + * 2: music + * 3: radio + * 4: clock + * 5: pause + * 6: play + * 7: record + * 8: rewind + * 9: camera + * 10: mute + * 11: repeat + * 12: reverse + * 13: fastforward + * 14: stop + * 15: volume 1 + * 16: volume 2 + * ... + * 25: volume 11 + * 26: volume 12 + */ +static int drv_ShuttleVFD_icons_set(const int num, const int val) +{ + unsigned long value; + + if (num < 0 || num >= 27) { + info("%s: num %d out of range (1..27)", Name, num); + return -1; + } + // Special case for volume (icon n°16) + if (num >= 15) + value = (num - 15 + 1) << 15; + else + value = 1 << num; + + if (val > 0) + icons |= value; + else + icons &= ~value; + + buffer[0] = (7 << 4) + 4; + buffer[1] = (value >> 15) & 0x1F; + buffer[2] = (value >> 10) & 0x1F; + buffer[3] = (value >> 5) & 0x1F; + buffer[4] = value & 0x1F; // each data byte is stored on 5 bits + drv_ShuttleVFD_send(buffer); + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +/* none yet ! */ + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* supported Shuttle models */ +int drv_ShuttleVFD_list(void) +{ + printf("Shuttle SG33G5M, Shuttle PF27 upgrade kit"); + return 0; +} + + +/* initialize driver & text display */ +int drv_ShuttleVFD_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + info("%s: %s", Name, "$Rev: 975 $"); + + /* display preferences */ + XRES = 5; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + CHARS = 0; /* number of user-defineable characters */ + CHAR0 = 0; /* ASCII of first user-defineable char */ + GOTO_COST = 2; /* number of bytes a goto command requires */ + GPOS = 15 + 12; /* Fancy icons on top of display */ + + /* real worker functions */ + drv_generic_text_real_write = drv_ShuttleVFD_write; + drv_generic_text_real_defchar = drv_ShuttleVFD_defchar; + drv_generic_gpio_real_set = drv_ShuttleVFD_icons_set; + + /* start display */ + if ((ret = drv_ShuttleVFD_start(section)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "Shuttle")) { + sleep(3); + drv_ShuttleVFD_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic GPIO driver */ + if ((ret = drv_generic_gpio_init(section, Name)) != 0) + return ret; + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + return 0; +} + + +/* close driver & text display */ +int drv_ShuttleVFD_quit(const int quiet) +{ + info("%s: shutting down.", Name); + + /* clear display */ + drv_ShuttleVFD_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + drv_generic_text_quit(); + drv_generic_gpio_quit(); + + debug("closing connection"); + drv_ShuttleVFD_close(); + + return (0); +} + + +DRIVER drv_ShuttleVFD = { + .name = Name, + .list = drv_ShuttleVFD_list, + .init = drv_ShuttleVFD_init, + .quit = drv_ShuttleVFD_quit, +}; diff --git a/drv_SimpleLCD.c b/drv_SimpleLCD.c index de68b92..f308d87 100644 --- a/drv_SimpleLCD.c +++ b/drv_SimpleLCD.c @@ -1,5 +1,5 @@ -/* $Id: drv_SimpleLCD.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_SimpleLCD.c $ +/* $Id: drv_SimpleLCD.c 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_SimpleLCD.c $ * * driver for a simple serial terminal. * @@ -284,7 +284,7 @@ int drv_SL_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 771 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_T6963.c b/drv_T6963.c index 0635c15..40fd6db 100644 --- a/drv_T6963.c +++ b/drv_T6963.c @@ -1,9 +1,9 @@ -/* $Id: drv_T6963.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_T6963.c $ +/* $Id: drv_T6963.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_T6963.c $ * * new style driver for T6963-based displays * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -65,7 +65,7 @@ typedef struct { } MODEL; static MODEL Models[] = { - {0x01, "generic"}, + {0x01, "T6963"}, {0xff, "Unknown"} }; @@ -279,7 +279,7 @@ static void drv_T6_clear(const unsigned short addr, const int len) drv_T6_write_auto(0x0); if (bug) { bug = 0; - debug("bug occured at byte %d of %d", i, len); + debug("bug occurred at byte %d of %d", i, len); } } drv_T6_status2(); @@ -297,7 +297,7 @@ static void drv_T6_copy(const unsigned short addr, const unsigned char *data, co drv_T6_write_auto(*(data++)); if (bug) { bug = 0; - debug("bug occured at byte %d of %d, addr=%d", i, len, addr); + debug("bug occurred at byte %d of %d, addr=%d", i, len, addr); } } drv_T6_status2(); @@ -509,7 +509,7 @@ int drv_T6_init(const char *section, const int quiet) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1136 $"); /* real worker functions */ drv_generic_graphic_real_blit = drv_T6_blit; diff --git a/drv_Trefon.c b/drv_Trefon.c index 9bffa8b..00d03eb 100644 --- a/drv_Trefon.c +++ b/drv_Trefon.c @@ -1,9 +1,9 @@ -/* $Id: drv_Trefon.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Trefon.c $ +/* $Id: drv_Trefon.c 975 2009-01-18 11:16:20Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_Trefon.c $ * * driver for TREFON USB LCD displays - http://www.trefon.de * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -72,8 +72,6 @@ static char Name[] = "TREFON"; static usb_dev_handle *lcd; static int interface; -extern int usb_debug; - /****************************************/ /*** hardware dependant functions ***/ @@ -88,7 +86,7 @@ static int drv_TF_open(void) info("%s: scanning USB for TREFON LCD...", Name); - usb_debug = 0; + usb_set_debug(0); usb_init(); usb_find_busses(); @@ -314,7 +312,7 @@ static void plugin_backlight(RESULT * result, RESULT * arg1) /* list models */ int drv_TF_list(void) { - printf("generic"); + printf("TREFON USB LCD"); return 0; } @@ -326,7 +324,7 @@ int drv_TF_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 975 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_USBHUB.c b/drv_USBHUB.c index b2de439..f0050da 100644 --- a/drv_USBHUB.c +++ b/drv_USBHUB.c @@ -1,12 +1,12 @@ -/* $Id: drv_USBHUB.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_USBHUB.c $ +/* $Id: drv_USBHUB.c 1126 2010-07-13 03:25:44Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_USBHUB.c $ * - * new style driver for USBLCD displays + * driver for USBHUB * * Copyright (C) 2006 Ernst Bachmann <e.bachmann@xebec.de> * Copyright (C) 2004,2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * - * Based on the USBLCD driver Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Based on the USBLCD driver Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * * This file is part of LCD4Linux. * @@ -37,9 +37,9 @@ #include "config.h" #ifdef HAVE_USB_H -# include <usb.h> +#include <usb.h> #else -# error The USB-HUB driver only makes sense with USB support +#error The USB-HUB driver only makes sense with USB support #endif #include "debug.h" @@ -257,7 +257,7 @@ static int drv_UH_start(const char *section, const __attribute__ ((unused)) /* list models */ int drv_UH_list(void) { - printf("generic"); + printf("USBHUB"); return 0; } @@ -268,7 +268,7 @@ int drv_UH_init(const char *section, const int quiet) int ret; int i; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1126 $"); diff --git a/drv_USBLCD.c b/drv_USBLCD.c index ecb14a2..20346c6 100644 --- a/drv_USBLCD.c +++ b/drv_USBLCD.c @@ -1,9 +1,9 @@ -/* $Id: drv_USBLCD.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_USBLCD.c $ +/* $Id: drv_USBLCD.c 1143 2011-02-12 22:46:19Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_USBLCD.c $ * * new style driver for USBLCD displays * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old-style USBLCD driver which is @@ -86,8 +86,6 @@ static char *BufPtr; static usb_dev_handle *lcd; static int interface; -extern int usb_debug; - #endif @@ -107,7 +105,7 @@ static int drv_UL_open(void) info("%s: scanning for USBLCD...", Name); - usb_debug = 0; + usb_set_debug(0); usb_init(); usb_find_busses(); @@ -339,7 +337,7 @@ static int drv_UL_start(const char *section, const int quiet) /* Init the command buffer */ Buffer = (char *) malloc(1024); if (Buffer == NULL) { - error("%s: coommand buffer could not be allocated: malloc() failed", Name); + error("%s: command buffer could not be allocated: malloc() failed", Name); return -1; } BufPtr = Buffer; @@ -390,7 +388,7 @@ static int drv_UL_start(const char *section, const int quiet) /* list models */ int drv_UL_list(void) { - printf("generic"); + printf("USBLCD"); return 0; } @@ -402,7 +400,7 @@ int drv_UL_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1143 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ diff --git a/drv_WincorNixdorf.c b/drv_WincorNixdorf.c index 2e0475d..ef090e4 100644 --- a/drv_WincorNixdorf.c +++ b/drv_WincorNixdorf.c @@ -1,9 +1,9 @@ -/* $Id: drv_WincorNixdorf.c 776 2007-02-26 10:34:52Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_WincorNixdorf.c $ +/* $Id: drv_WincorNixdorf.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_WincorNixdorf.c $ * * driver for WincorNixdorf serial cashier displays BA63 and BA66 * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the SimpleLCD driver which is @@ -201,7 +201,7 @@ int drv_WN_init(const char *section, const int quiet) int ascii; int ret; - info("%s: %s", Name, "$Rev: 776 $"); + info("%s: %s", Name, "$Rev: 840 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -1,10 +1,10 @@ -/* $Id: drv_X11.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_X11.c $ +/* $Id: drv_X11.c 1125 2010-07-11 11:17:41Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_X11.c $ * * new style X11 Driver for LCD4Linux * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> - * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old XWindow.c which is * Copyright (C) 2000 Herbert Rosmanith <herp@wildsau.idv.uni-linz.ac.at> @@ -46,16 +46,22 @@ #include <termios.h> #include <fcntl.h> #include <sys/time.h> +#include <signal.h> #include <X11/Xlib.h> #include <X11/Xutil.h> +#include <X11/Xresource.h> #include "debug.h" #include "cfg.h" #include "qprintf.h" #include "timer.h" #include "plugin.h" +#include "rgb.h" #include "drv.h" +#include "widget.h" +#include "widget_keypad.h" #include "drv_generic_graphic.h" +#include "drv_generic_keypad.h" #ifdef WITH_DMALLOC #include <dmalloc.h> @@ -68,10 +74,17 @@ static int pgap = 0; /* gap between points */ static int rgap = 0; /* row gap between lines */ static int cgap = 0; /* column gap between characters */ static int border = 0; /* window border */ +static int buttons = 0; /* number of keypad buttons */ +static int btnwidth = 0; +static int btnheight = 0; static int dimx, dimy; /* total window dimension in pixel */ +static Atom wmDeleteMessage; -static RGBA *drv_X11_FB = NULL; +static RGBA *drv_X11_FB = NULL; /* framebuffer */ + +static RGBA BP_COL = {.R = 0xff,.G = 0xff,.B = 0xff,.A = 0x00 }; /* pixel background color */ +static RGBA BR_COL = {.R = 0xff,.G = 0xff,.B = 0xff,.A = 0x00 }; /* border color */ static Display *dp; static int sc, dd; @@ -79,33 +92,61 @@ static Window w, rw; static Visual *vi; static GC gc; static Colormap cm; -static XColor xc; static Pixmap pm; +static int allow_autorepeat = 1; /* consider auto-repeated KeyPress events? */ + +static char myDisplayName[256] = ""; +static int opTableEntries = 2; +static XrmOptionDescRec opTable[] = { + {"-display", ".display", XrmoptionSepArg, NULL}, + {"-synchronous", "*synchronous", XrmoptionNoArg, "on"}, +}; + +static XrmDatabase commandlineDB; + /****************************************/ /*** hardware dependant functions ***/ /****************************************/ -static void drv_X11_color(RGBA c) +static XColor drv_X11_color(RGBA c, int brightness) { - xc.red = 255 * c.R; - xc.green = 255 * c.G; - xc.blue = 255 * c.B; - xc.flags = DoRed | DoGreen | DoBlue; - if (XAllocColor(dp, cm, &xc) == False) { - error("%s: XAllocColor(%02x%02x%02x) failed!", Name, c.R, c.G, c.B); + static XColor col[64]; + static unsigned char alloced[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + XColor xc; + int key; + + xc.red = brightness * c.R; + xc.green = brightness * c.G; + xc.blue = brightness * c.B; + /* 16bits per color, compressed to 6 bits (2 each color) */ + key = (xc.red & 0xc000) >> 10 | (xc.green & 0xc000) >> 12 | (xc.blue & 0xc000) >> 14; + /* todo: support more than 64 colors: check if allocated color is exactly the requested */ + if (alloced[key]) { + xc = col[key]; + } else { + xc.flags = DoRed | DoGreen | DoBlue; + if (XAllocColor(dp, cm, &xc) == False) { + error("%s: XAllocColor(%02x%02x%02x) failed!", Name, c.R, c.G, c.B); + } + col[key] = xc; + alloced[key] = 1; } + XSetForeground(dp, gc, xc.pixel); - XSetBackground(dp, gc, xc.pixel); + return (xc); } static void drv_X11_blit(const int row, const int col, const int height, const int width) { int r, c; - int dirty = 0; for (r = row; r < row + height; r++) { int y = border + (r / YRES) * rgap + r * (pixel + pgap); @@ -114,16 +155,89 @@ static void drv_X11_blit(const int row, const int col, const int height, const i RGBA p1 = drv_X11_FB[r * DCOLS + c]; RGBA p2 = drv_generic_graphic_rgb(r, c); if (p1.R != p2.R || p1.G != p2.G || p1.B != p2.B) { - drv_X11_color(p2); - XFillRectangle(dp, w, gc, x, y, pixel, pixel); + XClearArea(dp, w, x, y, pixel, pixel, 1); drv_X11_FB[r * DCOLS + c] = p2; - dirty = 1; } } } - if (dirty) { - XSync(dp, False); +} + + +static int drv_X11_brightness(int brightness) +{ + static int Brightness = 255; + int i; + + /* -1 is used to query the current brightness */ + if (brightness == -1) + return Brightness; + + if (brightness < 0) + brightness = 0; + if (brightness > 255) + brightness = 255; + + if (Brightness != brightness) { + + float dim = brightness / 255.0; + + debug("%s: set brightness to %d%%", Name, (int) (dim * 100)); + + /* set new background */ + XSetWindowBackground(dp, w, drv_X11_color(BR_COL, brightness).pixel); + + /* redraw every LCD pixel */ + XClearWindow(dp, w); + for (i = 0; i < DROWS * DCOLS; i++) { + drv_X11_FB[i] = NO_COL; + } + drv_X11_blit(0, 0, LROWS, LCOLS); + + /* remember new brightness */ + Brightness = brightness; } + + return Brightness; +} + + +static int drv_X11_keypad(const int num) +{ + int val; + int new_num = num; + + if (new_num > 0) + val = WIDGET_KEY_PRESSED; + else { + /* negative values mark a key release */ + new_num = -num; + val = WIDGET_KEY_RELEASED; + } + + switch (new_num) { + case 1: + val += WIDGET_KEY_UP; + break; + case 2: + val += WIDGET_KEY_DOWN; + break; + case 3: + val += WIDGET_KEY_LEFT; + break; + case 4: + val += WIDGET_KEY_RIGHT; + break; + case 5: + val += WIDGET_KEY_CONFIRM; + break; + case 6: + val += WIDGET_KEY_CANCEL; + break; + default: + error("%s: unknown keypad value %d", Name, num); + } + + return val; } @@ -140,6 +254,18 @@ static void drv_X11_expose(const int x, const int y, const int width, const int int r, c; int x0, y0; int x1, y1; + XFontStruct *xfs; + int xoffset = border + (DCOLS / XRES) * cgap + DCOLS * (pixel + pgap); + int yoffset = border + (DROWS / YRES) * rgap; + int yk; + char *s; + char unknownTxt[10]; + XRectangle rect[DROWS * DCOLS]; + int nrect = 0; + RGBA col; + RGBA lastCol = { 0, 0, 0, 0 }; + int hasLastCol = 0; + int brightness = drv_X11_brightness(-1); x0 = x - pixel; x1 = x + pixel + width; @@ -154,11 +280,72 @@ static void drv_X11_expose(const int x, const int y, const int width, const int int xc = border + (c / XRES) * cgap + c * (pixel + pgap); if (xc < x0 || xc > x1) continue; - drv_X11_color(drv_generic_graphic_rgb(r, c)); - XFillRectangle(dp, w, gc, xc, yc, pixel, pixel); + col = drv_generic_graphic_rgb(r, c); + if (hasLastCol) { + /* if the color of this pixel is different to the last pixels draw the old ones */ + if (col.R != lastCol.R || col.G != lastCol.G || col.B != lastCol.B) { + drv_X11_color(lastCol, brightness); + XFillRectangles(dp, w, gc, rect, nrect); + nrect = 0; + lastCol = col; + } + rect[nrect].x = xc; + rect[nrect].y = yc; + rect[nrect].width = pixel; + rect[nrect].height = pixel; + nrect++; + } else { + /* 1st shot: no old color */ + drv_X11_color(col, brightness); + XFillRectangle(dp, w, gc, xc, yc, pixel, pixel); + lastCol = col; + hasLastCol = 1; + } + } + } + /* draw the last block of rectangles */ + drv_X11_color(lastCol, brightness); + XFillRectangles(dp, w, gc, rect, nrect); + + /* Keypad on the right side */ + if (x1 >= xoffset) { + xfs = XQueryFont(dp, XGContextFromGC(DefaultGC(dp, 0))); + if (drv_X11_brightness(-1) > 127) { + drv_X11_color(FG_COL, 255); + } else { + drv_X11_color(BG_COL, 255); + } + for (r = 0; r < buttons; r++) { + yk = yoffset + r * (btnheight + pgap); + switch (r) { + case 0: + s = "Up"; + break; + case 1: + s = "Down"; + break; + case 2: + s = "Left"; + break; + case 3: + s = "Right"; + break; + case 4: + s = "Confirm"; + break; + case 5: + s = "Cancel"; + break; + default: + snprintf(unknownTxt, sizeof(unknownTxt), "#%d??", r); + s = unknownTxt; + } + XDrawRectangle(dp, w, gc, xoffset, yk, btnwidth, btnheight - 2); + XDrawString(dp, w, gc, + xoffset + btnwidth / 2 - (xfs->max_bounds.width * strlen(s)) / 2, + yk + btnheight / 2 + xfs->max_bounds.ascent / 2, s, strlen(s)); } } - XSync(dp, False); } @@ -166,11 +353,171 @@ static void drv_X11_timer( __attribute__ ((unused)) void *notused) { XEvent ev; - - if (XCheckWindowEvent(dp, w, ExposureMask, &ev) == 0) + XRectangle exp; + KeySym key; + int xoffset = border + (DCOLS / XRES) * cgap + DCOLS * (pixel + pgap); + int yoffset = border + (DROWS / YRES) * rgap; + static int btn = 0; + + if (XCheckWindowEvent + (dp, w, ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask, &ev) == 0 + /* there is no ClientMessageMask, so this will be checked separately */ + && XCheckTypedWindowEvent(dp, w, ClientMessage, &ev) == 0) return; - if (ev.type == Expose) { - drv_X11_expose(ev.xexpose.x, ev.xexpose.y, ev.xexpose.width, ev.xexpose.height); + + /* check whether key has been retriggered by "auto repeat" */ + unsigned short is_retriggered = 0; + + switch (ev.type) { + + case Expose: + /* collect all expose events in eventqueue */ + exp.x = ev.xexpose.x; + exp.y = ev.xexpose.y; + exp.width = ev.xexpose.width; + exp.height = ev.xexpose.height; + while (XCheckWindowEvent(dp, w, ExposureMask, &ev)) { + if (ev.xexpose.x < exp.x) { + exp.width += exp.x - ev.xexpose.x; + exp.x -= exp.x - ev.xexpose.x; + } + if (ev.xexpose.y < exp.y) { + exp.height += exp.y - ev.xexpose.y; + exp.y -= exp.y - ev.xexpose.y; + } + if (ev.xexpose.x + ev.xexpose.width > exp.x + exp.width) { + exp.width += ev.xexpose.x + ev.xexpose.width - (exp.x + exp.width); + } + if (ev.xexpose.y + ev.xexpose.height > exp.y + exp.height) { + exp.height += ev.xexpose.y + ev.xexpose.height - (exp.y + exp.height); + } + } + drv_X11_expose(exp.x, exp.y, exp.width, exp.height); + break; + + case KeyPress: + key = XLookupKeysym(&ev.xkey, 0); + switch (key) { + case XK_Up: + btn = 1; + break; + case XK_Down: + btn = 2; + break; + case XK_Left: + btn = 3; + break; + case XK_Right: + btn = 4; + break; + case XK_Return: + btn = 5; + break; + case XK_Escape: + btn = 6; + break; + default: + btn = 0; + } + /* only register key press if button is defined on GUI */ + if (btn > 0) { + if (btn <= buttons) { + debug("key for button %i pressed", btn); + drv_X11_color(BG_COL, 255); + XFillRectangle(dp, w, gc, xoffset + 1, yoffset + (btn - 1) * (btnheight + pgap) + 1, btnwidth - 1, + btnheight - 2 - 1); + drv_generic_keypad_press(btn); + } else { + debug("key press for button %i ignored", btn); + } + } + break; + + case KeyRelease: + /* check whether key has been retriggered by "auto repeat" */ + if (!allow_autorepeat && XEventsQueued(dp, QueuedAfterReading)) { + XEvent nev; + XPeekEvent(dp, &nev); + + if (nev.type == KeyPress && nev.xkey.time == ev.xkey.time && nev.xkey.keycode == ev.xkey.keycode) { + is_retriggered = 1; + + /* delete retriggered KeyPress event */ + XNextEvent(dp, &ev); + } + } + + key = XLookupKeysym(&ev.xkey, 0); + switch (key) { + case XK_Up: + btn = 1; + break; + case XK_Down: + btn = 2; + break; + case XK_Left: + btn = 3; + break; + case XK_Right: + btn = 4; + break; + case XK_Return: + btn = 5; + break; + case XK_Escape: + btn = 6; + break; + } + /* only register key release if button is defined on GUI */ + if (!is_retriggered && (btn > 0)) { + if (btn <= buttons) { + debug("key for button %i released", btn); + XClearArea(dp, w, xoffset, yoffset + (btn - 1) * (btnheight + pgap), btnwidth, btnheight - 2, + 1 /* true */ ); + /* negative values mark a key release */ + drv_generic_keypad_press(-btn); + } else { + debug("key release for button %i ignored", btn); + } + } + break; + + case ButtonPress: + if (ev.xbutton.x >= xoffset && ev.xbutton.x <= xoffset + btnwidth + && ev.xbutton.y >= yoffset && ev.xbutton.y <= yoffset + buttons * btnheight + (buttons - 1) * pgap) { + btn = (ev.xbutton.y - yoffset) / (btnheight + pgap) + 1; /* btn 0 is unused */ + debug("button %d pressed", btn); + drv_X11_color(BG_COL, 255); + XFillRectangle(dp, w, gc, xoffset + 1, yoffset + (btn - 1) * (btnheight + pgap) + 1, btnwidth - 1, + btnheight - 2 - 1); + drv_generic_keypad_press(btn); + } + break; + + case ButtonRelease: + if (ev.xbutton.x >= xoffset && ev.xbutton.x <= xoffset + btnwidth + && ev.xbutton.y >= yoffset && ev.xbutton.y <= yoffset + buttons * btnheight + (buttons - 1) * pgap) { + btn = (ev.xbutton.y - yoffset) / (btnheight + pgap) + 1; /* btn 0 is unused */ + debug("button %d released", btn); + XClearArea(dp, w, xoffset, yoffset + (btn - 1) * (btnheight + pgap), btnwidth, btnheight - 2, + 1 /* true */ ); + } + break; + + case ClientMessage: + if ((Atom) (ev.xclient.data.l[0]) == wmDeleteMessage) { + info("%s: Window closed by WindowManager, quit.", Name); + if (raise(SIGTERM) != 0) { + error("%s: Error raising SIGTERM: exit!", Name); + exit(1); + } + } else { + debug("%s: Got XClient message 0x%lx %lx %lx %lx %lx", Name, ev.xclient.data.l[0], + ev.xclient.data.l[1], ev.xclient.data.l[2], ev.xclient.data.l[3], ev.xclient.data.l[4]); + } + + default: + debug("%s: unknown XEvent %d", Name, ev.type); } } @@ -179,7 +526,8 @@ static int drv_X11_start(const char *section) { int i; char *s; - RGBA BC; + XrmValue value; + char *str_type[20]; XSetWindowAttributes wa; XSizeHints sh; XEvent ev; @@ -221,11 +569,33 @@ static int drv_X11_start(const char *section) if (cfg_number(section, "border", 0, 0, -1, &border) < 0) return -1; + /* special case for the X11 driver: + * the border color may be different from the backlight color + * the backlight color is the color of an inactive pixel + * the border color is the color of the border and gaps between pixels + * for the brightness pugin we need a copy of BL_COL, we call it BP_COL + */ s = cfg_get(section, "basecolor", "000000ff"); - if (color2RGBA(s, &BC) < 0) { + if (color2RGBA(s, &BP_COL) < 0) { error("%s: ignoring illegal color '%s'", Name, s); } free(s); + BL_COL = BP_COL; + + BR_COL = BP_COL; + if ((s = cfg_get(section, "bordercolor", NULL)) != NULL) { + if (color2RGBA(s, &BR_COL) < 0) { + error("%s: ignoring illegal color '%s'", Name, s); + } + free(s); + } + + /* consider auto-repeated KeyPress events? */ + cfg_number(section, "autorepeat", 1, 0, 1, &allow_autorepeat); + + /* virtual keyboard: number of buttons (0..6) */ + if (cfg_number(section, "buttons", 0, 0, 6, &buttons) < 0) + return -1; drv_X11_FB = malloc(DCOLS * DROWS * sizeof(*drv_X11_FB)); if (drv_X11_FB == NULL) { @@ -234,14 +604,24 @@ static int drv_X11_start(const char *section) } for (i = 0; i < DCOLS * DROWS; i++) { - drv_X11_FB[i] = BC; + drv_X11_FB[i] = NO_COL; + } + + if (XrmGetResource(commandlineDB, "lcd4linux.display", "Lcd4linux.Display", str_type, &value)) { + strncpy(myDisplayName, value.addr, value.size); + debug("%s: X11 display name from command line: %s", Name, myDisplayName); } - if ((dp = XOpenDisplay(NULL)) == NULL) { - error("%s: can't open display", Name); + if ((dp = XOpenDisplay(strlen(myDisplayName) > 0 ? myDisplayName : NULL)) == NULL) { + error("%s: can't open display %s", Name, XDisplayName(strlen(myDisplayName) > 0 ? myDisplayName : NULL)); return -1; } + if (XrmGetResource(commandlineDB, "lcd4linux*synchronous", "Lcd4linux*Synchronous", str_type, &value)) { + debug("%s: X synchronize on", Name); + XSynchronize(dp, 1 /* true */ ); + } + sc = DefaultScreen(dp); gc = DefaultGC(dp, sc); vi = DefaultVisual(dp, sc); @@ -251,25 +631,41 @@ static int drv_X11_start(const char *section) dimx = DCOLS * pixel + (DCOLS - 1) * pgap + (DCOLS / XRES - 1) * cgap; dimy = DROWS * pixel + (DROWS - 1) * pgap + (DROWS / YRES - 1) * rgap; + if (buttons != 0) { + btnwidth = (DCOLS * pixel + (DCOLS - 1) * pgap) / 10; + btnheight = (DROWS * pixel + (DROWS - 1) * pgap) / buttons; + } - wa.event_mask = ExposureMask; - - w = XCreateWindow(dp, rw, 0, 0, dimx + 2 * border, dimy + 2 * border, 0, 0, InputOutput, vi, CWEventMask, &wa); - - pm = XCreatePixmap(dp, w, dimx, dimy, dd); + wa.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask; - sh.min_width = sh.max_width = dimx + 2 * border; + sh.min_width = sh.max_width = dimx + 2 * border + btnwidth; sh.min_height = sh.max_height = dimy + 2 * border; sh.flags = PPosition | PSize | PMinSize | PMaxSize; - XSetWMProperties(dp, w, NULL, NULL, NULL, 0, &sh, NULL, NULL); + if (sh.min_width > DisplayWidth(dp, sc) || sh.min_height > DisplayHeight(dp, sc)) { + error("%s: Warning: X11-Window with dimensions (%d,%d) is greater than display (%d,%d)!", + Name, sh.min_width, sh.min_height, DisplayWidth(dp, sc), DisplayHeight(dp, sc)); + if (sh.min_width > 32767 || sh.min_height > 32676) { + /* XProtocol data size exceeded */ + exit(1); + } + } + w = XCreateWindow(dp, rw, 0, 0, sh.min_width, sh.min_height, 0, 0, InputOutput, vi, CWEventMask, &wa); + + pm = XCreatePixmap(dp, w, dimx, dimy, dd); - drv_X11_color(BC); + XSetWMProperties(dp, w, NULL, NULL, NULL, 0, &sh, NULL, NULL); + wmDeleteMessage = XInternAtom(dp, "WM_DELETE_WINDOW", False); + XSetWMProtocols(dp, w, &wmDeleteMessage, 1); - XFillRectangle(dp, pm, gc, 0, 0, dimx + 2 * border, dimy + 2 * border); - XSetWindowBackground(dp, w, xc.pixel); + XSetWindowBackground(dp, w, drv_X11_color(BR_COL, 255).pixel); XClearWindow(dp, w); + /* set brightness (after first background painting) */ + if (cfg_number(section, "Brightness", 255, 0, 255, &i) > 0) { + drv_X11_brightness(i); + } + XStoreName(dp, w, "LCD4Linux"); XMapWindow(dp, w); @@ -294,7 +690,24 @@ static int drv_X11_start(const char *section) /*** plugins ***/ /****************************************/ -/* none at the moment... */ +static void plugin_brightness(RESULT * result, const int argc, RESULT * argv[]) +{ + double brightness; + + switch (argc) { + case 0: + brightness = drv_X11_brightness(-1); + SetResult(&result, R_NUMBER, &brightness); + break; + case 1: + brightness = drv_X11_brightness(R2N(argv[0])); + SetResult(&result, R_NUMBER, &brightness); + break; + default: + error("%s.brightness(): wrong number of parameters", Name); + SetResult(&result, R_STRING, ""); + } +} /****************************************/ @@ -305,17 +718,27 @@ static int drv_X11_start(const char *section) /* list models */ int drv_X11_list(void) { - printf("any"); + printf("any X11 server"); return 0; } +/* read X11 specific command line arguments */ +/* it is defined in drv.h */ +void drv_X11_parseArgs(int *argc, char *argv[]) +{ + XrmInitialize(); + XrmParseCommand(&commandlineDB, opTable, opTableEntries, "lcd4linux", argc, argv); +} + + /* initialize driver & display */ int drv_X11_init(const char *section, const int quiet) { + RGBA bl_col; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1125 $"); /* start display */ if ((ret = drv_X11_start(section)) != 0) @@ -323,10 +746,18 @@ int drv_X11_init(const char *section, const int quiet) /* real worker functions */ drv_generic_graphic_real_blit = drv_X11_blit; + drv_generic_keypad_real_press = drv_X11_keypad; /* initialize generic graphic driver */ + /* save BL_COL which may already be dimmed */ + bl_col = BL_COL; if ((ret = drv_generic_graphic_init(section, Name)) != 0) return ret; + BL_COL = bl_col; + + /* initialize generic key pad driver */ + if ((ret = drv_generic_keypad_init(section, Name)) != 0) + return ret; drv_generic_graphic_clear(); @@ -337,13 +768,14 @@ int drv_X11_init(const char *section, const int quiet) char buffer[40]; qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); if (drv_generic_graphic_greet(buffer, NULL)) { + drv_X11_expose(0, 0, dimx + 2 * border, dimy + 2 * border); sleep(3); drv_generic_graphic_clear(); } } /* register plugins */ - /* none at the moment... */ + AddFunction("LCD::brightness", -1, plugin_brightness); return 0; @@ -357,6 +789,7 @@ int drv_X11_quit(const __attribute__ ((unused)) info("%s: shutting down.", Name); drv_generic_graphic_quit(); + drv_generic_keypad_quit(); if (drv_X11_FB) { free(drv_X11_FB); diff --git a/drv_generic.c b/drv_generic.c index 3ca2f63..e725e04 100644 --- a/drv_generic.c +++ b/drv_generic.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic.c $ +/* $Id: drv_generic.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic.c $ * * generic driver helper * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_generic.h b/drv_generic.h index 56122a0..d4023d2 100644 --- a/drv_generic.h +++ b/drv_generic.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic.h $ +/* $Id: drv_generic.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic.h $ * * generic driver helper * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_generic_gpio.c b/drv_generic_gpio.c index b613b4e..391d196 100644 --- a/drv_generic_gpio.c +++ b/drv_generic_gpio.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic_gpio.c 751 2007-01-20 13:52:43Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_gpio.c $ +/* $Id: drv_generic_gpio.c 1049 2009-11-03 04:59:04Z peterbailey $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_gpio.c $ * * generic driver helper for GPO's * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -34,7 +34,7 @@ * these functions must be implemented by the real driver: * * int (*drv_generic_gpio_real_set) (const int num, const int val); - * sets GPO num to val, returns the actal value + * sets GPO num to val, returns the actual value * * int (*drv_generic_gpio_real_get) (const int num); * reads GPI num diff --git a/drv_generic_gpio.h b/drv_generic_gpio.h index cb4fedf..e951f09 100644 --- a/drv_generic_gpio.h +++ b/drv_generic_gpio.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic_gpio.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_gpio.h $ +/* $Id: drv_generic_gpio.h 1051 2009-11-05 08:02:32Z peterbailey $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_gpio.h $ * * generic driver helper for GPIO's * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -30,7 +30,7 @@ #include "widget.h" -extern int GPIS; /* number of GPO's */ +extern int GPIS; /* number of GPI's */ extern int GPOS; /* number of GPO's */ /* these function must be implemented by the real driver */ diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c index a0cb708..cdc0129 100644 --- a/drv_generic_graphic.c +++ b/drv_generic_graphic.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic_graphic.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_graphic.c $ +/* $Id: drv_generic_graphic.c 1003 2009-03-26 08:11:33Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_graphic.c $ * * generic driver helper for graphic displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -123,7 +123,7 @@ static void drv_generic_graphic_resizeFB(int rows, int cols) /* allocate and initialize new Layout FB */ newFB = malloc(cols * rows * sizeof(*newFB)); for (i = 0; i < rows * cols; i++) - newFB[i] = (l == 0) ? BG_COL : NO_COL; + newFB[i] = NO_COL; /* transfer contents */ if (drv_generic_graphic_FB[l] != NULL) { @@ -177,20 +177,42 @@ static void drv_generic_graphic_blit(const int row, const int col, const int hei static RGBA drv_generic_graphic_blend(const int row, const int col) { - int l; + int l, o; RGBA p; RGBA ret; ret.R = BL_COL.R; ret.G = BL_COL.G; ret.B = BL_COL.B; - ret.A = 0xff; - for (l = LAYERS - 1; l >= 0; l--) { + ret.A = 0x00; + + /* find first opaque layer */ + /* layers below are fully covered */ + o = LAYERS - 1; + for (l = 0; l < LAYERS; l++) { + p = drv_generic_graphic_FB[l][row * LCOLS + col]; + if (p.A == 255) { + o = l; + break; + } + } + + for (l = o; l >= 0; l--) { p = drv_generic_graphic_FB[l][row * LCOLS + col]; - if (p.A > 0) { + switch (p.A) { + case 0: + break; + case 255: + ret.R = p.R; + ret.G = p.G; + ret.B = p.B; + ret.A = 0xff; + break; + default: ret.R = (p.R * p.A + ret.R * (255 - p.A)) / 255; ret.G = (p.G * p.A + ret.G * (255 - p.A)) / 255; ret.B = (p.B * p.A + ret.B * (255 - p.A)) / 255; + ret.A = 0xff; } } if (INVERTED) { @@ -230,7 +252,7 @@ static void drv_generic_graphic_render(const int layer, const int row, const int while (*txt != '\0') { unsigned char *chr; - if (strcasestr(style, "bold") != NULL) { + if (strstr(style, "bold") != NULL) { chr = Font_6x8_bold[(int) *(unsigned char *) txt]; } else { chr = Font_6x8[(int) *(unsigned char *) txt]; @@ -454,16 +476,16 @@ int drv_generic_graphic_bar_draw(WIDGET * W) case DIR_EAST: for (y = 0; y < YRES; y++) { int val = y < YRES / 2 ? val1 : val2; - RGBA bcol = y < YRES / 2 ? bar[0] : bar[1]; + RGBA bc = y < YRES / 2 ? bar[0] : bar[1]; for (x = 0; x < max; x++) { if (x < val) - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bcol; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bc; else - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bcol : bg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bc : bg; if (style) { - drv_generic_graphic_FB[layer][(row) * LCOLS + col + x] = fg; + drv_generic_graphic_FB[layer][(row + 0) * LCOLS + col + x] = fg; drv_generic_graphic_FB[layer][(row + YRES - 1) * LCOLS + col + x] = fg; } } @@ -482,11 +504,20 @@ int drv_generic_graphic_bar_draw(WIDGET * W) case DIR_SOUTH: for (x = 0; x < XRES; x++) { int val = x < XRES / 2 ? val1 : val2; + RGBA bc = x < XRES / 2 ? bar[0] : bar[1]; for (y = 0; y < max; y++) { if (y < val) - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : fg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bg : bc; else - drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? fg : bg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + x] = rev ? bc : bg; + if (style) { + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + 0] = fg; + drv_generic_graphic_FB[layer][(row + y) * LCOLS + col + XRES - 1] = fg; + } + } + if (style) { + drv_generic_graphic_FB[layer][(row + 0) * LCOLS + col + x] = fg; + drv_generic_graphic_FB[layer][(row + max - 1) * LCOLS + col + x] = fg; } } break; @@ -561,7 +592,7 @@ int drv_generic_graphic_image_draw(WIDGET * W) int drv_generic_graphic_init(const char *section, const char *driver) { - int l; + int i, l; char *color; WIDGET_CLASS wc; @@ -635,8 +666,10 @@ int drv_generic_graphic_init(const char *section, const char *driver) widget_register(&wc); #endif - /* clear framebuffer */ - drv_generic_graphic_clear(); + /* clear framebuffer but do not blit to display */ + for (l = 0; l < LAYERS; l++) + for (i = 0; i < LCOLS * LROWS; i++) + drv_generic_graphic_FB[l][i] = NO_COL; return 0; } diff --git a/drv_generic_graphic.h b/drv_generic_graphic.h index 2c2cdcc..dd16235 100644 --- a/drv_generic_graphic.h +++ b/drv_generic_graphic.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic_graphic.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_graphic.h $ +/* $Id: drv_generic_graphic.h 959 2009-01-13 12:55:23Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_graphic.h $ * * generic driver helper for graphic displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -33,8 +33,9 @@ #include "rgb.h" extern RGBA FG_COL; /* foreground color */ -extern RGBA HG_COL; /* halfground color */ extern RGBA BG_COL; /* background color */ +extern RGBA BL_COL; /* backlight color */ +extern RGBA NO_COL; /* no color (completely transparent) */ /* these functions must be implemented by the real driver */ extern void (*drv_generic_graphic_real_blit) (const int row, const int col, const int height, const int width); diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c index f699853..3d99c2d 100644 --- a/drv_generic_i2c.c +++ b/drv_generic_i2c.c @@ -1,5 +1,5 @@ -/* $Id: drv_generic_i2c.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_i2c.c $ +/* $Id: drv_generic_i2c.c 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_i2c.c $ * * generic driver helper for i2c displays * diff --git a/drv_generic_i2c.h b/drv_generic_i2c.h index 32df27b..52a2718 100644 --- a/drv_generic_i2c.h +++ b/drv_generic_i2c.h @@ -1,5 +1,5 @@ -/* $Id: drv_generic_i2c.h 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_i2c.h $ +/* $Id: drv_generic_i2c.h 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_i2c.h $ * * generic driver helper for i2c displays * diff --git a/drv_generic_keypad.c b/drv_generic_keypad.c index e7276f9..d798ccb 100644 --- a/drv_generic_keypad.c +++ b/drv_generic_keypad.c @@ -1,5 +1,5 @@ -/* $Id: drv_generic_keypad.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_keypad.c $ +/* $Id: drv_generic_keypad.c 1091 2010-01-21 04:26:24Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_keypad.c $ * * generic driver helper for keypads * @@ -24,6 +24,9 @@ * */ + +#include "config.h" + #include <stdio.h> #include "debug.h" diff --git a/drv_generic_keypad.h b/drv_generic_keypad.h index d37bc93..57a61d8 100644 --- a/drv_generic_keypad.h +++ b/drv_generic_keypad.h @@ -1,5 +1,5 @@ -/* $Id: drv_generic_keypad.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_keypad.h $ +/* $Id: drv_generic_keypad.h 856 2008-03-03 16:54:18Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_keypad.h $ * * generic driver helper for keypads * @@ -27,7 +27,7 @@ #include "widget.h" -/* these functinos must be implemented by the real driver */ +/* these functions must be implemented by the real driver */ extern int (*drv_generic_keypad_real_press) (const int num); /* generic functions and widget callbacks */ diff --git a/drv_generic_parport.c b/drv_generic_parport.c index 413d3db..8f3f3bd 100644 --- a/drv_generic_parport.c +++ b/drv_generic_parport.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic_parport.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_parport.c $ +/* $Id: drv_generic_parport.c 905 2008-12-23 13:37:07Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_parport.c $ * * generic driver helper for serial and parport access * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -65,6 +65,9 @@ #define PARPORT_STATUS_BUSY 0x80 #endif +/* these signals are inverted by hardware on the parallel port */ +#define PARPORT_CONTROL_INVERTED (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD) + #if !defined(WITH_OUTB) && !defined(WITH_PPDEV) #error neither outb() nor ppdev() possible #error cannot compile parallel port driver @@ -82,6 +85,9 @@ static char *Section = ""; static unsigned short Port = 0; static char *PPdev = NULL; +/* Any bits set here will have their logic inverted at the parallel port */ +static unsigned char inverted_control_bits = 0; + /* initial value taken from linux/parport_pc.c */ static unsigned char ctr = 0xc; @@ -205,23 +211,30 @@ int drv_generic_parport_close(void) static unsigned char drv_generic_parport_signal_ctrl(const char *name, const char *signal) { unsigned char wire; + int invert = 0; + + /* Prefixing a signal name with '-' inverts the logic */ + if (signal[0] == '-') { + invert = 1; + signal++; + } if (strcasecmp(signal, "STROBE") == 0) { wire = PARPORT_CONTROL_STROBE; - info("%s: wiring: DISPLAY:%-9s - PARPORT:STROBE (Pin 1)", Driver, name); + info("%s: wiring: DISPLAY:%-9s - PARPORT:STROBE (Pin 1)%s", Driver, name, invert ? " [inverted]" : ""); } else if (strcasecmp(signal, "AUTOFD") == 0) { wire = PARPORT_CONTROL_AUTOFD; - info("%s: wiring: DISPLAY:%-9s - PARPORT:AUTOFD (Pin 14)", Driver, name); + info("%s: wiring: DISPLAY:%-9s - PARPORT:AUTOFD (Pin 14)%s", Driver, name, invert ? " [inverted]" : ""); } else if (strcasecmp(signal, "INIT") == 0) { wire = PARPORT_CONTROL_INIT; - info("%s: wiring: DISPLAY:%-9s - PARPORT:INIT (Pin 16)", Driver, name); + info("%s: wiring: DISPLAY:%-9s - PARPORT:INIT (Pin 16)%s", Driver, name, invert ? " [inverted]" : ""); } else if (strcasecmp(signal, "SLCTIN") == 0) { wire = PARPORT_CONTROL_SELECT; - info("%s: wiring: DISPLAY:%-9s - PARPORT:SLCTIN (Pin 17)", Driver, name); + info("%s: wiring: DISPLAY:%-9s - PARPORT:SLCTIN (Pin 17)%s", Driver, name, invert ? " [inverted]" : ""); } else if (strcasecmp(signal, "SELECT") == 0) { wire = PARPORT_CONTROL_SELECT; error("%s: SELECT is deprecated. Please use SLCTIN instead!", Driver); - info("%s: wiring: DISPLAY:%-9s - PARPORT:SLCTIN (Pin 17)", Driver, name); + info("%s: wiring: DISPLAY:%-9s - PARPORT:SLCTIN (Pin 17)%s", Driver, name, invert ? " [inverted]" : ""); } else if (strcasecmp(signal, "GND") == 0) { wire = 0; info("%s: wiring: DISPLAY:%-9s - PARPORT:GND", Driver, name); @@ -231,6 +244,10 @@ static unsigned char drv_generic_parport_signal_ctrl(const char *name, const cha return 0xff; } + if (invert) { + inverted_control_bits |= wire; + } + return wire; } @@ -401,7 +418,7 @@ void drv_generic_parport_control(const unsigned char mask, const unsigned char v return; /* Strobe, Select and AutoFeed are inverted! */ - val = mask & (value ^ (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD)); + val = mask & (value ^ PARPORT_CONTROL_INVERTED ^ inverted_control_bits); #ifdef WITH_PPDEV if (PPdev) { @@ -433,9 +450,8 @@ void drv_generic_parport_toggle(const unsigned char bits, const int level, const value2 = level ? 0 : bits; /* Strobe, Select and AutoFeed are inverted! */ - value1 = bits & (value1 ^ (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD)); - value2 = bits & (value2 ^ (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD)); - + value1 = bits & (value1 ^ PARPORT_CONTROL_INVERTED ^ inverted_control_bits); + value2 = bits & (value2 ^ PARPORT_CONTROL_INVERTED ^ inverted_control_bits); #ifdef WITH_PPDEV if (PPdev) { diff --git a/drv_generic_parport.h b/drv_generic_parport.h index ac14536..603badb 100644 --- a/drv_generic_parport.h +++ b/drv_generic_parport.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic_parport.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_parport.h $ +/* $Id: drv_generic_parport.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_parport.h $ * * generic driver helper for parallel port displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_generic_serial.c b/drv_generic_serial.c index a2b5506..88ef87c 100644 --- a/drv_generic_serial.c +++ b/drv_generic_serial.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic_serial.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_serial.c $ +/* $Id: drv_generic_serial.c 890 2008-08-31 18:27:53Z sonic74 $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_serial.c $ * * generic driver helper for serial and usbserial displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -24,7 +24,7 @@ * */ -/* +/* * * exported fuctions: * @@ -221,7 +221,7 @@ int drv_generic_serial_open(const char *section, const char *driver, const unsig return -1; } - if (cfg_number(section, "Speed", 19200, 1200, 115200, &i) < 0) + if (cfg_number(section, "Speed", 19200, 1200, 230400, &i) < 0) return -1; switch (i) { case 1200: @@ -248,6 +248,11 @@ int drv_generic_serial_open(const char *section, const char *driver, const unsig case 115200: Speed = B115200; break; +#ifdef B230400 + case 230400: + Speed = B230400; + break; +#endif default: error("%s: unsupported speed '%d' from %s", Driver, i, cfg_source()); return -1; diff --git a/drv_generic_serial.h b/drv_generic_serial.h index 3315746..0373654 100644 --- a/drv_generic_serial.h +++ b/drv_generic_serial.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic_serial.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_serial.h $ +/* $Id: drv_generic_serial.h 1051 2009-11-05 08:02:32Z peterbailey $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_serial.h $ * * generic driver helper for serial and usbserial displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -25,7 +25,7 @@ */ -#ifndef _DRV_GENERIC_SERIALH_ +#ifndef _DRV_GENERIC_SERIAL_H_ #define _DRV_GENERIC_SERIAL_H_ int drv_generic_serial_open(const char *section, const char *driver, const unsigned int flags); diff --git a/drv_generic_text.c b/drv_generic_text.c index 94f99d1..b216be8 100644 --- a/drv_generic_text.c +++ b/drv_generic_text.c @@ -1,9 +1,9 @@ -/* $Id: drv_generic_text.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_text.c $ +/* $Id: drv_generic_text.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_text.c $ * * generic driver helper for text-based displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_generic_text.h b/drv_generic_text.h index 2a476fd..b37edfc 100644 --- a/drv_generic_text.h +++ b/drv_generic_text.h @@ -1,9 +1,9 @@ -/* $Id: drv_generic_text.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_generic_text.h $ +/* $Id: drv_generic_text.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_text.h $ * * generic driver helper for text-based displays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/drv_picoLCD.c b/drv_picoLCD.c index a0c03e9..311958e 100644 --- a/drv_picoLCD.c +++ b/drv_picoLCD.c @@ -1,9 +1,9 @@ -/* $Id: drv_picoLCD.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_picoLCD.c $ +/* $Id: drv_picoLCD.c 1143 2011-02-12 22:46:19Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_picoLCD.c $ * * driver for picoLCD displays from mini-box.com * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * Copyright (C) 2007 Nicu Pavel, Mini-Box.com <npavel@mini-box.com> @@ -75,7 +75,6 @@ static char *Buffer; static char *BufPtr; static usb_dev_handle *lcd; -extern int usb_debug; @@ -97,7 +96,7 @@ static int drv_pL_open(void) info("%s: scanning for picoLCD...", Name); - usb_debug = 0; + usb_set_debug(0); usb_init(); usb_find_busses(); @@ -162,6 +161,12 @@ static void drv_pL_send(unsigned char *data, int size) usb_interrupt_write(lcd, USB_ENDPOINT_OUT + 1, (char *) data, size, 1000); } +static int drv_pL_read(unsigned char *data, int size) +{ + return usb_interrupt_read(lcd, USB_ENDPOINT_OUT + 1, (char *) data, size, 1000); +} + + static void drv_pL_clear(void) { @@ -200,6 +205,21 @@ static int drv_pL_backlight(int backlight) return backlight; } +#define _USBLCD_MAX_DATA_LEN 24 +#define IN_REPORT_KEY_STATE 0x11 +static int drv_pL_gpi( __attribute__ ((unused)) + int num) +{ + int ret; + unsigned char read_packet[_USBLCD_MAX_DATA_LEN]; + ret = drv_pL_read(read_packet, _USBLCD_MAX_DATA_LEN); + if ((ret > 0) && (read_packet[0] == IN_REPORT_KEY_STATE)) { + debug("picoLCD: pressed key= 0x%02x\n", read_packet[1]); + return read_packet[1]; + } + return 0; +} + static int drv_pL_gpo(int num, int val) { unsigned char cmd[2] = { 0x81 }; /* set GPO */ @@ -286,7 +306,7 @@ static int drv_pL_start(const char *section, const int quiet) /* Init the command buffer */ Buffer = (char *) malloc(1024); if (Buffer == NULL) { - error("%s: coommand buffer could not be allocated: malloc() failed", Name); + error("%s: command buffer could not be allocated: malloc() failed", Name); return -1; } BufPtr = Buffer; @@ -343,7 +363,6 @@ static void plugin_gpo(RESULT * result, RESULT * argv[]) SetResult(&result, R_NUMBER, &gpo); } - /****************************************/ /*** widget callbacks ***/ /****************************************/ @@ -362,7 +381,7 @@ static void plugin_gpo(RESULT * result, RESULT * argv[]) /* list models */ int drv_pL_list(void) { - printf("generic"); + printf("picoLCD 20x2 Text LCD"); return 0; } @@ -373,7 +392,7 @@ int drv_pL_init(const char *section, const int quiet) WIDGET_CLASS wc; int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 1143 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -381,6 +400,7 @@ int drv_pL_init(const char *section, const int quiet) CHARS = 8; /* number of user-defineable characters */ CHAR0 = 0; /* ASCII of first user-defineable char */ GPOS = 8; + GPIS = 1; INVALIDATE = 1; GOTO_COST = 2; /* number of bytes a goto command requires */ @@ -388,6 +408,7 @@ int drv_pL_init(const char *section, const int quiet) drv_generic_text_real_write = drv_pL_write; drv_generic_text_real_defchar = drv_pL_defchar; drv_generic_gpio_real_set = drv_pL_gpo; + drv_generic_gpio_real_get = drv_pL_gpi; /* start display */ if ((ret = drv_pL_start(section, quiet)) != 0) diff --git a/drv_picoLCDGraphic.c b/drv_picoLCDGraphic.c new file mode 100644 index 0000000..11e8c4d --- /dev/null +++ b/drv_picoLCDGraphic.c @@ -0,0 +1,749 @@ +/* $Id: drv_picoLCDGraphic.c 1143 2011-02-12 22:46:19Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_picoLCDGraphic.c $ + * + * driver for picoLCD Graphic(256x64) displays from mini-box.com + * + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * Copyright (C) 2009 Nicu Pavel, Mini-Box.com <npavel@mini-box.com> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_picoLCDGraphic + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <termios.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <sys/time.h> + +#include <usb.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "timer.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "widget_keypad.h" +#include "drv.h" +#include "drv_generic_gpio.h" +#include "drv_generic_keypad.h" +#include "drv_generic_graphic.h" + + + +#define picoLCD_VENDOR 0x04d8 +#define picoLCD_DEVICE 0xc002 + +#define OUT_REPORT_LED_STATE 0x81 +#define OUT_REPORT_LCD_BACKLIGHT 0x91 +#define OUT_REPORT_LCD_CONTRAST 0x92 + +#define OUT_REPORT_CMD 0x94 +#define OUT_REPORT_DATA 0x95 +#define OUT_REPORT_CMD_DATA 0x96 + +#define SCREEN_H 64 +#define SCREEN_W 256 + + +#if 1 +#define DEBUG(x) debug("%s(): %s", __FUNCTION__, x); +#else +#define DEBUG(x) +#endif + +/* "dirty" marks the display to be redrawn from frame buffer */ +static int dirty = 1; + +/* timer for display redraw (set to zero for "direct updates") */ +static int update = 0; + +/* USB read timeout in ms (the picoLCD 256x64 times out on every read + unless a key has been pressed!) */ +static int read_timeout = 0; + +static char Name[] = "picoLCDGraphic"; +static unsigned char *pLG_framebuffer; + +/* used to display white text on black background or inverse */ +unsigned char inverted = 0; + +static unsigned int gpo = 0; + +static char *Buffer; +static char *BufPtr; + +static usb_dev_handle *lcd; +//extern int usb_debug; +int usb_debug; + + +/****************************************/ +/*** hardware dependant functions ***/ +/****************************************/ + +static int drv_pLG_open(void) +{ + struct usb_bus *busses, *bus; + struct usb_device *dev; + char driver[1024]; + char product[1024]; + char manufacturer[1024]; + char serialnumber[1024]; + int ret; + + lcd = NULL; + + info("%s: scanning for picoLCD 256x64...", Name); + + usb_debug = 0; + + usb_init(); + usb_find_busses(); + usb_find_devices(); + busses = usb_get_busses(); + + for (bus = busses; bus; bus = bus->next) { + for (dev = bus->devices; dev; dev = dev->next) { + if ((dev->descriptor.idVendor == picoLCD_VENDOR) && (dev->descriptor.idProduct == picoLCD_DEVICE)) { + + info("%s: found picoLCD on bus %s device %s", Name, bus->dirname, dev->filename); + + lcd = usb_open(dev); + + ret = usb_get_driver_np(lcd, 0, driver, sizeof(driver)); + + if (ret == 0) { + info("%s: interface 0 already claimed by '%s'", Name, driver); + info("%s: attempting to detach driver...", Name); + if (usb_detach_kernel_driver_np(lcd, 0) < 0) { + error("%s: usb_detach_kernel_driver_np() failed!", Name); + return -1; + } + } + + usb_set_configuration(lcd, 1); + usleep(100); + + if (usb_claim_interface(lcd, 0) < 0) { + error("%s: usb_claim_interface() failed!", Name); + return -1; + } + + usb_set_altinterface(lcd, 0); + + usb_get_string_simple(lcd, dev->descriptor.iProduct, product, sizeof(product)); + usb_get_string_simple(lcd, dev->descriptor.iManufacturer, manufacturer, sizeof(manufacturer)); + usb_get_string_simple(lcd, dev->descriptor.iSerialNumber, serialnumber, sizeof(serialnumber)); + + info("%s: Manufacturer='%s' Product='%s' SerialNumber='%s'", Name, manufacturer, product, serialnumber); + + return 0; + } + } + } + error("%s: could not find a picoLCD", Name); + return -1; +} + +static int drv_pLG_read(unsigned char *data, int size) +{ + return usb_interrupt_read(lcd, USB_ENDPOINT_IN + 1, (char *) data, size, read_timeout); +} + + +static void drv_pLG_send(unsigned char *data, int size) +{ + int ret; + ret = usb_interrupt_write(lcd, USB_ENDPOINT_OUT + 1, (char *) data, size, 1000); + //fprintf(stderr, "%s written %d bytes\n", __FUNCTION__, ret); +} + +static int drv_pLG_close(void) +{ + usb_release_interface(lcd, 0); + usb_close(lcd); + + return 0; +} + +static void drv_pLG_update_img() +{ + unsigned char cmd3[64] = { OUT_REPORT_CMD_DATA }; /* send command + data */ + unsigned char cmd4[64] = { OUT_REPORT_DATA }; /* send data only */ + + int index, bit, x, y; + unsigned char cs, line; + unsigned char pixel; + + /* do not redraw display if frame buffer has not changed, unless + "direct updates" have been requested (update is zero) */ + if ((!dirty) && (update > 0)) { + debug("Skipping %s\n", __FUNCTION__); + return; + } + + debug("In %s\n", __FUNCTION__); + + for (cs = 0; cs < 4; cs++) { + unsigned char chipsel = (cs << 2); //chipselect + for (line = 0; line < 8; line++) { + //ha64_1.setHIDPkt(OUT_REPORT_CMD_DATA, 8+3+32, 8, chipsel, 0x02, 0x00, 0x00, 0xb8|j, 0x00, 0x00, 0x40); + cmd3[0] = OUT_REPORT_CMD_DATA; + cmd3[1] = chipsel; + cmd3[2] = 0x02; + cmd3[3] = 0x00; + cmd3[4] = 0x00; + cmd3[5] = 0xb8 | line; + cmd3[6] = 0x00; + cmd3[7] = 0x00; + cmd3[8] = 0x40; + cmd3[9] = 0x00; + cmd3[10] = 0x00; + cmd3[11] = 32; + + //ha64_2.setHIDPkt(OUT_REPORT_DATA, 4+32, 4, chipsel | 0x01, 0x00, 0x00, 32); + + cmd4[0] = OUT_REPORT_DATA; + cmd4[1] = chipsel | 0x01; + cmd4[2] = 0x00; + cmd4[3] = 0x00; + cmd4[4] = 32; + + for (index = 0; index < 32; index++) { + pixel = 0x00; + + for (bit = 0; bit < 8; bit++) { + x = cs * 64 + index; + y = (line * 8 + bit + 0) % SCREEN_H; + + if (pLG_framebuffer[y * 256 + x] ^ inverted) + pixel |= (1 << bit); + } + cmd3[12 + index] = pixel; + } + + for (index = 32; index < 64; index++) { + pixel = 0x00; + + for (bit = 0; bit < 8; bit++) { + x = cs * 64 + index; + y = (line * 8 + bit + 0) % SCREEN_H; + if (pLG_framebuffer[y * 256 + x] ^ inverted) + pixel |= (1 << bit); + } + + cmd4[5 + (index - 32)] = pixel; + } + + drv_pLG_send(cmd3, 44); + drv_pLG_send(cmd4, 38); + } + } + + /* mark display as up-to-date */ + dirty = 0; + //drv_pLG_clear(); +} + + +#define _USBLCD_MAX_DATA_LEN 24 +#define IN_REPORT_KEY_STATE 0x11 +static void drv_pLG_update_keypad() +{ + static int pressed_key = 0; + + int ret; + unsigned char read_packet[_USBLCD_MAX_DATA_LEN]; + ret = drv_pLG_read(read_packet, _USBLCD_MAX_DATA_LEN); + if ((ret > 0) && (read_packet[0] == IN_REPORT_KEY_STATE)) { + debug("picoLCD: pressed key= 0x%02x\n", read_packet[1]); + int new_pressed_key = read_packet[1]; + if (pressed_key != new_pressed_key) { + /* negative values mark a key release */ + drv_generic_keypad_press(-pressed_key); + drv_generic_keypad_press(new_pressed_key); + pressed_key = new_pressed_key; + } + } +} + + +/* for graphic displays only */ +static void drv_pLG_blit(const int row, const int col, const int height, const int width) +{ + int r, c; + + //DEBUG(fprintf(stderr, "In %s called with row %d col %d height %d width %d\n", __FUNCTION__, row, col, height, width)); + + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) { + pLG_framebuffer[r * 256 + c] = drv_generic_graphic_black(r, c); + //fprintf(stderr, "%d", pLG_framebuffer[r * 256 + c]); + } + //fprintf(stderr, "\n"); + } + + /* + for (r = 0; r < 64; r++) { + for(c = 0; c < 256; c++) { + fprintf(stderr, "%d", pLG_framebuffer[r * 256 + c]); + } + fprintf(stderr, "\n"); + } + */ + + /* display needs to be redrawn from frame buffer */ + dirty = 1; + + /* if "direct updates" have been requested, redraw now */ + if (update <= 0) + drv_pLG_update_img(); +} + + +void drv_pLG_clear(void) +{ + unsigned char cmd[3] = { 0x93, 0x01, 0x00 }; /* init display */ + unsigned char cmd2[9] = { OUT_REPORT_CMD }; /* init display */ + unsigned char cmd3[64] = { OUT_REPORT_CMD_DATA }; /* clear screen */ + unsigned char cmd4[64] = { OUT_REPORT_CMD_DATA }; /* clear screen */ + + int init, index; + unsigned char cs, line; + + + debug("In %s\n", __FUNCTION__); + drv_pLG_send(cmd, 3); + + for (init = 0; init < 4; init++) { + unsigned char cs = ((init << 2) & 0xFF); + + cmd2[0] = OUT_REPORT_CMD; + cmd2[1] = cs; + cmd2[2] = 0x02; + cmd2[3] = 0x00; + cmd2[4] = 0x64; + cmd2[5] = 0x3F; + cmd2[6] = 0x00; + cmd2[7] = 0x64; + cmd2[8] = 0xC0; + + drv_pLG_send(cmd2, 9); + } + + + for (cs = 0; cs < 4; cs++) { + unsigned char chipsel = (cs << 2); //chipselect + for (line = 0; line < 8; line++) { + //ha64_1.setHIDPkt(OUT_REPORT_CMD_DATA, 8+3+32, 8, cs, 0x02, 0x00, 0x00, 0xb8|j, 0x00, 0x00, 0x40); + cmd3[0] = OUT_REPORT_CMD_DATA; + cmd3[1] = chipsel; + cmd3[2] = 0x02; + cmd3[3] = 0x00; + cmd3[4] = 0x00; + cmd3[5] = 0xb8 | line; + cmd3[6] = 0x00; + cmd3[7] = 0x00; + cmd3[8] = 0x40; + cmd3[9] = 0x00; + cmd3[10] = 0x00; + cmd3[11] = 32; + + unsigned char temp = 0; + + for (index = 0; index < 32; index++) { + cmd3[12 + index] = temp; + } + + drv_pLG_send(cmd3, 64); + + //ha64_2.setHIDPkt(OUT_REPORT_DATA, 4+32, 4, cs | 0x01, 0x00, 0x00, 32); + + cmd4[0] = OUT_REPORT_DATA; + cmd4[1] = chipsel | 0x01; + cmd4[2] = 0x00; + cmd4[3] = 0x00; + cmd4[4] = 32; + + for (index = 32; index < 64; index++) { + temp = 0x00; + cmd4[5 + (index - 32)] = temp; + } + drv_pLG_send(cmd4, 64); + } + } +} + +static int drv_pLG_contrast(int contrast) +{ + unsigned char cmd[2] = { 0x92 }; /* set contrast */ + + if (contrast < 0) + contrast = 0; + if (contrast > 255) + contrast = 255; + + cmd[1] = contrast; + drv_pLG_send(cmd, 2); + + return contrast; +} + + +static int drv_pLG_backlight(int backlight) +{ + unsigned char cmd[2] = { 0x91 }; /* set backlight */ + + if (backlight < 0) + backlight = 0; + if (backlight >= 1) + backlight = 200; + + cmd[1] = backlight; + drv_pLG_send(cmd, 2); + + return backlight; +} + +static int drv_pLG_gpi( __attribute__ ((unused)) + int num) +{ + int ret; + unsigned char read_packet[_USBLCD_MAX_DATA_LEN]; + ret = drv_pLG_read(read_packet, _USBLCD_MAX_DATA_LEN); + if ((ret > 0) && (read_packet[0] == IN_REPORT_KEY_STATE)) { + debug("picoLCD: pressed key= 0x%02x\n", read_packet[1]); + return read_packet[1]; + } + return 0; +} + + +static int drv_pLG_gpo(int num, int val) +{ + unsigned char cmd[2] = { 0x81 }; /* set GPO */ + + if (num < 0) + num = 0; + if (num > 7) + num = 7; + + if (val < 0) + val = 0; + if (val > 1) + val = 1; + + /* set led bit to 1 or 0 */ + if (val) + gpo |= 1 << num; + else + gpo &= ~(1 << num); + + cmd[1] = gpo; + drv_pLG_send(cmd, 2); + + return val; +} + +static int drv_pLG_start(const char *section, const int quiet) +{ + int rows = -1, cols = -1; + int value; + char *s; + + /* set display redraw interval (set to zero for "direct updates") */ + cfg_number(section, "update", 200, 0, -1, &update); + + /* USB read timeout in ms (the picoLCD 256x64 times out on every + read unless a key has been pressed!) */ + cfg_number(section, "Timeout", 5, 1, 1000, &read_timeout); + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Size' entry from %s", Name, section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + error("%s: bad %s.Size '%s' from %s", Name, section, s, cfg_source()); + free(s); + return -1; + } + + if (cfg_number(section, "Inverted", 0, 0, 1, &value) > 0) { + info("Setting display inverted to %d", value); + inverted = value; + } + + DROWS = SCREEN_H; + DCOLS = SCREEN_W; + + if (drv_pLG_open() < 0) { + return -1; + } + + /* Init the command buffer */ + Buffer = (char *) malloc(1024); + if (Buffer == NULL) { + error("%s: command buffer could not be allocated: malloc() failed", Name); + return -1; + } + BufPtr = Buffer; + + /* Init framebuffer buffer */ + pLG_framebuffer = malloc(SCREEN_W * SCREEN_H * sizeof(unsigned char)); + if (!pLG_framebuffer) + return -1; + + DEBUG("allocated"); + memset(pLG_framebuffer, 0, SCREEN_W * SCREEN_H); + DEBUG("zeroed"); + + if (cfg_number(section, "Contrast", 0, 0, 255, &value) > 0) { + info("Setting contrast to %d", value); + drv_pLG_contrast(value); + } + + if (cfg_number(section, "Backlight", 0, 0, 1, &value) > 0) { + info("Setting backlight to %d", value); + drv_pLG_backlight(value); + } + + drv_pLG_clear(); /* clear display */ + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, SCREEN_W, SCREEN_H); + if (drv_generic_graphic_greet(buffer, "http://www.picolcd.com")) { + sleep(3); + drv_pLG_clear(); + } + } + + /* setup a timer that regularly redraws the display from the frame + buffer (unless "direct updates" have been requested */ + if (update > 0) + timer_add(drv_pLG_update_img, NULL, update, 0); + + /* setup a timer that regularly checks the keypad for pressed or + released keys */ + /* FIXME: make 100msec configurable */ + timer_add(drv_pLG_update_keypad, NULL, 100, 0); + + return 0; +} + + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_contrast(RESULT * result, RESULT * arg1) +{ + double contrast; + + contrast = drv_pLG_contrast(R2N(arg1)); + SetResult(&result, R_NUMBER, &contrast); +} + +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + double backlight; + + backlight = drv_pLG_backlight(R2N(arg1)); + SetResult(&result, R_NUMBER, &backlight); +} + +static void plugin_gpo(RESULT * result, RESULT * argv[]) +{ + double gpo; + gpo = drv_pLG_gpo(R2N(argv[0]), R2N(argv[1])); + SetResult(&result, R_NUMBER, &gpo); +} + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_pLG_list(void) +{ + printf("picoLCD 256x64 Graphic LCD"); + return 0; +} + + +static int drv_pLG_keypad(const int num) +{ + int val; + int new_num = num; + + if (new_num == 0) + return 0; + else if (new_num > 0) + val = WIDGET_KEY_PRESSED; + else { + /* negative values mark a key release */ + new_num = -num; + val = WIDGET_KEY_RELEASED; + } + + switch (new_num) { + case 1: + val += WIDGET_KEY_CANCEL; + break; + case 2: + val += WIDGET_KEY_LEFT; + break; + case 3: + val += WIDGET_KEY_RIGHT; + break; + case 5: + val += WIDGET_KEY_UP; + break; + case 6: + val += WIDGET_KEY_CONFIRM; + break; + case 7: + val += WIDGET_KEY_DOWN; + break; + default: + error("%s: unknown keypad value %d", Name, num); + } + + return val; +} + + +/* initialize driver & display */ +int drv_pLG_init(const char *section, const int quiet) +{ + int ret; + + info("%s: %s", Name, "$Rev: 1143 $"); + + info("PICOLCD Graphic initialization\n"); + + /* display preferences */ + XRES = 6; /* pixel width of one char */ + YRES = 8; /* pixel height of one char */ + GPOS = 8; + GPIS = 1; + /* real worker functions */ + drv_generic_graphic_real_blit = drv_pLG_blit; + drv_generic_keypad_real_press = drv_pLG_keypad; + drv_generic_gpio_real_set = drv_pLG_gpo; + drv_generic_gpio_real_get = drv_pLG_gpi; + + + /* start display */ + if ((ret = drv_pLG_start(section, quiet)) != 0) + return ret; + + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + + /* initialize generic key pad driver */ + if ((ret = drv_generic_keypad_init(section, Name)) != 0) + return ret; + + + /* GPO's init */ + + if ((ret = drv_generic_gpio_init(section, Name)) != 0) + return ret; + + /* register plugins */ + + AddFunction("LCD::contrast", 1, plugin_contrast); + AddFunction("LCD::backlight", 1, plugin_backlight); + AddFunction("LCD::gpo", -1, plugin_gpo); + + return 0; +} + + +/* close driver & display */ +int drv_pLG_quit(const int quiet) +{ + + info("%s: shutting down.", Name); + + /* clear display */ + drv_pLG_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_graphic_greet("goodbye!", NULL); + } + + drv_pLG_close(); + + if (Buffer) { + free(Buffer); + BufPtr = NULL; + } + + drv_generic_graphic_quit(); + drv_generic_keypad_quit(); + + return (0); +} + + +DRIVER drv_picoLCDGraphic = { + .name = Name, + .list = drv_pLG_list, + .init = drv_pLG_init, + .quit = drv_pLG_quit, +}; diff --git a/drv_serdisplib.c b/drv_serdisplib.c index 9ca5e8c..ff2e8c4 100644 --- a/drv_serdisplib.c +++ b/drv_serdisplib.c @@ -1,9 +1,9 @@ -/* $Id: drv_serdisplib.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_serdisplib.c $ +/* $Id: drv_serdisplib.c 958 2009-01-13 04:21:29Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_serdisplib.c $ * * driver for serdisplib displays * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -33,6 +33,7 @@ */ #include "config.h" +#include "debug.h" // verbose_level #include <stdlib.h> #include <stdio.h> @@ -66,6 +67,8 @@ static char Name[] = "serdisplib"; static serdisp_CONN_t *sdcd; static serdisp_t *dd; +int NUMCOLS = 1; + /****************************************/ /*** hardware dependant functions ***/ @@ -74,10 +77,12 @@ static serdisp_t *dd; static void drv_SD_blit(const int row, const int col, const int height, const int width) { int r, c; + RGBA p; for (r = row; r < row + height; r++) { for (c = col; c < col + width; c++) { - RGBA p = drv_generic_graphic_rgb(r, c); + p = drv_generic_graphic_rgb(r, c); + // printf("blit (%d,%d) A%d.R%d.G%d.B%d\n", c, r, p.A, p.R, p.G, p.B); serdisp_setcolour(dd, c, r, serdisp_pack2ARGB(0xff, p.R, p.G, p.B)); } } @@ -181,9 +186,19 @@ static int drv_SD_start(const char *section) return -1; } + /* print supported options by display */ + info("%s: options supported by display %s:", Name, model); + serdisp_options_t optiondesc; + optiondesc.name = ""; /* start the iteration with assigning an empty string before the first call */ + while (serdisp_nextoptiondescription(dd, &optiondesc)) { + info(" %s", optiondesc.name); + } + + DROWS = serdisp_getheight(dd); DCOLS = serdisp_getwidth(dd); - info("%s: display size %dx%d", Name, DCOLS, DROWS); + NUMCOLS = serdisp_getcolours(dd); + info("%s: display size %dx%d, %d colors", Name, DCOLS, DROWS, NUMCOLS); XRES = -1; YRES = -1; @@ -274,7 +289,35 @@ static void plugin_rotate(RESULT * result, RESULT * arg1) /* list models */ int drv_SD_list(void) { - printf("%s", "any"); + serdisp_display_t displaydesc; + + displaydesc.dispname = ""; + while (serdisp_nextdisplaydescription(&displaydesc)) { + printf("%s ", displaydesc.dispname); + } + + return 0; +} + + +/* verbosely list models (special case for serdisplib) */ +int drv_SD_list_verbose(void) +{ + serdisp_display_t displaydesc; + long version; + + version = serdisp_getversioncode(); + printf("%s: header version %d.%d, library version %d.%d, available sub-drivers:\n\n", Name, + SERDISP_VERSION_MAJOR, SERDISP_VERSION_MINOR, + SERDISP_VERSION_GET_MAJOR(version), SERDISP_VERSION_GET_MINOR(version)); + + printf("display name alias names description\n"); + printf("------------------ -------------------- -----------------------------------\n"); + displaydesc.dispname = ""; + while (serdisp_nextdisplaydescription(&displaydesc)) { + printf(" %-15s %-20s %-35s\n", displaydesc.dispname, displaydesc.aliasnames, displaydesc.description); + } + return 0; } @@ -284,7 +327,7 @@ int drv_SD_init(const char *section, const int quiet) { int ret; - info("%s: %s", Name, "$Rev: 773 $"); + info("%s: %s", Name, "$Rev: 958 $"); /* real worker functions */ drv_generic_graphic_real_blit = drv_SD_blit; diff --git a/drv_st2205.c b/drv_st2205.c new file mode 100644 index 0000000..fbc6da1 --- /dev/null +++ b/drv_st2205.c @@ -0,0 +1,247 @@ +/* $Id: drv_st2205.c 980 2009-01-28 21:18:52Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_st2205.c $ + * + * ST2205U-driven hacked picture frame driver. + * See http://picframe.spritesserver.nl/ for more info. + * + * Copyright (C) 2008 Jeroen Domburg <picframe@spritesmods.com> + * Modified from sample code by: + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_st2205 + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include <st2205.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +#include "drv_generic_graphic.h" + +static char Name[] = "st2205"; +/* libst2205 handle */ +static st2205_handle *h; +/* Display data */ +static unsigned char *fb; + +static int drv_st2205_open(const char *section) +{ + char *dev; + + dev = cfg_get(section, "Port", NULL); + if (dev == NULL || *dev == '\0') { + error("st2205: no '%s.Port' entry from %s", section, cfg_source()); + return -1; + } + + h = st2205_open(dev); + if (h == NULL) { + error("st2205: cannot open st2205 device %s", dev); + return -1; + } + + return 0; +} + + +static int drv_st2205_close(void) +{ + st2205_close(h); + + return 0; +} + + +static void drv_st2205_blit(const int row, const int col, const int height, const int width) +{ + int r, c; + RGBA p; + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) { + p = drv_generic_graphic_rgb(r, c); + fb[(r * h->width + c) * 3 + 0] = p.R; + fb[(r * h->width + c) * 3 + 1] = p.G; + fb[(r * h->width + c) * 3 + 2] = p.B; + } + } + st2205_send_data(h, fb); +} + + +/* start graphic display */ +static int drv_st2205_start2(const char *section) +{ + char *s; + + s = cfg_get(section, "Font", "6x8"); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); + return -1; + } + + XRES = -1; + YRES = -1; + if (sscanf(s, "%dx%d", &XRES, &YRES) != 2 || XRES < 1 || YRES < 1) { + error("%s: bad Font '%s' from %s", Name, s, cfg_source()); + return -1; + } + + /* Fixme: provider other fonts someday... */ + if (XRES != 6 && YRES != 8) { + error("%s: bad Font '%s' from %s (only 6x8 at the moment)", Name, s, cfg_source()); + return -1; + } + + + /* open communication with the display */ + if (drv_st2205_open(section) < 0) { + return -1; + } + + /* you surely want to allocate a framebuffer or something... */ + fb = malloc(h->height * h->width * 3); + + /* set width/height from st2205 firmware specs */ + DROWS = h->width; + DCOLS = h->height; + + return 0; +} + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + int bl_on; + bl_on = (R2N(arg1) == 0 ? 0 : 1); + st2205_backlight(h, bl_on); + SetResult(&result, R_NUMBER, &bl_on); +} + + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_st2205_list(void) +{ + printf("generic hacked photo frame"); + return 0; +} + + +/* initialize driver & display */ +int drv_st2205_init2(const char *section, const int quiet) +{ + int ret; + + /* real worker functions */ + drv_generic_graphic_real_blit = drv_st2205_blit; + + /* start display */ + if ((ret = drv_st2205_start2(section)) != 0) + return ret; + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_graphic_greet(buffer, NULL)) { + sleep(3); + drv_generic_graphic_clear(); + } + } + + /* register plugins */ + AddFunction("LCD::backlight", 1, plugin_backlight); + + return 0; +} + + +/* close driver & display */ +int drv_st2205_quit2(const int quiet) +{ + info("%s: shutting down.", Name); + + /* clear display */ + drv_generic_graphic_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_graphic_greet("goodbye!", NULL); + } + + drv_generic_graphic_quit(); + + debug("closing connection"); + drv_st2205_close(); + + return (0); +} + + +DRIVER drv_st2205 = { + .name = Name, + .list = drv_st2205_list, + .init = drv_st2205_init2, + .quit = drv_st2205_quit2, +}; diff --git a/drv_ula200.c b/drv_ula200.c new file mode 100644 index 0000000..7c71995 --- /dev/null +++ b/drv_ula200.c @@ -0,0 +1,791 @@ +/* $Id: drv_ula200.c 1126 2010-07-13 03:25:44Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_ula200.c $ + * + * ULA200 driver for lcd4linux + * + * Copyright (C) 2008 Bernhard Walle <bernhard.walle@gmx.de> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * Driver for the ELV ULA200 USB device. The device can control one + * HD44780 display up to 4x20 characters. + * + * Implemented functions: + * - displaying characters :-) + * - controlling the backlight + * + * Todo: + * - input buttons + * + * Configuration: + * - Size (XxY): size of the display (e.g. '20x4') + * - Backlight (0/1): initial state of the backlight + * + * Author: + * Bernhard Walle <bernhard.walle@gmx.de> + * + * exported fuctions: + * struct DRIVER drv_ula200 + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include <ftdi.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "drv.h" + +/* text mode display? */ +#include "drv_generic_text.h" + +/****************************************/ +/*** Global variables ***/ +/****************************************/ + +static char Name[] = "ULA200"; +static struct ftdi_context *Ftdi = NULL; + + +/****************************************/ +/*** Constants ***/ +/****************************************/ + +/* USB connection */ +#define ULA200_VENDOR_ID 0x0403 +#define ULA200_PRODUCT_ID 0xf06d + +/* connection parameters */ +#define ULA200_BAUDRATE 19200 +#define ULA200_DATABITS BITS_8 +#define ULA200_STOPBITS STOP_BIT_1 +#define ULA200_PARITY EVEN + +/* character constants used for the communication */ +#define ULA200_CH_STX 0x02 +#define ULA200_CH_ETX 0x03 +#define ULA200_CH_ENQ 0x05 +#define ULA200_CH_ACK 0x06 +#define ULA200_CH_NAK 0x15 +#define ULA200_CH_DC2 0x12 +#define ULA200_CH_DC3 0x13 + +/* commands used for the communication (names are German) */ +#define ULA200_CMD_POSITION 'p' /* 'position' */ +#define ULA200_CMD_STRING 's' /* 'string' */ +#define ULA200_CMD_CLEAR 'l' /* 'loeschen' */ +#define ULA200_CMD_BACKLIGHT 'h' /* 'hintergrund' */ +#define ULA200_CMD_CHAR 'c' /* 'character' */ + +/* raw register access */ +#define ULA200_RS_DATA 0x00 /* data */ +#define ULA200_RS_INSTR 0x01 /* instruction */ +#define ULA200_SETCHAR 0x40 /* set user-defined character */ + +/* character sizes */ +#define ULA200_CELLWIDTH 5 +#define ULA200_CELLHEIGHT 8 + +/* internal implementation constants */ +#define ULA200_BUFFER_LENGTH 1024 +#define ULA200_MAXLEN 512 +#define ULA200_MAX_REPEATS 20 + +/* define TRUE and FALSE for better code readability if not already defined */ +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + + +/****************************************/ +/*** Macros ***/ +/****************************************/ + +#define ULA200_ERROR(msg, ...) \ + error("%s: In %s():%d: " msg, Name, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__) + +#define ULA200_INFO(msg, ...) \ + info("%s: " msg, Name, ##__VA_ARGS__) + +#define ULA200_DEBUG(msg, ...) \ + debug("%s: In %s():%d: " msg, Name, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__) + +#define ULA200_TRACE() \ + debug("%s: Calling %s()", Name, __FUNCTION__) + + +/****************************************/ +/*** Prototypes ***/ +/****************************************/ + +static int drv_ula200_ftdi_read_response(void); +static int drv_ula200_ftdi_usb_read(void); +static int drv_ula200_ftdi_write_command(const unsigned char *, int); +static int drv_ula200_backlight(int); +static int drv_ula200_close(void); + +static void plugin_backlight(RESULT *, RESULT *); + +/****************************************/ +/*** Internal (helper) funcs ***/ +/****************************************/ + +/** + * Write a command to the display. Adds the STX and ETX header/trailer. + * + * @param[in] data the data bytes + * @param[in] length the number of bytes in data which are valid + * @return 0 on success, negative value on error + */ +static int drv_ula200_ftdi_write_command(const unsigned char *data, int length) +{ + int i, err; + int repeat_count = 0; + int pos = 0; + unsigned char buffer[ULA200_BUFFER_LENGTH]; + + /* check for the maximum length */ + if (length > ULA200_MAXLEN) { + return -EINVAL; + } + + /* fill the array */ + buffer[pos++] = ULA200_CH_STX; + for (i = 0; i < length; i++) { + if (data[i] == ULA200_CH_STX) { + buffer[pos++] = ULA200_CH_ENQ; + buffer[pos++] = ULA200_CH_DC2; + } else if (data[i] == ULA200_CH_ETX) { + buffer[pos++] = ULA200_CH_ENQ; + buffer[pos++] = ULA200_CH_DC3; + } else if (data[i] == ULA200_CH_ENQ) { + buffer[pos++] = ULA200_CH_ENQ; + buffer[pos++] = ULA200_CH_NAK; + } else { + buffer[pos++] = data[i]; + } + } + buffer[pos++] = ULA200_CH_ETX; + + do { + /* ULA200_DEBUG("ftdi_write_data(%p, %d)", buffer, pos); */ + err = ftdi_write_data(Ftdi, buffer, pos); + if (err < 0) { + ULA200_ERROR("ftdi_write_data() failed"); + return -1; + } + } + while (!drv_ula200_ftdi_read_response() && (repeat_count++ < ULA200_MAX_REPEATS)); + + return 0; +} + +/** + * Reads a character from USB. + * + * @return a positive value between 0 and 255 indicates the character that + * has been read successfully, -1 indicates an error + */ +static int drv_ula200_ftdi_usb_read(void) +{ + unsigned char buffer[1]; + int err; + + while ((err = ftdi_read_data(Ftdi, buffer, 1)) == 0); + return err >= 0 ? buffer[0] : -1; +} + + +/** + * Reads the response of the display. Currently, key input is ignored + * and only ACK / NACK is read. + * + * @return TRUE on success (ACK), FALSE on failure (NACK) + */ +static int drv_ula200_ftdi_read_response(void) +{ + int result = FALSE; + int answer_read = FALSE; + int ret; + int ch; + + while (!answer_read) { + /* wait until STX */ + do { + ret = drv_ula200_ftdi_usb_read(); + /* ULA200_DEBUG("STX drv_ula200_ftdi_usb_read = %d", ret); */ + } while ((ret != ULA200_CH_STX) && (ret > 0)); + + if (ret < 0) { + return FALSE; + } + + /* read next char */ + ch = drv_ula200_ftdi_usb_read(); + /* ULA200_DEBUG("drv_ula200_ftdi_usb_read = %d", ch); */ + + switch (ch) { + case 't': + ch = drv_ula200_ftdi_usb_read(); + /* ULA200_DEBUG("drv_ula200_ftdi_usb_read = %d", ch); */ + /* ignore currently */ + break; + + case ULA200_CH_ACK: + answer_read = TRUE; + result = TRUE; + break; + + case ULA200_CH_NAK: + answer_read = TRUE; + result = FALSE; + break; + + default: + answer_read = TRUE; + ULA200_ERROR("Read invalid answer"); + } + + /* wait until ETX */ + do { + ret = drv_ula200_ftdi_usb_read(); + /* ULA200_DEBUG("ETX drv_ula200_ftdi_usb_read = %d", ret); */ + } while ((ret != ULA200_CH_ETX) && (ret > 0)); + + if (ret < 0) { + return FALSE; + } + } + + return result; +} + +static int drv_ula200_ftdi_enable_raw_mode(void) +{ + unsigned char command[3]; + + command[0] = 'R'; + command[1] = 'E'; + command[2] = '1'; + return drv_ula200_ftdi_write_command(command, 3); +} + + +/** + * Writes raw data (access the HD44780 registers directly. + * + * @param[in] flags ULA200_RS_DATA or ULA200_RS_INSTR + * @param[in] ch the real data + * @return 0 on success, a negative value on error + */ +static int drv_ula200_ftdi_rawdata(unsigned char flags, unsigned char ch) +{ + unsigned char command[3]; + int err; + + command[0] = 'R'; + command[1] = flags == ULA200_RS_DATA ? '2' : '0'; + command[2] = ch; + err = drv_ula200_ftdi_write_command(command, 3); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + return -1; + } + + return 0; +} + +/** + * Sets the cursor position. + * + * @param[in] x the x coordinate of the position + * @param[in] y the y coordinate of the position + * @return 0 on success, a negative value on error + */ +static int drv_ula200_set_position(int x, int y) +{ + unsigned char command[3]; + int err; + + if (y >= 2) { + y -= 2; + x += DCOLS; /* XXX: multiply by 2? */ + } + + command[0] = ULA200_CMD_POSITION; + command[1] = x; + command[2] = y; + err = drv_ula200_ftdi_write_command(command, 3); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + } + + return err; +} + +/** + * Sends the text + * + * @param[in] data the data bytes + * @param[in] len the number of valid bytes in @p data + * @return 0 on success, a negative value on error + */ +static int drv_ula200_send_text(const unsigned char *data, int len) +{ + unsigned char buffer[ULA200_BUFFER_LENGTH]; + int err; + + if (len > ULA200_MAXLEN) { + return -EINVAL; + } + + buffer[0] = ULA200_CMD_STRING; + buffer[1] = len; + memcpy(buffer + 2, data, len); + buffer[2 + len] = 0; /* only necessary for the debug message */ + + /* ULA200_DEBUG("Text: =%s= (%d)", buffer+2, len); */ + + err = drv_ula200_ftdi_write_command(buffer, len + 2); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + return -1; + } + + return 0; +} + +/** + * Sends one character. + * + * @param[in] ch the character to send + * @return 0 on success, a negative value on error + */ +static int drv_ula200_send_char(char ch) +{ + unsigned char buffer[2]; + int err; + + buffer[0] = ULA200_CMD_CHAR; + buffer[1] = ch; + + err = drv_ula200_ftdi_write_command(buffer, 2); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + return -1; + } + + return 0; +} + +/** + * Opens the ULA200 display. Uses libftdi to initialise the USB communication to + * the display. + * + @ @return a value less then zero on failure, 0 on success + */ +static int drv_ula200_open(void) +{ + int err; + + /* check if the device was already open */ + if (Ftdi != NULL) { + ULA200_ERROR("open called although device was already open"); + drv_ula200_close(); + } + + /* get memory for the device descriptor */ + Ftdi = malloc(sizeof(struct ftdi_context)); + if (Ftdi == NULL) { + ULA200_ERROR("Memory allocation failed"); + return -1; + } + + /* open the ftdi library */ + ftdi_init(Ftdi); + Ftdi->usb_write_timeout = 20; + Ftdi->usb_read_timeout = 20; + + /* open the device */ + err = ftdi_usb_open(Ftdi, ULA200_VENDOR_ID, ULA200_PRODUCT_ID); + if (err < 0) { + ULA200_ERROR("ftdi_usb_open() failed"); + free(Ftdi); + Ftdi = NULL; + return -1; + } + + /* set the baudrate */ + err = ftdi_set_baudrate(Ftdi, ULA200_BAUDRATE); + if (err < 0) { + ULA200_ERROR("ftdi_set_baudrate() failed"); + ftdi_usb_close(Ftdi); + free(Ftdi); + Ftdi = NULL; + return -1; + } + /* set communication parameters */ + err = ftdi_set_line_property(Ftdi, ULA200_DATABITS, ULA200_STOPBITS, ULA200_PARITY); + if (err < 0) { + ULA200_ERROR("ftdi_set_line_property() failed"); + ftdi_usb_close(Ftdi); + free(Ftdi); + Ftdi = NULL; + return -1; + } + + return 0; +} + +/** + * Closes the display. + * + * @return 0 on success, a negative value on failure + */ +static int drv_ula200_close(void) +{ + ULA200_TRACE(); + + ftdi_usb_purge_buffers(Ftdi); + ftdi_usb_close(Ftdi); + ftdi_deinit(Ftdi); + + free(Ftdi); + Ftdi = NULL; + + return 0; +} + +/** + * Clears the contents of the display. + * + * @return 0 on success, a negative value on error + */ +static void drv_ula200_clear(void) +{ + unsigned const char command[] = { ULA200_CMD_CLEAR }; + int err; + + ULA200_TRACE(); + + err = drv_ula200_ftdi_write_command(command, 1); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + } +} + +/** + * Writes data to the display. + * + * @param[in] row the row where the data should be written to + * @param[in] col the column where the data should be written to + * @param[in] data the data that should actually be written + * @param[in] len the number of valid bytes in @p data + */ +static void drv_ula200_write(const int row, const int col, const char *data, int len) +{ + int ret; + + /* do the cursor positioning here */ + ret = drv_ula200_set_position(col, row); + if (ret < 0) { + ULA200_ERROR("drv_ula200_set_position() failed"); + return; + } + + /* send string to the display */ + if (len == 1) { + ret = drv_ula200_send_char(data[0]); + } else { + ret = drv_ula200_send_text((unsigned char *) data, len); + } + if (ret < 0) { + ULA200_ERROR("drv_ula200_send_text() failed"); + return; + } +} + +/* text mode displays only */ +static void drv_ula200_defchar(const int ascii, const unsigned char *matrix) +{ + int err, i; + + if (ascii >= 8) { + ULA200_ERROR("Invalid value in drv_ula200_defchar"); + return; + } + + /* Tell the HD44780 we will redefine char number 'ascii' */ + err = drv_ula200_ftdi_rawdata(ULA200_RS_INSTR, ULA200_SETCHAR | (ascii * 8)); + if (err < 0) { + ULA200_ERROR("drv_ula200_ftdi_rawdata() failed"); + return; + } + + /* Send the subsequent rows */ + for (i = 0; i < YRES; i++) { + err = drv_ula200_ftdi_rawdata(ULA200_RS_DATA, *matrix++ & 0x1f); + if (err < 0) { + ULA200_ERROR("ula200_ftdi_rawdata() failed"); + return; + } + } +} + +/** + * Controls the backlight of the ULA200 display. + * + * @param[in] backlight a negative value if the backlight should be turned off, + * a positive value if it should be turned on + * @return 0 on success, any other value on failure + */ +static int drv_ula200_backlight(int backlight) +{ + unsigned char cmd[2] = { ULA200_CMD_BACKLIGHT }; + int ret; + + if (backlight <= 0) { + backlight = '0'; + } else { + backlight = '1'; + } + + cmd[1] = backlight; + ret = drv_ula200_ftdi_write_command(cmd, 2); + if (ret < 0) { + ULA200_ERROR("ula200_ftdi_write_command() failed"); + } + + return backlight == '1'; +} + +/** + * Starts the display. + * + * @param[in] section the section of the configuration file + * @return 0 on success, a negative value on failure + */ +static int drv_ula200_start(const char *section) +{ + int rows = -1, cols = -1; + char *s; + int backlight = 0; + int err; + + s = cfg_get(section, "Size", NULL); + if (s == NULL || *s == '\0') { + ULA200_ERROR("No '%s.Size' entry from %s", section, cfg_source()); + return -1; + } + if (sscanf(s, "%dx%d", &cols, &rows) != 2 || rows < 1 || cols < 1) { + ULA200_ERROR("Bad %s.Size '%s' from %s", section, s, cfg_source()); + free(s); + return -1; + } + + DROWS = rows; + DCOLS = cols; + + /* open communication with the display */ + err = drv_ula200_open(); + if (err < 0) { + return -1; + } + + cfg_number(section, "Backlight", 0, 0, 1, &backlight); + err = drv_ula200_backlight(backlight); + if (err < 0) { + ULA200_ERROR("drv_ula200_backlight() failed"); + return -1; + } + + /* clear display */ + drv_ula200_clear(); + + /* enable raw mode for defining own chars */ + drv_ula200_ftdi_enable_raw_mode(); + + return 0; +} + +/****************************************/ +/*** plugins ***/ +/****************************************/ + +/** + * Backlight plugin + */ +static void plugin_backlight(RESULT * result, RESULT * arg1) +{ + double backlight; + + backlight = drv_ula200_backlight(R2N(arg1)); + SetResult(&result, R_NUMBER, &backlight); +} + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + +/** + * list models + * + * @return 0 on success, a negative value on failure + */ +int drv_ula200_list(void) +{ + printf("ULA200"); + return 0; +} + +/** + * initialize driver & display + * + * @param[in] section the name of the section in the configuration file + * @param[in] quiet TRUE on quiet mode + * @return 0 on success, any negative error value on failure + */ +/* use this function for a text display */ +int drv_ula200_init(const char *section, const int quiet) +{ + WIDGET_CLASS wc; + int ret; + + ULA200_INFO("%s", "$Rev: 1126 $"); + + /* display preferences */ + XRES = ULA200_CELLWIDTH; /* pixel width of one char */ + YRES = ULA200_CELLHEIGHT; /* pixel height of one char */ + CHARS = 7; /* number of user-defineable characters */ + CHAR0 = 1; /* ASCII of first user-defineable char */ + GOTO_COST = 4; /* number of bytes a goto command requires */ + + /* real worker functions */ + drv_generic_text_real_write = drv_ula200_write; + drv_generic_text_real_defchar = drv_ula200_defchar; + + /* start display */ + if ((ret = drv_ula200_start(section)) != 0) { + return ret; + } + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet(buffer, "ULA 200")) { + sleep(3); + drv_ula200_clear(); + } + } + + /* initialize generic text driver */ + if ((ret = drv_generic_text_init(section, Name)) != 0) + return ret; + + /* initialize generic icon driver */ + if ((ret = drv_generic_text_icon_init()) != 0) + return ret; + + /* initialize generic bar driver */ + if ((ret = drv_generic_text_bar_init(0)) != 0) + return ret; + + /* add fixed chars to the bar driver */ + drv_generic_text_bar_add_segment(0, 0, 255, 32); /* ASCII 32 = blank */ + + /* register text widget */ + wc = Widget_Text; + wc.draw = drv_generic_text_draw; + widget_register(&wc); + + /* register icon widget */ + wc = Widget_Icon; + wc.draw = drv_generic_text_icon_draw; + widget_register(&wc); + + /* register bar widget */ + wc = Widget_Bar; + wc.draw = drv_generic_text_bar_draw; + widget_register(&wc); + + /* register plugins */ + AddFunction("LCD::backlight", -1, plugin_backlight); + + return 0; +} + +/** + * close driver & display + * + * @param[in] quiet TRUE on quiet mode + * @return 0 on success, any negative error value on failure + */ +/* use this function for a text display */ +int drv_ula200_quit(int quiet) +{ + ULA200_INFO("shutting down."); + + drv_generic_text_quit(); + + /* turn backlight off */ + drv_ula200_backlight(0); + + /* clear display */ + drv_ula200_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_text_greet("goodbye!", NULL); + } + + debug("closing connection"); + drv_ula200_close(); + + return 0; +} + +/* use this one for a text display */ +DRIVER drv_ula200 = { + .name = Name, + .list = drv_ula200_list, + .init = drv_ula200_init, + .quit = drv_ula200_quit, +}; + +/* :indentSize=4:tabSize=8:noTabs=false: */ diff --git a/drv_vnc.c b/drv_vnc.c new file mode 100644 index 0000000..5249206 --- /dev/null +++ b/drv_vnc.c @@ -0,0 +1,547 @@ +/* $Id: drv_vnc.c 1031 2009-04-15 21:34:51Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_vnc.c $ + * + * Libvncserver driver + * + * Copyright (C) 2009 Michael Vogt <michu@neophob.com> + * Modified from sample code by: + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2005, 2006, 2007, 2008, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * + * exported fuctions: + * + * struct DRIVER drv_vnc + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#include <rfb/rfb.h> + +/* struct timeval */ +#include <sys/time.h> + +#include "debug.h" +#include "cfg.h" +#include "qprintf.h" +#include "udelay.h" +#include "plugin.h" +#include "widget.h" +#include "widget_text.h" +#include "widget_icon.h" +#include "widget_bar.h" +#include "widget_keypad.h" +#include "drv.h" +#include "drv_generic_graphic.h" +#include "drv_generic_keypad.h" + +//todo: key widget text + +#define NO_MOUSE_BUTTON_PRESSED 0 +#define LEFT_MOUSE_BUTTON_PRESSED 1 +#define SLEEP_STEPS 1000 + +static char Name[] = "VNC"; + +static int xres = 320; /* screen settings */ +static int yres = 200; +static int BPP = 4; +static int max_clients = 2; /* max connected clients */ +static int osd_showtime = 2000; /* time to display the osd in ms */ +static int buttons = 2; /* number of keypad buttons */ +static int buttonsize = 50; /* size of keypad buttons */ +static int keypadxofs = 0; +static int keypadyofs = 0; +static int keypadgap = 0; +static int port = 5900; +static int httpPort = 5800; +static unsigned char framer = 0; +static unsigned char frameg = 0; +static unsigned char frameb = 0; + +static rfbScreenInfoPtr server; /* vnc device */ +static struct timeval osd_timestamp; +static int show_keypad_osd = 0; /* is the osd active? */ +static int clientCount = 0; /* currently connected clients */ +static int mouse_x = 0; +static int mouse_y = 0; +static int mouse_stat_old = 0; +static int process_event = 0; +static long frames = 0; +static char *password; +static char *javaClassFiles; +static struct timeval startDriver; +static int maxfps = -1; + +/* draws a simple rect, used to display keypad */ +int draw_rect(int x, int y, int size, unsigned char col, char *buffer) +{ + int ofs, ofs2, i, ret; + unsigned char colr, colg; + colr = colg = col; + ret = 0; + + /* check if mouse is in current rect */ + if (mouse_x > x && mouse_x < (x + size)) + if (mouse_y > y && mouse_y < (y + size)) { + colr = framer; + colg = frameg; + col = frameb; + ret = 1; + } + + ofs2 = size * xres * BPP; + for (i = x; i < x + size; i++) { + ofs = (i + xres * y) * BPP; + buffer[ofs + ofs2] = colr; + buffer[ofs++] = colr; + buffer[ofs + ofs2] = colg; + buffer[ofs++] = colg; + buffer[ofs + ofs2] = col; + buffer[ofs++] = col; + } + + ofs2 = size * BPP; + for (i = y; i <= y + size; i++) { + ofs = (i * xres + x) * BPP; + buffer[ofs + ofs2] = colr; + buffer[ofs++] = colr; + buffer[ofs + ofs2] = colg; + buffer[ofs++] = colg; + buffer[ofs + ofs2] = col; + buffer[ofs++] = col; + } + return ret; +} + +void display_keypad() +{ + int i, rectx, recty; + int active; + for (i = 0; i < buttons; i++) { + rectx = keypadxofs + (i * (buttonsize + keypadgap)); + recty = keypadyofs /*+ (i*(buttonsize+gap)) */ ; + active = draw_rect(rectx, recty, buttonsize, 0, server->frameBuffer); + + /* if the lmb button is pressed and we didnt processed the event yet - do it now */ + if (active == 1 && process_event == 1) { + drv_generic_keypad_press(i + 1); + //debug("mouse in keypad nr %d", i); + process_event = 0; + } + } +} + +/* called if a vnc client disconnects */ +static void clientgone( __attribute__ ((unused)) rfbClientPtr cl) +{ + if (clientCount > 0) + clientCount--; + debug("%d clients connected", clientCount); +} + +/* called if a vnc client connect */ +static enum rfbNewClientAction hook_newclient(rfbClientPtr cl) +{ + if (clientCount < max_clients) { + clientCount++; + cl->clientGoneHook = clientgone; + debug("%d clients connected", clientCount); + return RFB_CLIENT_ACCEPT; + } else { + info("client refused due max. client connections (%d)", clientCount); + return RFB_CLIENT_REFUSE; + } +} + +/* handle mouse action */ +static void hook_mouseaction(int buttonMask, int x, int y, rfbClientPtr cl) +{ + if (x >= 0 && y >= 0 && x < xres && y < yres) { + process_event = 0; + + /* process ONLY if mouse button is released. */ + if (buttonMask == NO_MOUSE_BUTTON_PRESSED && mouse_stat_old == LEFT_MOUSE_BUTTON_PRESSED) { + gettimeofday(&osd_timestamp, NULL); + process_event = 1; + mouse_x = x; + mouse_y = y; + } + //debug("btnMask: %d, old state: %d, processevent: %d", buttonMask, mouse_stat_old, process_event); + + /* show osd display if mouse is pressed */ + if (buttonMask == 1) { + gettimeofday(&osd_timestamp, NULL); + mouse_x = x; + mouse_y = y; + if (show_keypad_osd == 0) { + /* no osd until yet, activate osd keypad ... */ + show_keypad_osd = 1; + } + } + + } + + mouse_stat_old = buttonMask; + rfbDefaultPtrAddEvent(buttonMask, x, y, cl); +} + +static int drv_vnc_keypad(const int num) +{ + int val = WIDGET_KEY_PRESSED; + + switch (num) { + case 1: + val += WIDGET_KEY_UP; + break; + case 2: + val += WIDGET_KEY_DOWN; + break; + case 3: + val += WIDGET_KEY_LEFT; + break; + case 4: + val += WIDGET_KEY_RIGHT; + break; + case 5: + val += WIDGET_KEY_CONFIRM; + break; + case 6: + val += WIDGET_KEY_CANCEL; + break; + default: + error("%s: unknown keypad value %d", Name, num); + } + + return val; +} + +/* init the driver, read config */ +static int drv_vnc_open(const char *Section) +{ + int keypadcol; + if (cfg_number(Section, "Xres", 320, 32, 2048, &xres) < 1) { + info("[DRV_VNC] no '%s.Xres' entry from %s using default %d", Section, cfg_source(), xres); + } + if (cfg_number(Section, "Yres", 200, 32, 2048, &yres) < 1) { + info("[DRV_VNC] no '%s.Yres' entry from %s using default %d", Section, cfg_source(), yres); + } + if (cfg_number(Section, "Bpp", 4, 1, 4, &BPP) < 1) { + info("[DRV_VNC] no '%s.Bpp' entry from %s using default %d", Section, cfg_source(), BPP); + } + if (cfg_number(Section, "Maxclients", 2, 1, 64, &max_clients) < 1) { + info("[DRV_VNC] no '%s.Maxclients' entry from %s using default %d", Section, cfg_source(), max_clients); + } + if (cfg_number(Section, "Osd_showtime", 2000, 500, 60000, &osd_showtime) < 1) { + info("[DRV_VNC] no '%s.Osd_showtime' entry from %s using default %d", Section, cfg_source(), osd_showtime); + } + if (cfg_number(Section, "Buttons", 2, 0, 6, &buttons) < 1) { + info("[DRV_VNC] no '%s.Buttons' entry from %s using default %d", Section, cfg_source(), buttons); + } + if (cfg_number(Section, "Buttonsize", 50, 8, 256, &buttonsize) < 1) { + info("[DRV_VNC] no '%s.Buttonsize' entry from %s using default %d", Section, cfg_source(), buttonsize); + } + if (cfg_number(Section, "Keypadxofs", 0, 0, 4096, &keypadxofs) < 1) { + info("[DRV_VNC] no '%s.Keypadxofs' entry from %s using default %d", Section, cfg_source(), keypadxofs); + } + if (cfg_number(Section, "Keypadyofs", 0, 0, 4096, &keypadyofs) < 1) { + info("[DRV_VNC] no '%s.Keypadyofs' entry from %s using default %d", Section, cfg_source(), keypadyofs); + } + if (cfg_number(Section, "Keypadgap", 10, 0, 2048, &keypadgap) < 1) { + info("[DRV_VNC] no '%s.Keypadgap' entry from %s using default %d", Section, cfg_source(), keypadgap); + } + if (cfg_number(Section, "Keypadcol", 255, 0, 0xffffff, &keypadcol) < 1) { + info("[DRV_VNC] no '%s.Keypadcol' entry from %s using default red", Section, cfg_source()); + framer = 255; + } else { + framer = keypadcol & 0xff; + frameg = (keypadcol & 0xff00) >> 8; + frameb = (keypadcol & 0xff0000) >> 16; + } + if (cfg_number(Section, "Port", 5900, 1, 65535, &port) < 1) { + info("[DRV_VNC] no '%s.Port' entry from %s using default %d", Section, cfg_source(), port); + } + if (cfg_number(Section, "HttpPort", 5800, 1, 65535, &httpPort) < 1) { + info("[DRV_VNC] no '%s.HttpPort' entry from %s using default %d", Section, cfg_source(), httpPort); + } + if (cfg_number(Section, "Maxfps", -1, -1, 512, &maxfps) < 1) { + info("[DRV_VNC] no '%s.Maxfps' entry from %s using default %d", Section, cfg_source(), maxfps); + } + password = cfg_get(Section, "Password", NULL); + if (password != NULL) { + info("[DRV_VNC] password enabled"); + } + javaClassFiles = cfg_get(Section, "HttpDir", NULL); + if (javaClassFiles != NULL) { + info("[DRV_VNC] HTTP server enabled"); + } + return 0; +} + +/* shutdown driver, release allocated stuff */ +static int drv_vnc_close(void) +{ + rfbShutdownServer(server, TRUE); + free(server->frameBuffer); + return 0; +} + + +/* actual blitting method */ +static void drv_vnc_blit_it(const int row, const int col, const int height, const int width, unsigned char *buffer) +{ + static int sleep = 0; + int r, c, ofs; + RGBA p; + + for (r = row; r < row + height; r++) { + for (c = col; c < col + width; c++) { + p = drv_generic_graphic_rgb(r, c); + ofs = (r * xres + c) * BPP; + buffer[ofs++] = p.R; + buffer[ofs++] = p.G; + buffer[ofs++] = p.B; + buffer[ofs] = 255; + } + } + + /* display osd keypad */ + if (show_keypad_osd == 1) { + display_keypad(); + + /* check if the osd should be disabled after the waittime */ + struct timeval now; + gettimeofday(&now, NULL); + int timedelta = (now.tv_sec - osd_timestamp.tv_sec) * 1000 + (now.tv_usec - osd_timestamp.tv_usec) / 1000; + + if (timedelta > osd_showtime) { + show_keypad_osd = 0; + } + } + frames++; + if ((frames % 10) == 0 && maxfps > 0) { + struct timeval blittime; + gettimeofday(&blittime, NULL); + int time_since_start = + (blittime.tv_sec - startDriver.tv_sec) * 1000 + (blittime.tv_usec - startDriver.tv_usec) / 1000; + + /* if time changed since start of lcd4linux */ + if (time_since_start < 0) { + gettimeofday(&startDriver, NULL); + time_since_start = + (blittime.tv_sec - startDriver.tv_sec) * 1000 + (blittime.tv_usec - startDriver.tv_usec) / 1000; + if (time_since_start == 0) + time_since_start = 1; + } + //info("time :%d, frames: %d, sleep: %d", time_since_start, frames, sleep); + + int fps = (int) (1000 * frames / time_since_start); + + if (fps > maxfps) { + sleep += SLEEP_STEPS; + } + + if (fps < maxfps && sleep >= SLEEP_STEPS) { + sleep -= SLEEP_STEPS; + } + } + usleep(sleep); + +} + + +static void drv_vnc_blit(const int row, const int col, const int height, const int width) +{ + + if (rfbIsActive(server)) { + drv_vnc_blit_it(row, col, height, width, (unsigned char *) server->frameBuffer); + + if (clientCount > 0) { + rfbMarkRectAsModified(server, 0, 0, xres, yres); + } + rfbProcessEvents(server, server->deferUpdateTime * 500); + } +} + +/* start graphic display */ +static int drv_vnc_start(const char *section) +{ + char *s; + + s = cfg_get(section, "Font", "6x8"); + if (s == NULL || *s == '\0') { + error("%s: no '%s.Font' entry from %s", Name, section, cfg_source()); + return -1; + } + + XRES = -1; + YRES = -1; + if (sscanf(s, "%dx%d", &XRES, &YRES) != 2 || XRES < 1 || YRES < 1) { + error("%s: bad Font '%s' from %s", Name, s, cfg_source()); + return -1; + } + + /* Fixme: provider other fonts someday... */ + if (XRES != 6 && YRES != 8) { + error("%s: bad Font '%s' from %s (only 6x8 at the moment)", Name, s, cfg_source()); + return -1; + } + + /* open communication with the display */ + if (drv_vnc_open(section) < 0) { + return -1; + } + + /* you surely want to allocate a framebuffer or something... */ + server = rfbGetScreen(0, NULL, xres, yres, 8, 3, BPP); + server->desktopName = "LCD4Linux VNC Driver"; + server->frameBuffer = (char *) malloc(xres * yres * BPP); + server->alwaysShared = (1 == 1); + server->port = port; + server->ptrAddEvent = hook_mouseaction; + server->newClientHook = hook_newclient; + + if (password != NULL) { + char **passwds = malloc(sizeof(char **) * 2); + passwds[0] = password; + passwds[1] = 0; + server->authPasswdData = (void *) passwds; + server->passwordCheck = rfbCheckPasswordByList; + } + if (javaClassFiles != NULL) { + server->httpDir = javaClassFiles; + server->httpEnableProxyConnect = TRUE; + server->httpPort = httpPort; + } + /* Initialize the server */ + rfbInitServer(server); + + /* set width/height */ + DROWS = yres; + DCOLS = xres; + + /* set timestamp */ + gettimeofday(&startDriver, NULL); + + return 0; +} + +/****************************************/ +/*** widget callbacks ***/ +/****************************************/ + + +/* using drv_generic_text_draw(W) */ +/* using drv_generic_text_icon_draw(W) */ +/* using drv_generic_text_bar_draw(W) */ +/* using drv_generic_gpio_draw(W) */ + + +/****************************************/ +/*** exported functions ***/ +/****************************************/ + + +/* list models */ +int drv_vnc_list(void) +{ + printf("vnc server"); + return 0; +} + + +/* initialize driver & display */ +int drv_vnc_init(const char *section, const int quiet) +{ + int ret; + + /* real worker functions */ + drv_generic_graphic_real_blit = drv_vnc_blit; + drv_generic_keypad_real_press = drv_vnc_keypad; + + /* start display */ + if ((ret = drv_vnc_start(section)) != 0) + return ret; + + /* initialize generic graphic driver */ + if ((ret = drv_generic_graphic_init(section, Name)) != 0) + return ret; + + /* initialize generic key pad driver */ + if ((ret = drv_generic_keypad_init(section, Name)) != 0) + return ret; + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_graphic_greet(buffer, NULL)) { + sleep(3); + drv_generic_graphic_clear(); + } + } + + return 0; +} + + +/* close driver & display */ +int drv_vnc_quit(const int quiet) +{ + info("%s: shutting down.", Name); + + /* clear display */ + drv_generic_graphic_clear(); + + /* say goodbye... */ + if (!quiet) { + drv_generic_graphic_greet("goodbye!", NULL); + } + + drv_generic_graphic_quit(); + drv_generic_keypad_quit(); + if (password != NULL) { + free(password); + } + if (javaClassFiles != NULL) { + free(javaClassFiles); + } + + debug("closing connection"); + drv_vnc_close(); + + return (0); +} + + +DRIVER drv_vnc = { + .name = Name, + .list = drv_vnc_list, + .init = drv_vnc_init, + .quit = drv_vnc_quit, +}; diff --git a/evaluator.c b/evaluator.c index f297491..f5f8b06 100644 --- a/evaluator.c +++ b/evaluator.c @@ -1,9 +1,9 @@ -/* $Id: evaluator.c 754 2007-01-21 06:19:40Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/evaluator.c $ +/* $Id: evaluator.c 1038 2009-08-21 03:33:16Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/evaluator.c $ * * expression evaluation * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -108,12 +108,18 @@ typedef enum { O_COL, /* colon in a?b:c */ O_OR, /* logical OR */ O_AND, /* logical AND */ - O_EQ, /* equal */ - O_NE, /* not equal */ - O_LT, /* less than */ - O_LE, /* less or equal */ - O_GT, /* greater than */ - O_GE, /* greater or equal */ + O_NEQ, /* numeric equal */ + O_NNE, /* numeric not equal */ + O_NLT, /* numeric less than */ + O_NLE, /* numeric less or equal */ + O_NGT, /* numeric greater than */ + O_NGE, /* numeric greater or equal */ + O_SEQ, /* string equal */ + O_SNE, /* string not equal */ + O_SLT, /* string less than */ + O_SLE, /* string less or equal */ + O_SGT, /* string greater than */ + O_SGE, /* string greater or equal */ O_ADD, /* addition */ O_SUB, /* subtraction */ O_SGN, /* sign '-' */ @@ -157,17 +163,17 @@ typedef struct _NODE { -/* operators */ +/* non-alphanumeric operators */ /* IMPORTANT! list must be sorted by length! */ -static PATTERN Pattern[] = { +static PATTERN Pattern1[] = { {";", 1, O_LST}, /* expression lists */ {"=", 1, O_SET}, /* variable assignements */ {"?", 1, O_CND}, /* conditional a?b:c */ {":", 1, O_COL}, /* colon a?b:c */ {"|", 1, O_OR}, /* logical OR */ {"&", 1, O_AND}, /* logical AND */ - {"<", 1, O_LT}, /* less than */ - {">", 1, O_GT}, /* greater than */ + {"<", 1, O_NLT}, /* numeric less than */ + {">", 1, O_NGT}, /* numeric greater than */ {"+", 1, O_ADD}, /* addition */ {"-", 1, O_SUB}, /* subtraction or sign */ {".", 1, O_CAT}, /* string concatenation */ @@ -179,10 +185,21 @@ static PATTERN Pattern[] = { {"(", 1, O_BRO}, /* open brace */ {",", 1, O_COM}, /* comma (argument seperator) */ {")", 1, O_BRC}, /* closing brace */ - {"==", 2, O_EQ}, /* equal */ - {"!=", 2, O_NE}, /* not equal */ - {"<=", 2, O_LE}, /* less or equal */ - {">=", 2, O_GE} /* greater or equal */ + {"==", 2, O_NEQ}, /* numeric equal */ + {"!=", 2, O_NNE}, /* numeric not equal */ + {"<=", 2, O_NLE}, /* numeric less or equal */ + {">=", 2, O_NGE} /* numeric greater or equal */ +}; + +/* alphanumeric operators */ +/* IMPORTANT! list must be sorted by length! */ +static PATTERN Pattern2[] = { + {"eq", 2, O_SEQ}, /* string equal */ + {"ne", 2, O_SNE}, /* string not equal */ + {"lt", 2, O_SLT}, /* string less than */ + {"le", 2, O_SLE}, /* string less or equal */ + {"gt", 2, O_SGT}, /* string greater than */ + {"ge", 2, O_SGE} /* string greater or equal */ }; @@ -199,6 +216,30 @@ static FUNCTION *Function = NULL; static unsigned int nFunction = 0; +/* strndup() may be not available on several platforms */ +#ifndef HAVE_STRNDUP +char *strndup(const char *source, size_t len) +{ + char *tmp = NULL; + + if (source == NULL) + return NULL; + + if (len >= strlen(source)) + return strdup(source); + + tmp = malloc(len + 1); + if (tmp == 0) + return NULL; + + strncpy(tmp, source, len); + tmp[len] = '\0'; + + return (tmp); +} +#endif + + void DelResult(RESULT * result) { result->type = 0; @@ -511,6 +552,7 @@ static void Parse(void) /* names */ if (is_alpha(*ExprPtr)) { + int i; char *start = ExprPtr; while (is_alnum(*ExprPtr)) ExprPtr++; @@ -521,6 +563,16 @@ static void Parse(void) } Word = strndup(start, ExprPtr - start); Token = T_NAME; + + /* check for alphanumeric operators */ + for (i = sizeof(Pattern2) / sizeof(Pattern2[0]) - 1; i >= 0; i--) { + if (strcmp(Word, Pattern2[i].pattern) == 0) { + Token = T_OPERATOR; + Operator = Pattern2[i].op; + break; + } + } + } /* numbers */ @@ -539,24 +591,91 @@ static void Parse(void) /* strings */ else if (*ExprPtr == '\'') { - char *start = ++ExprPtr; - while (*ExprPtr != '\0' && *ExprPtr != '\'') - ExprPtr++; - Word = strndup(start, ExprPtr - start); + size_t length = 0; + size_t size = CHUNK_SIZE; + Word = malloc(size); + ExprPtr++; + while (*ExprPtr != '\0' && *ExprPtr != '\'') { + if (*ExprPtr == '\\') { + switch (*(ExprPtr + 1)) { + case '\\': + case '\'': + Word[length++] = *(ExprPtr + 1); + ExprPtr += 2; + break; + case 'a': + Word[length++] = '\a'; + ExprPtr += 2; + break; + case 'b': + Word[length++] = '\b'; + ExprPtr += 2; + break; + case 't': + Word[length++] = '\t'; + ExprPtr += 2; + break; + case 'n': + Word[length++] = '\n'; + ExprPtr += 2; + break; + case 'v': + Word[length++] = '\v'; + ExprPtr += 2; + break; + case 'f': + Word[length++] = '\f'; + ExprPtr += 2; + break; + case 'r': + Word[length++] = '\r'; + ExprPtr += 2; + break; + case '0': + case '1': + case '2': + case '3': + if (*(ExprPtr + 2) >= '0' && *(ExprPtr + 2) <= '7' && + *(ExprPtr + 3) >= '0' && *(ExprPtr + 3) <= '7') { + Word[length++] = + (*(ExprPtr + 1) - '0') * 64 + (*(ExprPtr + 2) - '0') * 8 + (*(ExprPtr + 3) - '0'); + ExprPtr += 4; + } else { + error("Evaluator: illegal octal sequence '\\%c%c%c' in <%s>", + *(ExprPtr + 1), *(ExprPtr + 2), *(ExprPtr + 3), Expression); + Word[length++] = *ExprPtr++; + } + break; + default: + error("Evaluator: unknown escape sequence '\\%c' in <%s>", *(ExprPtr + 1), Expression); + Word[length++] = *ExprPtr++; + } + } else { + Word[length++] = *ExprPtr++; + } + if (length >= size) { + size += CHUNK_SIZE; + Word = realloc(Word, size); + } + } + Word[length] = '\0'; Token = T_STRING; - if (*ExprPtr == '\'') + if (*ExprPtr == '\'') { ExprPtr++; + } else { + error("Evaluator: unterminated string in <%s>", Expression); + } } - /* operators */ + /* non-alpha operators */ else { int i; - for (i = sizeof(Pattern) / sizeof(Pattern[0]) - 1; i >= 0; i--) { - int len = Pattern[i].len; - if (strncmp(ExprPtr, Pattern[i].pattern, Pattern[i].len) == 0) { + for (i = sizeof(Pattern1) / sizeof(Pattern1[0]) - 1; i >= 0; i--) { + int len = Pattern1[i].len; + if (strncmp(ExprPtr, Pattern1[i].pattern, Pattern1[i].len) == 0) { Word = strndup(ExprPtr, len); Token = T_OPERATOR; - Operator = Pattern[i].op; + Operator = Pattern1[i].op; ExprPtr += len; break; } @@ -808,7 +927,8 @@ static NODE *Level07(void) Root = Level08(); - while (Token == T_OPERATOR && (Operator == O_GT || Operator == O_GE || Operator == O_LT || Operator == O_LE)) { + while (Token == T_OPERATOR && (Operator == O_NGT || Operator == O_NGE || Operator == O_NLT || Operator == O_NLE || + Operator == O_SGT || Operator == O_SGE || Operator == O_SLT || Operator == O_SLE)) { Root = NewNode(Root); Parse(); LinkNode(Root, Level08()); @@ -825,7 +945,7 @@ static NODE *Level06(void) Root = Level07(); - while (Token == T_OPERATOR && (Operator == O_EQ || Operator == O_NE)) { + while (Token == T_OPERATOR && (Operator == O_NEQ || Operator == O_NNE || Operator == O_SEQ || Operator == O_SNE)) { Root = NewNode(Root); Parse(); LinkNode(Root, Level07()); @@ -948,10 +1068,6 @@ static int EvalTree(NODE * Root) char *s1, *s2; RESULT *param[10]; - for (i = 0; i < Root->Children; i++) { - EvalTree(Root->Child[i]); - } - switch (Root->Token) { case T_NUMBER: @@ -967,9 +1083,12 @@ static int EvalTree(NODE * Root) DelResult(Root->Result); /* prepare parameter list */ argc = Root->Children; - if (argc > 10) + if (argc > 10) { + error("evaluator: more than 10 children (operands) not supported!"); argc = 10; + } for (i = 0; i < argc; i++) { + EvalTree(Root->Child[i]); param[i] = Root->Child[i]->Result; } if (Root->Function->argc < 0) { @@ -986,6 +1105,9 @@ static int EvalTree(NODE * Root) switch (Root->Operator) { case O_LST: /* expression list: result is last expression */ + for (i = 0; i < Root->Children; i++) { + EvalTree(Root->Child[i]); + } i = Root->Children - 1; type = Root->Child[i]->Result->type; number = Root->Child[i]->Result->number; @@ -993,6 +1115,7 @@ static int EvalTree(NODE * Root) break; case O_SET: /* variable assignment */ + EvalTree(Root->Child[0]); CopyResult(&Root->Variable->value, Root->Child[0]->Result); type = Root->Child[0]->Result->type; number = Root->Child[0]->Result->number; @@ -1000,7 +1123,9 @@ static int EvalTree(NODE * Root) break; case O_CND: /* conditional expression */ + EvalTree(Root->Child[0]); i = 1 + (R2N(Root->Child[0]->Result) == 0.0); + EvalTree(Root->Child[i]); type = Root->Child[i]->Result->type; number = Root->Child[i]->Result->number; string = Root->Child[i]->Result->string; @@ -1008,61 +1133,134 @@ static int EvalTree(NODE * Root) case O_OR: /* logical OR */ type = R_NUMBER; - number = ((R2N(Root->Child[0]->Result) != 0.0) || (R2N(Root->Child[1]->Result) != 0.0)); + EvalTree(Root->Child[0]); + if (R2N(Root->Child[0]->Result) == 0.0) { + EvalTree(Root->Child[1]); + number = (R2N(Root->Child[1]->Result) != 0.0); + } else { + number = 1.0; + } break; case O_AND: /* logical AND */ type = R_NUMBER; - number = ((R2N(Root->Child[0]->Result) != 0.0) && (R2N(Root->Child[1]->Result) != 0.0)); + EvalTree(Root->Child[0]); + if (R2N(Root->Child[0]->Result) != 0.0) { + EvalTree(Root->Child[1]); + number = (R2N(Root->Child[1]->Result) != 0.0); + } else { + number = 0.0; + } break; - case O_EQ: /* numeric equal */ + case O_NEQ: /* numeric equal */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) == R2N(Root->Child[1]->Result)); break; - case O_NE: /* numeric not equal */ + case O_NNE: /* numeric not equal */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) != R2N(Root->Child[1]->Result)); break; - case O_LT: /* numeric less than */ + case O_NLT: /* numeric less than */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) < R2N(Root->Child[1]->Result)); break; - case O_LE: /* numeric less equal */ + case O_NLE: /* numeric less equal */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) <= R2N(Root->Child[1]->Result)); break; - case O_GT: /* numeric greater than */ + case O_NGT: /* numeric greater than */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) > R2N(Root->Child[1]->Result)); break; - case O_GE: /* numeric greater equal */ + case O_NGE: /* numeric greater equal */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = (R2N(Root->Child[0]->Result) >= R2N(Root->Child[1]->Result)); break; + case O_SEQ: /* string equal */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) == 0); + break; + + case O_SNE: /* string not equal */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) != 0); + break; + + case O_SLT: /* string less than */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) < 0); + break; + + case O_SLE: /* string less equal */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) <= 0); + break; + + case O_SGT: /* string greater than */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) > 0); + break; + + case O_SGE: /* string greater equal */ + type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); + number = (strcmp(R2S(Root->Child[0]->Result), R2S(Root->Child[1]->Result)) >= 0); + break; + case O_ADD: /* addition */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = R2N(Root->Child[0]->Result) + R2N(Root->Child[1]->Result); break; case O_SUB: /* subtraction */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = R2N(Root->Child[0]->Result) - R2N(Root->Child[1]->Result); break; case O_SGN: /* sign */ type = R_NUMBER; + EvalTree(Root->Child[0]); number = -R2N(Root->Child[0]->Result); break; case O_CAT: /* string concatenation */ type = R_STRING; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); s1 = R2S(Root->Child[0]->Result); s2 = R2S(Root->Child[1]->Result); string = malloc(strlen(s1) + strlen(s2) + 1); @@ -1073,11 +1271,15 @@ static int EvalTree(NODE * Root) case O_MUL: /* multiplication */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = R2N(Root->Child[0]->Result) * R2N(Root->Child[1]->Result); break; case O_DIV: /* division */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); dummy = R2N(Root->Child[1]->Result); if (dummy == 0) { error("Evaluator: warning: division by zero"); @@ -1089,6 +1291,8 @@ static int EvalTree(NODE * Root) case O_MOD: /* modulo */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); dummy = R2N(Root->Child[1]->Result); if (dummy == 0) { error("Evaluator: warning: division by zero"); @@ -1100,11 +1304,14 @@ static int EvalTree(NODE * Root) case O_POW: /* x^y */ type = R_NUMBER; + EvalTree(Root->Child[0]); + EvalTree(Root->Child[1]); number = pow(R2N(Root->Child[0]->Result), R2N(Root->Child[1]->Result)); break; case O_NOT: /* logical NOT */ type = R_NUMBER; + EvalTree(Root->Child[0]); number = (R2N(Root->Child[0]->Result) == 0.0); break; diff --git a/evaluator.h b/evaluator.h index 009b04b..76b4912 100644 --- a/evaluator.h +++ b/evaluator.h @@ -1,9 +1,9 @@ -/* $Id: evaluator.h 754 2007-01-21 06:19:40Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/evaluator.h $ +/* $Id: evaluator.h 1092 2010-01-23 12:04:55Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/evaluator.h $ * * expression evaluation * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -40,6 +40,12 @@ typedef struct { char *string; } RESULT; +/* strndup() may be not available on several platforms */ +#ifndef HAVE_STRNDUP +#include <string.h> +char *strndup(const char *source, size_t len); +#endif + int SetVariable(const char *name, RESULT * value); int SetVariableNumeric(const char *name, const double value); int SetVariableString(const char *name, const char *value); @@ -0,0 +1,302 @@ +/* $Id: event.c 1040 2009-09-23 04:14:17Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/event.c $ + * + * generic timer handling + * + * Copyright (C) 2009 Ed Martin <edman007@edman007.com> + * Copyright (C) 2004, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int event_add(void (*callback) (void *data), void *data, const int fd, const int read, const int write); + * Adds a file description to watch + * + * int event_del(const int fd); + * Remove an event + * + * int event_modify(const int fd, const int read, const int write, const int active); + * Modify an event + * + * int named_event_add(char *event, void (*callback) (void *data), void *data); + * Add an event identified by a string + * + * int named_event_del(char *event, void (*callback) (void *data), void *data); + * delete the event identified by this string/callback/data + * + * int named_event_trigger(char *event); //call all calbacks for this event + * call the callbacks of all events that have identified as this string + * + * int event_process(const struct timespec *delay); + * process the event list + * + * void event_exit(); + * releases all events + * + */ + + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + + + +#include <poll.h> + +#include "debug.h" +#include "cfg.h" +#include "event.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +typedef struct { + void (*callback) (event_flags_t flags, void *data); + void *data; + int fd; + int read; + int write; + int active; + int fds_id; +} event_t; + + +//our set of FDs +static event_t *events = NULL; +static int event_count = 0; +static void free_events(void); + +int event_add(void (*callback) (event_flags_t flags, void *data), void *data, const int fd, const int read, + const int write, const int active) +{ + event_count++; + events = realloc(events, sizeof(event_t) * event_count); + + int i = event_count - 1; + events[i].callback = callback; + events[i].data = data; + events[i].fd = fd; + events[i].read = read; + events[i].write = write; + events[i].active = active; + events[i].fds_id = -1; + return 0; +} + + +int event_process(const struct timespec *timeout) +{ + int i, j; + struct pollfd *fds = malloc(sizeof(struct pollfd) * event_count); + for (i = 0, j = 0; i < event_count; i++) { + events[i].fds_id = -1; + if (events[i].active) { + events[i].fds_id = j; + fds[j].events = 0; + fds[j].fd = events[i].fd; + if (events[i].read) { + fds[j].events |= POLLIN; + } + if (events[i].write) { + fds[j].events |= POLLOUT; + } + j++; + } + } +#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4) + int ready = ppoll(fds, j, timeout, NULL); +#else + int ready = poll(fds, j, timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000); +#endif + + if (ready > 0) { + //search the file descriptors, call all relavant callbacks + for (i = 0, j = 0; i < event_count; i++) { + if (events[i].fds_id != j) { + continue; + } + if (fds[j].revents) { + int flags = 0; + if (fds[j].revents & POLLIN) { + flags |= EVENT_READ; + } + if (fds[j].revents & POLLOUT) { + flags |= EVENT_WRITE; + } + if (fds[j].revents & POLLHUP) { + flags |= EVENT_HUP; + } + if (fds[j].revents & POLLERR) { + flags |= EVENT_ERR; + } + events[i].callback(flags, events[i].data); + + } + j++; + } + } + free(fds); + return 0; + +} + +int event_del(const int fd) +{ + int i; + for (i = 0; i < event_count; i++) { + if (events[i].fd == fd) { + events[i] = events[event_count - 1]; + break; + } + } + event_count--; + events = realloc(events, sizeof(event_t) * event_count); + return 0; +} + +int event_modify(const int fd, const int read, const int write, const int active) +{ + int i; + for (i = 0; i < event_count; i++) { + if (events[i].fd == fd) { + events[i].read = read; + events[i].write = write; + events[i].active = active; + break; + } + } + event_count--; + events = realloc(events, sizeof(event_t) * event_count); + return 0; +} + +static void free_events(void) +{ + if (events != NULL) { + free(events); + } + event_count = 0; + events = NULL; + +} + +void event_exit(void) +{ + free_events(); +} + +/* + * Named events are the user facing side of the event subsystem + * + */ + + +//we rely on "=" working for copying these structs (no pointers except the callers) +typedef struct { + void (*callback) (void *data); + void *data; +} event_callback_t; + +typedef struct { + char *name; + event_callback_t *c; + int callback_count; +} named_event_list_t; + + +static named_event_list_t *ev_names = NULL; +static int ev_count = 0; + +int named_event_add(char *event, void (*callback) (void *data), void *data) +{ + if (event == NULL || strlen(event) == 0) { + return 1; + } + if (callback == NULL) { + return 2; + } + int i; + for (i = 0; i < ev_count; i++) { + if (0 == strcmp(event, ev_names[i].name)) { + break; + } + } + if (i >= ev_count) { + //create the entry + ev_count++; + ev_names = realloc(ev_names, sizeof(named_event_list_t) * ev_count); + ev_names[i].name = strdup(event); + ev_names[i].callback_count = 0; + ev_names[i].c = NULL; + } + int j = ev_names[i].callback_count; + ev_names[i].callback_count++; + ev_names[i].c = realloc(ev_names[i].c, sizeof(event_callback_t) * ev_names[i].callback_count); + + ev_names[i].c[j].callback = callback; + ev_names[i].c[j].data = data; + return 0; +} + +int named_event_del(char *event, void (*callback) (void *data), void *data) +{ + int i, j; + for (i = 0; i < ev_count; i++) { + if (0 == strcmp(event, ev_names[i].name)) { + break; + } + } + if (i >= ev_count) { + return 1; //nothing removed + } + for (j = 0; j < ev_names[i].callback_count; j++) { + if (ev_names[i].c[j].callback == callback && ev_names[i].c[j].data == data) { + ev_names[i].callback_count--; + ev_names[i].c[j] = ev_names[i].c[ev_names[i].callback_count]; + ev_names[i].c = realloc(ev_names[i].c, sizeof(event_callback_t) * ev_names[i].callback_count); + if (ev_names[i].callback_count == 0) { + //drop this event + free(ev_names[i].name); + ev_count--; + ev_names[i] = ev_names[ev_count]; + ev_names = realloc(ev_names, sizeof(named_event_list_t) * ev_count); + } + return 0; + } + } + return 2; +} + +int named_event_trigger(char *event) +{ + int i, j; + for (i = 0; i < ev_count; i++) { + if (0 == strcmp(event, ev_names[i].name)) { + for (j = 0; j < ev_names[i].callback_count; j++) { + ev_names[i].c[j].callback(ev_names[i].c[j].data); + } + return 0; + } + } + return 1; +} @@ -0,0 +1,68 @@ +/* $Id: event.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/event.h $ + * + * generic timer handling + * + * Copyright (C) 2009 Ed Martin <edman007@edman007.com> + * Copyright (C) 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +#ifndef _EVENT_H_ +#define _EVENT_H_ + +#include <time.h> + +//events are identified by their file descriptor only + +/* + * these functions allow plugins to add event hooks + * (and thus break out of the main loop when sleeping) + * these callbacks than then trigger named events to propagate + * the event to the screen + */ + +typedef enum { + EVENT_READ = 1, + EVENT_WRITE = 2, + EVENT_HUP = 4, + EVENT_ERR = 8 +} event_flags_t; + + +int event_add(void (*callback) (event_flags_t flags, void *data), void *data, const int fd, const int read, + const int write, const int active); +int event_del(const int fd); +int event_modify(const int fd, const int read, const int write, const int active); +int event_process(const struct timespec *timeout); +void event_exit(void); + +/* + * These fuctions keep a list of the events to trigger on allowing multiple + * things to trigger an event and multiple things to receive the event + */ + +//add an event to be triggered +int named_event_add(char *event, void (*callback) (void *data), void *data); +//remove an event from the list of events +int named_event_del(char *event, void (*callback) (void *data), void *data); +int named_event_trigger(char *event); //call all calbacks for this event + +#endif @@ -1,9 +1,9 @@ -/* $Id: font_6x8.h 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/font_6x8.h $ +/* $Id: font_6x8.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/font_6x8.h $ * * 6x8 font * - * Copyright (C) 1999, 2000, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/font_6x8_bold.h b/font_6x8_bold.h index 85e6e65..83449a3 100644 --- a/font_6x8_bold.h +++ b/font_6x8_bold.h @@ -1,5 +1,5 @@ -/* $Id: font_6x8_bold.h 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/font_6x8_bold.h $ +/* $Id: font_6x8_bold.h 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/font_6x8_bold.h $ * * 6x8 bold font * diff --git a/glcd2usb.h b/glcd2usb.h new file mode 100644 index 0000000..9ee8813 --- /dev/null +++ b/glcd2usb.h @@ -0,0 +1,34 @@ +/* + * glcd2usb.h - glcd2usb interface definitions + */ + +#ifndef GLCD2USB_H +#define GLCD2USB_H + +#define FLAG_SIX_BIT (1<<0) +#define FLAG_VERTICAL_UNITS (1<<1) +#define FLAG_BOTTOM_START (1<<2) +#define FLAG_VERTICAL_INC (1<<3) +#define FLAG_BACKLIGHT (1<<4) + +#define GLCD2USB_RID_GET_INFO 1 /* get display info */ +#define GLCD2USB_RID_SET_ALLOC 2 /* allocate/free display */ +#define GLCD2USB_RID_GET_BUTTONS 3 /* get state of the four buttons */ +#define GLCD2USB_RID_SET_BL 4 /* set backlight brightness */ +#define GLCD2USB_RID_GET_IR 5 /* get last ir message */ +#define GLCD2USB_RID_WRITE 8 /* write some bitmap data to the display */ +#define GLCD2USB_RID_WRITE_4 (GLCD2USB_RID_WRITE+0) +#define GLCD2USB_RID_WRITE_8 (GLCD2USB_RID_WRITE+1) +#define GLCD2USB_RID_WRITE_16 (GLCD2USB_RID_WRITE+2) +#define GLCD2USB_RID_WRITE_32 (GLCD2USB_RID_WRITE+3) +#define GLCD2USB_RID_WRITE_64 (GLCD2USB_RID_WRITE+4) +#define GLCD2USB_RID_WRITE_128 (GLCD2USB_RID_WRITE+5) + +typedef struct { + unsigned char report_id; + char name[32]; + unsigned short width, height; + unsigned char flags; +} __attribute__ ((packed)) display_info_t; + +#endif // GLCD2USB_H @@ -1,9 +1,9 @@ -/* $Id: hash.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/hash.c $ +/* $Id: hash.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/hash.c $ * * hashes (associative arrays) * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: hash.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/hash.h $ +/* $Id: hash.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/hash.h $ * * hashes (associative arrays) * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/indent.sh b/indent.sh new file mode 100755 index 0000000..012434e --- /dev/null +++ b/indent.sh @@ -0,0 +1,20 @@ +#! /bin/bash + +# $Id: indent.sh 1136 2010-11-28 16:07:16Z mzuther $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/indent.sh $ + + +# -kr Use Kernighan & Ritchie coding style. +# -l120 Set maximum line length for non-comment lines to 150. +# -npro Do not read ‘.indent.pro’ files. + +rm *.c~ *.h~ 2>/dev/null # trash "no such file or directory" warning messages +indent -kr -l120 -npro *.c *.h + +for i in *.c *.h; do + if !(diff -q $i $i~); then + rm $i~ + else + mv $i~ $i + fi +done @@ -1,251 +1,519 @@ #!/bin/sh -# # install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# Copyright 1991 by the Massachusetts Institute of Technology +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. # -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. +# +# FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. +nl=' +' +IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec else - true + doit_exec=$doit fi -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. +posix_mkdir= - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi +# Desired mode of installed file. +mode=0755 -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi +src= +dst= +dir_arg= +dst_arg= -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` +copy_on_change=false +no_target_directory= -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" +Options: + --help display this help and exit. + --version display version info and exit. -pathcomp='' + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi +while test $# -ne 0; do + case $1 in + -c) ;; - pathcomp="${pathcomp}/" -done -fi + -C) copy_on_change=true;; -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && + -d) dir_arg=true;; - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else + -g) chgrpcmd="$chgrpprog $2" + shift;; -# If we're going to rename the final executable, determine the name now. + --help) echo "$usage"; exit $?;; - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -# don't allow the sed command to completely eliminate the filename + -o) chowncmd="$chownprog $2" + shift;; - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi + -s) stripcmd=$stripprog;; -# Make a temp file name in the proper directory. + -t) dst_arg=$2 + shift;; - dsttmp=$dstdir/#inst.$$# + -T) no_target_directory=true;; -# Move or copy the file name to the temp name + --version) echo "$0 $scriptversion"; exit $?;; - $doit $instcmd $src $dsttmp && + --) shift + break;; - trap "rm -f ${dsttmp}" 0 && + -*) echo "$0: invalid option: $1" >&2 + exit 1;; -# and set any options; do chmod last to preserve setuid bits + *) break;; + esac + shift +done -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi -# Now rename the file to the real destination. +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac -fi && + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done -exit 0 +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: @@ -1,9 +1,9 @@ -/* $Id: layout.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/layout.c $ +/* $Id: layout.c 1057 2009-11-17 01:47:43Z edman007 $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/layout.c $ * * new layouter framework * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -49,6 +49,56 @@ #endif +/* rename old-style widgets without layer */ +static int layout_migrate(const char *section) +{ + char *list, *old, *new; + int row, col; + + /* get a list of all keys in this section */ + list = cfg_list(section); + + /* map to lower char for scanf() */ + for (old = list; *old != '\0'; old++) + *old = tolower(*old); + + old = list; + while (old != NULL) { + + char *p; + int i, n; + + /* list is delimited by | */ + while (*old == '|') + old++; + if ((p = strchr(old, '|')) != NULL) + *p = '\0'; + + /* row/col widgets w/o layer */ + i = sscanf(old, "row%d.col%d%n", &row, &col, &n); + if (i == 2 && old[n] == '\0') { + + /* prepare new key */ + /* strlen("Layer:1.")=8 */ + new = malloc(strlen(old) + 9); + strcpy(new, "Layer:1."); + strcat(new, old); + + debug("%s: migrating '%s' to '%s'", section, old, new); + if (cfg_rename(section, old, new) < 0) { + error("WARNING: %s: both keys '%s' and '%s' may not exist!", section, old, new); + } + free(new); + } + + /* next field */ + old = p ? p + 1 : NULL; + } + free(list); + return 0; +} + + int layout_init(const char *layout) { char *section; @@ -64,6 +114,9 @@ int layout_init(const char *layout) strcpy(section, "Layout:"); strcat(section, layout); + /* mirate layout to common format */ + layout_migrate(section); + /* get a list of all keys in this section */ list = cfg_list(section); @@ -111,17 +164,6 @@ int layout_init(const char *layout) } } - /* row/col widgets w/o layer */ - i = sscanf(l, "row%d.col%d%n", &row, &col, &n); - if (i == 2 && l[n] == '\0') { - widget = cfg_get(section, l, NULL); - if (widget != NULL && *widget != '\0') { - /* default is layer 1 if outside layer section */ - widget_add(widget, WIDGET_TYPE_RC, 1, row - 1, col - 1); - } - free(widget); - } - /* GPO widgets */ i = sscanf(l, "gpo%d%n", &num, &n); if (i == 1 && l[n] == '\0') { @@ -1,9 +1,9 @@ -/* $Id: layout.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/layout.h $ +/* $Id: layout.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/layout.h $ * * new layouter framework * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/lcd4linux.c b/lcd4linux.c index 0fc3d15..842f653 100644 --- a/lcd4linux.c +++ b/lcd4linux.c @@ -1,11 +1,10 @@ -/* $Id: lcd4linux.c 783 2007-03-22 06:10:36Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/lcd4linux.c $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/lcd4linux.c $ +/* $Id: lcd4linux.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/lcd4linux.c $ * * LCD4Linux * - * Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at> - * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. * @@ -35,6 +34,8 @@ #include <errno.h> #include <signal.h> #include <time.h> +#include <sys/types.h> /* umask() */ +#include <sys/stat.h> /* umask() */ #include "svn_version.h" #include "cfg.h" @@ -44,10 +45,11 @@ #include "udelay.h" #include "drv.h" #include "timer.h" +#include "timer_group.h" #include "layout.h" #include "plugin.h" #include "thread.h" - +#include "event.h" #include "widget.h" #include "widget_timer.h" @@ -58,7 +60,8 @@ #define PIDFILE "/var/run/lcd4linux.pid" static char *release = "LCD4Linux " VERSION "-" SVN_VERSION; -static char *copyright = "Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>"; +static char *copyright = + "Copyright (C) 2005, 2006, 2007, 2008, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>"; static char **my_argv; extern char *output; @@ -69,10 +72,34 @@ static void usage(void) { printf("%s\n", release); printf("%s\n", copyright); - printf("usage: lcd4linux [-h]\n"); - printf(" lcd4linux [-l]\n"); - printf(" lcd4linux [-c key=value] [-i] [-f config-file] [-v] [-p pid-file]\n"); - printf(" lcd4linux [-c key=value] [-F] [-f config-file] [-o output-file] [-q] [-v]\n"); + printf("\n"); + printf("usage:\n"); + printf(" lcd4linux [-h]\n"); + printf(" lcd4linux [-l]\n"); + printf(" lcd4linux [-c key=value] [-i] [-f config-file] [-v] [-p pid-file]\n"); + printf(" lcd4linux [-c key=value] [-F] [-f config-file] [-o output-file] [-q] [-v]\n"); + printf("\n"); + printf("options:\n"); + printf(" -h help\n"); + printf(" -l list available display drivers and plugins\n"); + printf(" -c <key>=<value> overwrite entries from the config-file\n"); + printf(" -i enter interactive mode (after display initialisation)\n"); + printf(" -ii enter interactive mode (before display initialisation)\n"); + printf(" -f <config-file> use configuration from <config-file> instead of /etc/lcd4linux.conf\n"); + printf(" -v generate info messages\n"); + printf(" -vv generate debugging messages\n"); + printf(" -p <pid-file> specify a different pid-file location (default is /var/run/lcd4linux.pid)\n"); + printf(" -F do not fork and detach (run in foreground)\n"); + printf(" -o <output-file> write picture to file (raster driver only)\n"); + printf(" -q suppress startup and exit splash screen\n"); +#ifdef WITH_X11 + printf("special X11 options:\n"); + printf(" -display <X11 display name> preceeds X connection given in $DISPLAY\n"); + printf(" -synchronous use synchronized communication with X server (for debugging)\n"); + printf("\n"); + printf("\n"); + printf("\n"); +#endif } static void interactive_mode(void) @@ -187,6 +214,7 @@ int main(int argc, char *argv[]) int c; int quiet = 0; int interactive = 0; + int list_mode = 0; int pid; /* save arguments for restart */ @@ -203,6 +231,13 @@ int main(int argc, char *argv[]) running_foreground = 0; running_background = 0; +#ifdef WITH_X11 + drv_X11_parseArgs(&argc, argv); + if (argc != thread_argc) { + /* info() will not work here because verbose level is not known */ + printf("recognized special X11 parameters\n"); + } +#endif while ((c = getopt(argc, argv, "c:Ff:hilo:qvp:")) != EOF) { switch (c) { @@ -225,10 +260,8 @@ int main(int argc, char *argv[]) interactive++; break; case 'l': - printf("%s\n", release); - printf("%s\n", copyright); - drv_list(); - exit(0); + list_mode++; + break; case 'o': output = optarg; break; @@ -256,16 +289,31 @@ int main(int argc, char *argv[]) running_foreground = 1; } - info("Version " VERSION "-" SVN_VERSION " starting"); + if (list_mode > 0) { + printf("%s\n", release); + printf("%s\n", copyright); + printf("\n"); + drv_list(); + printf("\n"); + plugin_list(); + printf("\n"); + exit(0); + } + + info("%s starting", release); if (!running_foreground && (my_argv[0] == NULL || my_argv[0][0] != '/')) { info("invoked without full path; restart may not work!"); } - if (cfg_init(cfg) == -1) + if (cfg_init(cfg) == -1) { + error("Error reading configuration. Exit!"); exit(1); + } - if (plugin_init() == -1) + if (plugin_init() == -1) { + error("Error initializing plugins. Exit!"); exit(1); + } display = cfg_get(NULL, "Display", NULL); if (display == NULL || *display == '\0') { @@ -316,6 +364,7 @@ int main(int argc, char *argv[]) debug("initializing driver %s", driver); if (drv_init(section, driver, quiet) == -1) { + error("Error initializing driver %s: Exit!", driver); pid_exit(pidfile); exit(1); } @@ -356,7 +405,7 @@ int main(int argc, char *argv[]) struct timespec delay; if (timer_process(&delay) < 0) break; - nanosleep(&delay, NULL); + event_process(&delay); } debug("leaving main loop"); @@ -365,6 +414,7 @@ int main(int argc, char *argv[]) pid_exit(pidfile); cfg_exit(); plugin_exit(); + timer_exit_group(); timer_exit(); if (got_signal == SIGHUP) { diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample index c485b39..cf90750 100644 --- a/lcd4linux.conf.sample +++ b/lcd4linux.conf.sample @@ -1,5 +1,5 @@ -# $Id: lcd4linux.conf.sample 759 2007-02-04 05:55:58Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/lcd4linux.conf.sample $ +# $Id: lcd4linux.conf.sample 1133 2010-11-19 09:02:34Z harbaum $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/lcd4linux.conf.sample $ Variables { @@ -41,6 +41,13 @@ Display LCD-Linux { UseBusy 0 } +Display IRLCD { + Driver 'IRLCD' + Size '16x2' + Backlight 0 + Icons 1 +} + Display LCD2USB { Driver 'LCD2USB' Size '20x2' @@ -48,6 +55,17 @@ Display LCD2USB { Icons 1 } +Display GLCD2USB { + Driver 'GLCD2USB' + Brightness 255 +} + +Display ABP08-16x3 { + Driver 'LW_ABP' + Port '/dev/tts/0' + Speed 19200 + Size '16x3' +} Display LCD2041 { Driver 'MatrixOrbital' @@ -254,6 +272,13 @@ Display picoLCD { Icons 1 } +Display picoLCDGraphic { + Driver 'picoLCDGraphic' + Size '256x64' + Contrast 0 + Backlight 100 +} + Display SC1602D { Driver 'HD44780' Port '/dev/parports/0' @@ -303,7 +328,7 @@ Display HD44780-I2C { Display LCDTerm { - Driver 'LCDTerm + Driver 'LCDTerm' Port '/dev/tts/0' Speed 19200 Size '20x4' @@ -318,6 +343,15 @@ Display SimpleLCD { Size '20x2' } +Display PHAnderson { + Driver 'PHAnderson' + Port '/dev/tts/0' + Speed 19200 + Size '24x2' + Blackligth 100 + Bootscreen '123456789012345678901234ABCDEFGHIJKLMNOPQRSTUVWX' +} + Display BA63 { Driver 'WincorNixdorf' Model 'BA63' @@ -356,6 +390,13 @@ Display CT20x4 { } +Display ULA200 { + Driver 'ULA200' + Size '20x4' + Icons 0 + Backlight 1 +} + Display USBLCD { Driver 'USBLCD' # Port '/dev/lcd0' @@ -440,6 +481,12 @@ Display ctinclud { Inverted 0 } +Display ASTUSB { + Driver 'ASTUSB' + Size '20x4' + Backlight 1 +} + Display XWindow { Driver 'X11' Size '120x32' @@ -447,12 +494,11 @@ Display XWindow { Pixel '4+1' Gap '-1x-1' Border 20 -# Foreground '#000000' -# Background '#80d000' -# Halfground '#70c000' - Foreground '000000cc' - Background '00000022' - Basecolor '80d000' + Buttons 2 + Foreground '000000cc' + Background '00000022' + Basecolor '80d000' + Bordercolor '90e000' } Display Image { @@ -472,6 +518,26 @@ Display Image { Basecolor '80d000' } +Display VNC { + Driver 'VNC' + Font '6x8' + Port '5900' + Xres '320' + Yres '140' + Bpp '4' + Maxclients '2' + Buttons '4' + Keypadxofs '40' + Keypadyofs '70' + Keypadygap '10' + Keypadcol '8745877' + Osd_showtime '2000' +# Password 'password' + Maxfps '25' +# HttpDir '/path/to/classfiles' + HttpPort '5800' +} + #Plugin KVV { # StationID '12_701' # Refresh 30 @@ -500,6 +566,31 @@ Plugin Pop3 { } +Plugin DBus { + # signal 0 is displayed IM msg + # + signal0sender 'im.pidgin.purple.PurpleService' # should be in the form com.domain.app.service, + # the :1.23 form given by dbus-monitor will NOT work, + # if unsure skip it + signal0path '/im/pidgin/purple/PurpleObject' # find using dbus-monitor + signal0interface 'im.pidgin.purple.PurpleInterface' # find using dbus-monitor + signal0member 'DisplayedImMsg' # find using dbus-monitor + signal0eventname 'got_im' # make something up, all Text widgets with an + # event option matching this will be updated +} + + +#this example prints the second argument of signal# 0 +#(in this case it prints the message displayed) +Widget Pidgin { + class 'Text' + expression dbus::argument(0, 1) . ': ' . dbus::argument(0, 2)) + width 20 + align 'R' + event 'got_im' +} + + Widget OS { class 'Text' expression '*** '.uname('sysname').' '.uname('release').' ***' @@ -688,6 +779,16 @@ Widget Uptime { update 1000 } +Widget mpris_TrackPosition_bar { + class 'Bar' + expression mpris_dbus::method_PositionGet('org.kde.amarok') + length 40 + min 0 + max 100 + direction 'E' + style 'H' + update 200 +} # debugging widgets @@ -1199,6 +1300,7 @@ Layout Debug { #Display 'T6963-240x128' #Display 'T6963-240x128D' #Display 'XWindow' +#Display 'IRLCD' #Display 'USBLCD' #Display 'BWCT' #Display 'Image' @@ -1207,15 +1309,17 @@ Layout Debug { #Display 'LPH7508-serdisplib' #Display 'LPH7508' #Display 'ctinclud' -Display 'picoLCD' +#Display 'picoLCD' +#Display 'VNC' +Display 'GLCD2USB' #Layout 'Default' -#Layout 'TestLayer' +Layout 'TestLayer' #Layout 'TestImage' #Layout 'L8x2' #Layout 'L16x1' #Layout 'L16x2' -Layout 'L20x2' +#Layout 'L20x2' #Layout 'L40x2' #Layout 'Test' #Layout 'Test2' diff --git a/lcd4linux.lsm b/lcd4linux.lsm index 0f6cb6f..22fc5b3 100644 --- a/lcd4linux.lsm +++ b/lcd4linux.lsm @@ -5,8 +5,8 @@ Entered-date: 2000-03-28 Description: system and ISDN information is shown on an external display or in a X11 window. Keywords: LCD -Author: reinelt@eunet.at (Michael Reinelt) -Maintained-by: reinelt@eunet.at (Michael Reinelt) +Author: michael@reinelt.co.at (Michael Reinelt) +Maintained-by: michael@reinelt.co.at (Michael Reinelt) Primary-site: download.sourceforge.net /pub/sourceforge/lcd4linux 54k lcd4linux-0.95.tar.gz Alternate-site: http://lcd4linux.sourceforge.net diff --git a/lcd4linux.xpm b/lcd4linux.xpm index 1523ca7..7db7f02 100644 --- a/lcd4linux.xpm +++ b/lcd4linux.xpm @@ -1,7 +1,7 @@ /* XPM */ /* - * Copyright 1999 Michael Reinelt <reinelt@eunet.at> + * Copyright 1999 Michael Reinelt <michael@reinelt.co.at> * Copyright 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/lcd4linux_i2c.h b/lcd4linux_i2c.h index d4f6a83..14c4508 100644 --- a/lcd4linux_i2c.h +++ b/lcd4linux_i2c.h @@ -1,5 +1,5 @@ /* $Id: lcd4linux_i2c.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/lcd4linux_i2c.h $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/lcd4linux_i2c.h $ * * user space i2c sturctures and defines, taken from the official kernel i2c * includes to solve the problem when compiling user space application @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-06-08.21 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. @@ -33,6 +33,8 @@ if test $# -eq 0; then fi run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -44,7 +46,7 @@ fi msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -106,7 +109,7 @@ esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case "$1" in +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg. You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then touch $file else test -z "$file" || exec >$file @@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff --git a/mkinstalldirs b/mkinstalldirs index c7dde14..ef7e16f 100755 --- a/mkinstalldirs +++ b/mkinstalldirs @@ -1,41 +1,161 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain -# $Id: mkinstalldirs 731 2007-01-14 13:51:41Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/mkinstalldirs $ +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. +nl=' +' +IFS=" "" $nl" errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to <bug-automake@gnu.org>." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" + mkdir "$pathcomp" || lasterr=$? - mkdir "$pathcomp" || lasterr=$? + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi - pathcomp="$pathcomp/" - done + pathcomp=$pathcomp/ + done done exit $errstatus -# mkinstalldirs ends here +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +use strict; +use vars qw ($file $DELAY); +########## CONFIG + $file = "lcd4linux"; # .png is appended + $DELAY = 0; # delay in seconds + # if delay is zero, file is sent when modified. +################# + +use CGI qw/:push -nph/; +$| = 1; +my ($mtime, $nmtime, $size, $nsize); +(undef, undef, undef, undef, undef, undef, undef, $size, undef, + $mtime) = stat "$file.png"; +print multipart_init(-boundary=>'----------------here we go!'); +while (1) { + print multipart_start(-type=>'image/png'); + undef $/; + open(IN, "$file.png") or die("Can't read '$file.png'"); + $_ = <IN>; + print $_; + close(IN); + print multipart_end; + if ($DELAY) { + sleep $DELAY; + } + else { + W: while (1) { + # sleep(1); + (undef, undef, undef, undef, undef, undef, undef, $nsize, undef, + $nmtime) = stat "$file.png"; + if($mtime != $nmtime || $size != $nsize) { + $mtime = $nmtime; + $size = $nsize; + last W; + } + } + } +} + @@ -1,9 +1,9 @@ -/* $Id: pid.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/pid.c $ +/* $Id: pid.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/pid.c $ * * PID file handling * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * * This file is part of LCD4Linux. * @@ -1,9 +1,9 @@ -/* $Id: pid.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/pid.h $ +/* $Id: pid.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/pid.h $ * * PID file handling * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: plugin.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin.c $ +/* $Id: plugin.c 1096 2010-01-28 17:19:58Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin.c $ * * plugin handler for the Evaluator * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -36,12 +36,137 @@ #include "config.h" +#include "plugin.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> #include "debug.h" -#include "plugin.h" + + +char *Plugins[] = { + "cfg", + "math", + "string", + "test", + "time", +#ifdef PLUGIN_APM + "apm", +#endif +#ifdef PLUGIN_ASTERISK + "asterisk", +#endif +#ifdef PLUGIN_BUTTON_EXEC + "button_exec", +#endif +#ifdef PLUGIN_CPUINFO + "cpuinfo", +#endif +#ifdef PLUGIN_DBUS + "dbus", +#endif +#ifdef PLUGIN_DISKSTATS + "diskstats", +#endif +#ifdef PLUGIN_DVB + "dvb", +#endif +#ifdef PLUGIN_EXEC + "exec", +#endif +#ifdef PLUGIN_EVENT + "event", +#endif +#ifdef PLUGIN_FIFO + "fifo", +#endif +#ifdef PLUGIN_FILE + "file", +#endif +#ifdef PLUGIN_GPS + "gps", +#endif +#ifdef PLUGIN_HDDTEMP + "hddtemp", +#endif +#ifdef PLUGIN_HUAWEI + "huawei", +#endif +#ifdef PLUGIN_I2C_SENSORS + "i2c_sensors", +#endif +#ifdef PLUGIN_ICONV + "iconv", +#endif +#ifdef PLUGIN_IMON + "imon", +#endif +#ifdef PLUGIN_ISDN + "isdn", +#endif +#ifdef PLUGIN_KVV + "kvv", +#endif +#ifdef PLUGIN_LOADAVG + "loadavg", +#endif +#ifdef PLUGIN_MEMINFO + "meminfo", +#endif +#ifdef PLUGIN_MPD + "mpd", +#endif +#ifdef PLUGIN_MPRIS_DBUS + "mpris_dbus", +#endif +#ifdef PLUGIN_MYSQL + "mysql", +#endif +#ifdef PLUGIN_NETDEV + "netdev", +#endif +#ifdef PLUGIN_NETINFO + "netinfo", +#endif +#ifdef PLUGIN_POP3 + "pop3", +#endif +#ifdef PLUGIN_PPP + "ppp", +#endif +#ifdef PLUGIN_PROC_STAT + "proc_stat", +#endif +#ifdef PLUGIN_PYTHON + "python", +#endif +#ifdef PLUGIN_SAMPLE + "sample", +#endif +#ifdef PLUGIN_SETI + "seti", +#endif +#ifdef PLUGIN_STATFS + "statfs", +#endif +#ifdef PLUGIN_UNAME + "uname", +#endif +#ifdef PLUGIN_UPTIME + "uptime", +#endif +#ifdef PLUGIN_W1RETAP + "w1retap", +#endif +#ifdef PLUGIN_WIRELESS + "wireless", +#endif +#ifdef PLUGIN_XMMS + "xmms", +#endif + NULL, +}; /* Prototypes */ @@ -58,16 +183,32 @@ void plugin_exit_time(void); int plugin_init_apm(void); void plugin_exit_apm(void); +int plugin_init_asterisk(void); +void plugin_exit_asterisk(void); +int plugin_init_button_exec(void); +void plugin_exit_button_exec(void); int plugin_init_cpuinfo(void); void plugin_exit_cpuinfo(void); +int plugin_init_dbus(void); +void plugin_exit_dbus(void); int plugin_init_diskstats(void); void plugin_exit_diskstats(void); int plugin_init_dvb(void); void plugin_exit_dvb(void); int plugin_init_exec(void); void plugin_exit_exec(void); +int plugin_init_event(void); +void plugin_exit_event(void); +int plugin_init_fifo(void); +void plugin_exit_fifo(void); int plugin_init_file(void); void plugin_exit_file(void); +int plugin_init_gps(void); +void plugin_exit_gps(void); +int plugin_init_hddtemp(void); +void plugin_exit_hddtemp(void); +int plugin_init_huawei(void); +void plugin_exit_huawei(void); int plugin_init_i2c_sensors(void); void plugin_exit_i2c_sensors(void); int plugin_init_imon(void); @@ -84,10 +225,14 @@ int plugin_init_meminfo(void); void plugin_exit_meminfo(void); int plugin_init_mpd(void); void plugin_exit_mpd(void); +int plugin_init_mpris_dbus(void); +void plugin_exit_mpris_dbus(void); int plugin_init_mysql(void); void plugin_exit_mysql(void); int plugin_init_netdev(void); void plugin_exit_netdev(void); +int plugin_init_netinfo(void); +void plugin_exit_netinfo(void); int plugin_init_pop3(void); void plugin_exit_pop3(void); int plugin_init_ppp(void); @@ -106,12 +251,30 @@ int plugin_init_uname(void); void plugin_exit_uname(void); int plugin_init_uptime(void); void plugin_exit_uptime(void); +int plugin_init_w1retap(void); +void plugin_exit_w1retap(void); int plugin_init_wireless(void); void plugin_exit_wireless(void); int plugin_init_xmms(void); void plugin_exit_xmms(void); +int plugin_list(void) +{ + int i; + + printf("available plugins:\n "); + + for (i = 0; Plugins[i]; i++) { + printf("%s", Plugins[i]); + if (Plugins[i + 1]) + printf(", "); + } + printf("\n"); + return 0; +} + + int plugin_init(void) { plugin_init_cfg(); @@ -123,9 +286,18 @@ int plugin_init(void) #ifdef PLUGIN_APM plugin_init_apm(); #endif +#ifdef PLUGIN_ASTERISK + plugin_init_asterisk(); +#endif +#ifdef PLUGIN_BUTTON_EXEC + plugin_init_button_exec(); +#endif #ifdef PLUGIN_CPUINFO plugin_init_cpuinfo(); #endif +#ifdef PLUGIN_DBUS + plugin_init_dbus(); +#endif #ifdef PLUGIN_DISKSTATS plugin_init_diskstats(); #endif @@ -135,9 +307,24 @@ int plugin_init(void) #ifdef PLUGIN_EXEC plugin_init_exec(); #endif +#ifdef PLUGIN_EVENT + plugin_init_event(); +#endif +#ifdef PLUGIN_FIFO + plugin_init_fifo(); +#endif #ifdef PLUGIN_FILE plugin_init_file(); #endif +#ifdef PLUGIN_GPS + plugin_init_gps(); +#endif +#ifdef PLUGIN_HDDTEMP + plugin_init_hddtemp(); +#endif +#ifdef PLUGIN_HUAWEI + plugin_init_huawei(); +#endif #ifdef PLUGIN_I2C_SENSORS plugin_init_i2c_sensors(); #endif @@ -162,13 +349,18 @@ int plugin_init(void) #ifdef PLUGIN_MPD plugin_init_mpd(); #endif - +#ifdef PLUGIN_MPRIS_DBUS + plugin_init_mpris_dbus(); +#endif #ifdef PLUGIN_MYSQL plugin_init_mysql(); #endif #ifdef PLUGIN_NETDEV plugin_init_netdev(); #endif +#ifdef PLUGIN_NETINFO + plugin_init_netinfo(); +#endif #ifdef PLUGIN_POP3 plugin_init_pop3(); #endif @@ -196,6 +388,9 @@ int plugin_init(void) #ifdef PLUGIN_UPTIME plugin_init_uptime(); #endif +#ifdef PLUGIN_W1RETAP + plugin_init_w1retap(); +#endif #ifdef PLUGIN_WIRELESS plugin_init_wireless(); #endif @@ -212,9 +407,18 @@ void plugin_exit(void) #ifdef PLUGIN_APM plugin_exit_apm(); #endif +#ifdef PLUGIN_ASTERISK + plugin_exit_asterisk(); +#endif +#ifdef PLUGIN_BUTTON_EXEC + plugin_exit_button_exec(); +#endif #ifdef PLUGIN_CPUINFO plugin_exit_cpuinfo(); #endif +#ifdef PLUGIN_DBUS + plugin_exit_dbus(); +#endif #ifdef PLUGIN_DISKSTATS plugin_exit_diskstats(); #endif @@ -224,9 +428,21 @@ void plugin_exit(void) #ifdef PLUGIN_EXEC plugin_exit_exec(); #endif +#ifdef PLUGIN_EVENT + plugin_exit_event(); +#endif +#ifdef PLUGIN_FIFO + plugin_exit_fifo(); +#endif #ifdef PLUGIN_FILE plugin_exit_file(); #endif +#ifdef PLUGIN_GPS + plugin_exit_gps(); +#endif +#ifdef PLUGIN_HUAWEI + plugin_exit_huawei(); +#endif #ifdef PLUGIN_I2C_SENSORS plugin_exit_i2c_sensors(); #endif @@ -251,12 +467,18 @@ void plugin_exit(void) #ifdef PLUGIN_MPD plugin_exit_mpd(); #endif +#ifdef PLUGIN_MPRIS_DBUS + plugin_exit_mpris_dbus(); +#endif #ifdef PLUGIN_MYSQL plugin_exit_mysql(); #endif #ifdef PLUGIN_NETDEV plugin_exit_netdev(); #endif +#ifdef PLUGIN_NETINFO + plugin_exit_netinfo(); +#endif #ifdef PLUGIN_POP3 plugin_exit_pop3(); #endif @@ -284,6 +506,9 @@ void plugin_exit(void) #ifdef PLUGIN_UPTIME plugin_exit_uptime(); #endif +#ifdef PLUGIN_W1RETAP + plugin_exit_w1retap(); +#endif #ifdef PLUGIN_WIRELESS plugin_exit_wireless(); #endif @@ -1,9 +1,9 @@ -/* $Id: plugin.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin.h $ +/* $Id: plugin.h 1087 2010-01-19 22:59:24Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin.h $ * * plugin handler for the Evaluator * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -24,12 +24,13 @@ * */ - +#include "config.h" #include "evaluator.h" #ifndef _PLUGIN_H_ #define _PLUGIN_H_ +int plugin_list(void); int plugin_init(void); void plugin_exit(void); #endif diff --git a/plugin_apm.c b/plugin_apm.c index e7fcd83..0ae7c70 100644 --- a/plugin_apm.c +++ b/plugin_apm.c @@ -1,9 +1,9 @@ -/* $Id: plugin_apm.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_apm.c $ +/* $Id: plugin_apm.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_apm.c $ * * plugin for APM (battery status) * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old 'battery.c' which is diff --git a/plugin_asterisk.c b/plugin_asterisk.c new file mode 100644 index 0000000..79b03b7 --- /dev/null +++ b/plugin_asterisk.c @@ -0,0 +1,303 @@ +/* $Id: plugin_asterisk.c 1036 2009-07-18 03:10:52Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_asterisk.c $ + * + * plugin for asterisk + * + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_sample (void) + * adds various functions + * + */ + + +/* define the include files you need */ +#include "config.h" +#include <string.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include "debug.h" +#include "plugin.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +struct Line { + char Channel[25]; /* Zap Channel */ + char EndPoint[25]; + unsigned char active; +}; + +static char *rtrim(char *string, char junk) +{ + char *original = string + strlen(string); + while (*--original == junk); + *(original + 1) = '\0'; + + return string; +} + +static void zapstatus(RESULT * result, RESULT * arg1) +{ + FILE *infile; + int skipline = 0; // Skip the first in the file, it throws off the detection + char line[100], *SipLoc, Channel[25], Location[25], State[9], Application[25], EndPoint[8], Ret[50]; + int i = 0, ChannelInt = 0, ZapLine = 0; + struct Line Lines[32]; // Setup 32 lines, ZAP 1-32 (memory is cheap) + + ZapLine = R2N(arg1); + + // Set all the lines status's default to inactive + for (i = 0; i < 32; i++) { + strcpy(Lines[i].Channel, "ZAP/"); + Lines[i].Channel[4] = (char) (i + 49); + Lines[i].Channel[5] = '\0'; + Lines[i].active = 0; + } + + system("touch /tmp/asterisk.state"); // Touch the file in it's naughty place + system("chmod 744 /tmp/asterisk.state"); + system("asterisk -rx \"show channels\" > /tmp/asterisk.state"); // Crappy CLI way to do it + + infile = fopen("/tmp/asterisk.state", "r"); + + for (i = 0; i < 100; i++) { + line[i] = ' '; + } + line[99] = '\0'; + + while (fgets(line, 100, infile) != NULL) { + if (strstr(line, "Zap") != NULL) { + for (i = 0; i < (int) strlen(line); i++) { + if (i < 20) { + Channel[i] = line[i]; + } else if (i < 42) { + Location[i - 21] = line[i]; + } else if (i < 50) { + State[i - 42] = line[i]; + } else { + Application[i - 50] = line[i]; + } + } + strncpy(Channel, Channel, 7); + Channel[7] = '\0'; + strcpy(Location, rtrim(Location, ' ')); + State[4] = '\0'; + memcpy(EndPoint, Application + 13, 7); + EndPoint[7] = '\0'; + + if (strstr(Application, "Bridged Call") != NULL) { + // Subtract 48 from the character value to get the int + // value. Subtract one more because arrays start at 0. + ChannelInt = (int) (Channel[4]) - 49; + strcpy(Lines[ChannelInt].Channel, Channel); + strncpy(Lines[ChannelInt].EndPoint, EndPoint, 8); + Lines[ChannelInt].active = 1; + } else { + SipLoc = strstr(Application, "SIP"); + if (SipLoc != NULL) { + strncpy(EndPoint, SipLoc, 7); + } else { + EndPoint[0] = '\0'; + } + ChannelInt = (int) (Channel[4]) - 49; + strcpy(Lines[ChannelInt].Channel, Channel); + Lines[ChannelInt].active = 1; + } + } else { + if (strlen(line) > 54 && skipline > 1) { + for (i = 55; i < 88; i++) { + if (i < 80) { + Channel[i - 55] = line[i]; + } else { + EndPoint[i - 80] = line[i]; + } + } + strncpy(Channel, rtrim(Channel, ' '), 5); + strncpy(EndPoint, rtrim(EndPoint, ' '), 7); + + ChannelInt = (int) (Channel[4]) - 49; + strcpy(Lines[ChannelInt].Channel, Channel); + strcpy(Lines[ChannelInt].EndPoint, EndPoint); + Lines[ChannelInt].active = 1; + } + } + skipline += 1; + } + fclose(infile); + + ZapLine -= 1; + if (ZapLine < 0 || ZapLine > 31) { + memset(Ret, ' ', 50); + Ret[0] = '\0'; + strcat(Ret, "Invalid ZAP #"); + SetResult(&result, R_STRING, &Ret); + } else if (Lines[ZapLine].active == 1) { + memset(Ret, ' ', 50); + Ret[0] = '\0'; + strcat(Ret, Lines[ZapLine].Channel); + strcat(Ret, " -> "); + strncat(Ret, Lines[ZapLine].EndPoint, 8); + SetResult(&result, R_STRING, &Ret); + } else { + memset(Ret, ' ', 50); + Ret[0] = '\0'; + strcat(Ret, Lines[ZapLine].Channel); + strcat(Ret, ": inactive"); + SetResult(&result, R_STRING, &Ret); + } + return; +} + +static void corecalls(RESULT * result) +{ + FILE *infile; + char line[100]; + int calls; + + system("asterisk -rx 'core show channels' > /tmp/asterisk.calls"); + + infile = fopen("/tmp/asterisk.state", "r"); + line[0] = '\0'; + while (fgets(line, 100, infile) != NULL) { + if (strstr(line, "active calls") != NULL) { + break; + } + } + fclose(infile); + + if (line[0] != '\0') { + sscanf(line, "%d active calls", &calls); + } else { + calls = 0; + } + + SetResult(&result, R_NUMBER, &calls); + return; +} + +int sipinfo(int type) +{ + FILE *infile; + char line[100]; + int peers, online; + + system("asterisk -rx 'sip show peers' > /tmp/asterisk.sip"); + + infile = fopen("/tmp/asterisk.sip", "r"); + line[0] = '\0'; + while (fgets(line, 100, infile) != NULL) { + } // Get the last line + fclose(infile); + + if (line[0] != '\0') { + sscanf(line, "%d sip peers [Monitored: %d online,", &peers, &online); + } else { + peers = 0; + online = 0; + } + + return (type == 1) ? peers : online; +} + +static void sippeers(RESULT * result) +{ + int peers; + peers = sipinfo(1); + SetResult(&result, R_NUMBER, &peers); + return; +} + +static void siponline(RESULT * result) +{ + int online; + online = sipinfo(2); + SetResult(&result, R_NUMBER, &online); + return; +} + +static void uptime(RESULT * result) +{ + FILE *infile; + char line[100], *tok; + int fields[5], toknum = 0, num, s = 0; + + fields[0] = fields[1] = fields[2] = fields[3] = fields[4] = 0; + + system("asterisk -rx 'core show uptime' > /tmp/asterisk.uptime"); + + infile = fopen("/tmp/asterisk.uptime", "r"); + line[0] = '\0'; + while (fgets(line, 100, infile) != NULL) { + if (strstr(line, "System uptime") != NULL) { + break; + } + } + fclose(infile); + + if (line[0] != '\0') { + for (tok = strtok(line, " "); tok != NULL; tok = strtok(NULL, " ")) { + toknum++; + if (toknum == 3 || toknum == 5 || toknum == 7 || toknum == 9 || toknum == 11) { + sscanf(tok, "%d", &num); + } else if (toknum == 4 || toknum == 6 || toknum == 8 || toknum == 10 || toknum == 12) { + if (strstr(tok, "weeks") != NULL || (strstr(tok, "week") != NULL)) { + fields[4] = num; + } else if (strstr(tok, "days") != NULL || (strstr(tok, "day") != NULL)) { + fields[3] = num; + } else if (strstr(tok, "hours") != NULL || (strstr(tok, "hour") != NULL)) { + fields[2] = num; + } else if (strstr(tok, "minutes") != NULL || (strstr(tok, "minute") != NULL)) { + fields[1] = num; + } else { + fields[0] = num; + } + } + } + s = (fields[4] * 604800) + (fields[3] * 86400) + (fields[2] * 3600) + (fields[1] * 60) + fields[0]; + } + + SetResult(&result, R_NUMBER, &s); + return; +} + +int plugin_init_asterisk(void) +{ + AddFunction("asterisk::zapstatus", 1, zapstatus); + AddFunction("asterisk::corecalls", 0, corecalls); + AddFunction("asterisk::sippeers", 0, sippeers); + AddFunction("asterisk::siponline", 0, siponline); + AddFunction("asterisk::uptime", 0, uptime); + return 0; +} + +void plugin_exit_asterisk(void) +{ + /* free any allocated memory */ + /* close filedescriptors */ +} diff --git a/plugin_button_exec.c b/plugin_button_exec.c new file mode 100644 index 0000000..41e5d7e --- /dev/null +++ b/plugin_button_exec.c @@ -0,0 +1,111 @@ +/* $Id: plugin_button_exec.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_button_exec.c $ + * + * plugin that forks and exec's once a key is pressed. the difference to the exec plugin is: this can also only be done once! + * + * Copyright (C) 2008, Wolfgang Henerbichler <wogri@wogri.com> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_button_exec(void) + * adds various functions + * + */ + + +/* define the include files you need */ +#include "config.h" + +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <signal.h> +#include <errno.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + + +/* sample function 'button_exec' */ +/* takes as many arguments as you want, first arguemnt is the command that will be called via exec, all the following are parameters you want to add to your command - you won't know what has happened after forking - no return codes available */ +/* Note: all local functions should be declared 'static' */ + +static void my_button_exec(RESULT * result, int argc, RESULT * argv[]) +{ + int pid; + int i; + int errsv; + char *args[argc + 1]; + char *arg; + char *prog; + + signal(SIGCHLD, SIG_IGN); + prog = R2S(argv[0]); + info(prog); + for (i = 1; i < argc; i++) { + arg = R2S(argv[i]); + args[i] = arg; + info(arg); + } + args[0] = prog; + args[i] = (char *) 0; + pid = fork(); + if (pid == 0) { /* child-process */ + /* char *args[] = {"-r", "-t", "-l", (char *) 0 }; */ + info("executing program"); + execvp(prog, args); + errsv = errno; + info("executing program failed"); + info(strerror(errsv)); + exit(0); + } else if (pid == -1) { + info("weird error has occurred. couldn't fork."); + } else { + SetResult(&result, R_STRING, "0"); + } +} + + +/* plugin initialization */ +/* MUST NOT be declared 'static'! */ +int plugin_init_button_exec(void) +{ + + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("button_exec", -1, my_button_exec); + return 0; +} + +void plugin_exit_button_exec(void) +{ + /* free any allocated memory */ + /* close filedescriptors */ +} diff --git a/plugin_cfg.c b/plugin_cfg.c index a5b7665..66a9636 100644 --- a/plugin_cfg.c +++ b/plugin_cfg.c @@ -1,9 +1,9 @@ -/* $Id: plugin_cfg.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_cfg.c $ +/* $Id: plugin_cfg.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_cfg.c $ * * plugin for config file access * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_cpuinfo.c b/plugin_cpuinfo.c index b3c7cda..76e7233 100644 --- a/plugin_cpuinfo.c +++ b/plugin_cpuinfo.c @@ -1,9 +1,9 @@ -/* $Id: plugin_cpuinfo.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_cpuinfo.c $ +/* $Id: plugin_cpuinfo.c 1079 2010-01-15 21:44:04Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_cpuinfo.c $ * * plugin for /proc/cpuinfo parsing * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -45,11 +45,15 @@ #include "plugin.h" #include "hash.h" +#ifdef __MAC_OS_X_VERSION_10_3 +#include <sys/types.h> +#include <sys/sysctl.h> +#endif static HASH CPUinfo; static FILE *stream = NULL; -static int parse_cpuinfo(void) +static int parse_cpuinfo(char *oid) { int age; @@ -58,6 +62,10 @@ static int parse_cpuinfo(void) if (age > 0 && age <= 1000) return 0; +#ifndef __MAC_OS_X_VERSION_10_3 + + /* Linux Kernel, /proc-filesystem */ + if (stream == NULL) stream = fopen("/proc/cpuinfo", "r"); if (stream == NULL) { @@ -93,6 +101,34 @@ static int parse_cpuinfo(void) hash_put(&CPUinfo, key, val); } + /* to avoid compiler unused warning */ + oid = 0; + +#else + + /* MACH Kernel, MacOS X */ + + char val_ret[256]; + int *val; + size_t val_len; + + if (sysctlbyname(oid, NULL, &val_len, NULL, 0) != 0) { + error("Error %d by sysctl(%s): %s", errno, oid, strerror(errno)); + return -1; + } + if (val_len > sizeof(val_ret)) { + error("Error: Result of sysctl(%s) too big (%zd > %zd)!", oid, val_len, sizeof(val_ret)); + return -1; + } + sysctlbyname(oid, &val_ret, &val_len, NULL, 0); + if (val_len == sizeof(int)) { + /* we got an integer instead of a string */ + val = (int *) val_ret; + snprintf(val_ret, sizeof(val_ret), "%d", *val); + } + hash_put(&CPUinfo, oid, val_ret); +#endif + return 0; } @@ -101,12 +137,12 @@ static void my_cpuinfo(RESULT * result, RESULT * arg1) { char *key, *val; - if (parse_cpuinfo() < 0) { + key = R2S(arg1); + if (parse_cpuinfo(key) < 0) { SetResult(&result, R_STRING, ""); return; } - key = R2S(arg1); val = hash_get(&CPUinfo, key, NULL); if (val == NULL) val = ""; diff --git a/plugin_dbus.c b/plugin_dbus.c new file mode 100644 index 0000000..0647e1c --- /dev/null +++ b/plugin_dbus.c @@ -0,0 +1,857 @@ +/* $Id: plugin_dbus.c -1 $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_dbus.c $ + * + * plugin template + * + * Copyright (C) 2009 Edward Martin <edman007@edman007.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_dbus (void) + * adds various functions + * + */ + + +/* define the include files you need */ +#include "config.h" + +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" +#include "cfg.h" +#include "timer.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +#include "event.h" +#include <dbus/dbus.h> +#include <stdio.h> +#include <assert.h> +/* + * Internal Text Storage (to catch the events) + */ + +//a buffer of the most recent results (store the strings you see on the screen) +typedef struct { + int argc; + char **arguments; +} dbus_signal_t; + +static struct { + int signals; + dbus_signal_t *a; +} dbus_results = { +0, NULL}; + +//free all resources for the text of a signal +static int clear_signal_txt(const int sig); + +//return a pointer to the struct of text for the signal +static dbus_signal_t *get_signal_txt(const int sig); + +//set the struct of text for the signal +static int set_signal_txt(const int sig, const dbus_signal_t * data); + + +/* + * DBus Functions/types + */ + + +//the max that a message may be in characters (if you have a screen that fits more go crazy) +static const int LCD_MAX_MSG_LEN = 255; +#define DBUS_MAX_SIGNALS 64 +static const char *DBUS_PLUGIN_SECTION = "Plugin:DBus"; + + + +/* + * This connects to dbus and gets relavant things for the LCD + */ + +typedef struct lcd_sig_t lcd_sig_t; +//do not look inside, its private! +struct lcd_sig_t { + void *user_data; + void (*callback) (void *user_data, int argc, char **argv); + void (*user_free) (void *); + char *sender; + char *path; + char *interface; + char *member; + char *rule; +}; + + +typedef struct { + int id; + char *event_name; +} handle_signal_t; + +static DBusConnection *sessconn; +static DBusConnection *sysconn; +static DBusError err; + +static lcd_sig_t *lcd_registered_signals[DBUS_MAX_SIGNALS]; //used mostly for freeing resources +static int registered_sig_count = 0; + +//takes the signal, matches it against a rule, and sends the correct agrument, as a string, to the screen +static DBusHandlerResult lcd_sig_received(DBusConnection * connection, DBusMessage * message, void *sigv); + +//frees all resources for a signal (use lcd_unregister_signal instead) +static void free_signal(lcd_sig_t * sig); +//unregisters a signal and frees its resources +static void lcd_unregister_signal(lcd_sig_t * sig); + +//these copy data in/out of dbus +static void fill_args(DBusMessage * message, int *argcount, char ***argv); +static void free_args(int argc, char **argv); + +//returns 0 on error (no connection opened) +// 1 when only the system connection was opened +// 2 when only the session connection was opened +// 3 both connections were opened +static int lcd_dbus_init(void); + +static void handle_inbound_signal(void *signal, int argc, char **argv); +static void free_handle_signal(handle_signal_t * sig); + +//given a signal, will add a hook so when the signal appears your callback is called +static lcd_sig_t *lcd_register_signal(const char *sender, const char *path, + const char *interface, const char *member, + void (*callback) (void *user_data, int argc, char **argv), void *user_data, + void (*user_free) (void *)); + +static void setup_dbus_events(DBusConnection * conn); + +//to handle watches through the main loop +static dbus_bool_t add_watch(DBusWatch * w, void *data); +static void remove_watch(DBusWatch * w, void *data); +static void toggle_watch(DBusWatch * w, void *data); +static void watch_handle(event_flags_t f, void *data); + +static void dispatch_dbus(void); //tell dbus to read something + + +//to handle timers through the main loop +static void timeout_dbus_handle(void *data); +static dbus_bool_t add_dbus_timeout(DBusTimeout * t, void *data); +static void remove_dbus_timeout(DBusTimeout * t, void *data); +static void toggle_dbus_timeout(DBusTimeout * t, void *data); + +static lcd_sig_t *create_signal(const char *sender, const char *path, + const char *interface, const char *member, + void (*callback) (void *user_data, int argc, char **argv), void *user_data, + void (*user_free) (void *)); + +static int clear_signal_txt(const int sig) +{ + dbus_signal_t *s = get_signal_txt(sig); + if (s == NULL) { + return 1; + } + int i; + if (s->arguments != NULL) { + for (i = 0; i < s->argc; i++) { + if (s->arguments[i] != NULL) { + free(s->arguments[i]); + } + } + free(s->arguments); + s->arguments = NULL; + } + s->argc = 0; + return 0; +} + +static dbus_signal_t *get_signal_txt(const int sig) +{ + if (sig < 0 || sig >= dbus_results.signals) { + return NULL; + } + return &dbus_results.a[sig]; +} + +//sets a signal struct for the given data +static int set_signal_txt(const int sig, const dbus_signal_t * data) +{ + if (sig < 0 || sig >= dbus_results.signals) { + int new_sigs = sig + 1; + //allocate it + dbus_results.a = realloc(dbus_results.a, sizeof(dbus_signal_t) * new_sigs); + int i; + //clear anything just allocated that we are not writing to right now + for (i = dbus_results.signals; i < new_sigs; i++) { + dbus_results.a[i].argc = 0; + dbus_results.a[i].arguments = NULL; + } + dbus_results.signals = new_sigs; + } + //free the old version + if (dbus_results.a[sig].argc != 0) { + clear_signal_txt(sig); + } + dbus_results.a[sig].argc = data->argc; + //need to dup the strings + dbus_results.a[sig].arguments = malloc(sizeof(data->arguments) * data->argc); + int i; + for (i = 0; i < data->argc; i++) { + dbus_results.a[sig].arguments[i] = strdup(data->arguments[i]); + } + return 0; +} + + + +/* + * lcd4linux interface fucntions + */ + + +static void get_argument(RESULT * result, RESULT * sig, RESULT * arg) +{ + int signal = (int) R2N(sig); + int argument = (int) R2N(arg); + + dbus_signal_t *signal_value = get_signal_txt(signal); + char *value = ""; + if (signal_value != NULL && signal_value->argc > argument && signal_value->arguments[argument] != NULL) { + value = signal_value->arguments[argument]; + + } + + /* store result */ + SetResult(&result, R_STRING, value); + +} + +static void clear_arguments(RESULT * result, RESULT * sig) +{ + int signal = (int) R2N(sig); + dbus_signal_t *signal_value = get_signal_txt(signal); + int i; + if (signal_value->arguments != NULL) { + for (i = 0; i < signal_value->argc; i++) { + if (signal_value->arguments[i] != NULL) { + free(signal_value->arguments[i]); + } + } + free(signal_value->arguments); + signal_value->arguments = NULL; + } + signal_value->argc = 0; + + /* store result */ + SetResult(&result, R_STRING, ""); +} + +static void load_dbus_cfg(void) +{ + char *sender, *path, *interface, *member, *eventname; + int i; + const char *sender_fmt = "signal%dsender"; + const char *path_fmt = "signal%dpath"; + const char *interface_fmt = "signal%dinterface"; + const char *member_fmt = "signal%dmember"; + const char *eventname_fmt = "signal%deventname"; + const int max_cfg_len = 32; + char cfg_name[max_cfg_len]; + for (i = 0; i < DBUS_MAX_SIGNALS; i++) { + snprintf(cfg_name, max_cfg_len - 1, sender_fmt, i); + sender = cfg_get(DBUS_PLUGIN_SECTION, cfg_name, ""); + + snprintf(cfg_name, max_cfg_len - 1, path_fmt, i); + path = cfg_get(DBUS_PLUGIN_SECTION, cfg_name, ""); + + snprintf(cfg_name, max_cfg_len - 1, interface_fmt, i); + interface = cfg_get(DBUS_PLUGIN_SECTION, cfg_name, ""); + + snprintf(cfg_name, max_cfg_len - 1, member_fmt, i); + member = cfg_get(DBUS_PLUGIN_SECTION, cfg_name, ""); + + snprintf(cfg_name, max_cfg_len - 1, eventname_fmt, i); + eventname = cfg_get(DBUS_PLUGIN_SECTION, cfg_name, ""); + + if (*path == '\0' && *interface == '\0' && *member == '\0') { + goto cleanup; + } else if (*path == '\0' || *interface == '\0' || *member == '\0') { + error("[DBus] Incomplete configuration specified for signal%d", i); + goto cleanup; + } + + handle_signal_t *sig_info = malloc(sizeof(handle_signal_t)); + sig_info->id = i; + if (*eventname == '\0') { + sig_info->event_name = NULL; + } else { + sig_info->event_name = strdup(eventname); + } + + if (!lcd_register_signal(sender, path, interface, member, handle_inbound_signal, + sig_info, (void (*)(void *)) free_handle_signal)) { + error("[DBus] Error Registering signal %d", i); + } + cleanup: + free(sender); + free(path); + free(interface); + free(member); + free(eventname); + } +} + + +static void free_handle_signal(handle_signal_t * sig) +{ + if (sig->event_name != NULL) { + free(sig->event_name); + } + free(sig); +} + +/* plugin initialization */ +int plugin_init_dbus(void) +{ + if (!lcd_dbus_init()) { + error("[DBus] Could not connect to DBus"); + return 1; + } + //dbus::argument(<DisplaySignal>, <Argument#>)//displays arg# for signal# + AddFunction("dbus::argument", 2, get_argument); + //dbus::clear(<signal>)//sets the arguments for signal# + AddFunction("dbus::clear", 1, clear_arguments); + + //read out config + load_dbus_cfg(); + return 0; +} + +void plugin_exit_dbus(void) +{ + int i; + //remove all known signals + for (i = registered_sig_count - 1; i >= 0; i--) { + lcd_unregister_signal(lcd_registered_signals[i]); + } + if (sysconn != NULL) { + dbus_connection_unref(sysconn); + } + if (sessconn != NULL) { + dbus_connection_unref(sessconn); + } + //remove all knows signal results + for (i = dbus_results.signals - 1; i >= 0; i--) { + clear_signal_txt(i); + } + +#ifdef DEBUG + //needs to be called to actually free everything, but might free stuff + //mpris_dbus uses and cause a crash on shutdown, enable for leak debugging + dbus_shutdown(); +#endif +} + + +/* + * From here one out it is all dbus specific funtions, + * should probably be split into a seperate file, but i + * keept it here to make the plugin a single file + * + */ + +//watch functions +static dbus_bool_t add_watch(DBusWatch * w, void *data) +{ + (void) data; //ignore it +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) + int fd = dbus_watch_get_unix_fd(w); +#else + int fd = dbus_watch_get_fd(w); +#endif + // int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix + int flags = dbus_watch_get_flags(w); + event_add(watch_handle, w, fd, flags & DBUS_WATCH_READABLE, flags & DBUS_WATCH_WRITABLE, dbus_watch_get_enabled(w)); + return TRUE; +} + +static void remove_watch(DBusWatch * w, void *data) +{ + (void) data; //ignore it +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) + event_del(dbus_watch_get_unix_fd(w)); +#else + event_del(dbus_watch_get_fd(w)); +#endif + // event_del(dbus_watch_get_unix_fd(w)); +} + +static void toggle_watch(DBusWatch * w, void *data) +{ + (void) data; +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR > 1) || (DBUS_VERSION_MAJOR > 1) + int fd = dbus_watch_get_unix_fd(w); +#else + int fd = dbus_watch_get_fd(w); +#endif + // int fd = dbus_watch_get_unix_fd(w); //we assume we are using unix + int flags = dbus_watch_get_flags(w); + event_modify(fd, flags & DBUS_WATCH_READABLE, flags & DBUS_WATCH_WRITABLE, dbus_watch_get_enabled(w)); +} + +static void watch_handle(event_flags_t f, void *data) +{ + DBusWatch *w = (DBusWatch *) data; + + //convert the flags + unsigned int flags = 0; + + flags |= (f & EVENT_READ) ? DBUS_WATCH_READABLE : 0; + flags |= (f & EVENT_WRITE) ? DBUS_WATCH_WRITABLE : 0; + flags |= (f & EVENT_HUP) ? DBUS_WATCH_HANGUP : 0; + flags |= (f & EVENT_ERR) ? DBUS_WATCH_ERROR : 0; + + //tell dbus + if (!dbus_watch_handle(w, flags)) { + info("[DBus] dbus_watch_handle(): Not enough memory!"); + } + dispatch_dbus(); +} + +static void dispatch_dbus(void) +{ + if (sessconn != NULL && dbus_connection_get_dispatch_status(sessconn) == DBUS_DISPATCH_DATA_REMAINS) { + while (DBUS_DISPATCH_DATA_REMAINS == dbus_connection_dispatch(sessconn)); + } + if (sysconn != NULL && dbus_connection_get_dispatch_status(sysconn) == DBUS_DISPATCH_DATA_REMAINS) { + while (DBUS_DISPATCH_DATA_REMAINS == dbus_connection_dispatch(sysconn)); + } +} + +static void timeout_dbus_handle(void *data) +{ + DBusTimeout *t = (DBusTimeout *) data; + if (!dbus_timeout_handle(t)) { + info("[DBus] Not enough memory to handle timeout!"); + } + dispatch_dbus(); +} + +static dbus_bool_t add_dbus_timeout(DBusTimeout * t, void *data) +{ + (void) data; //ignore warning + if (!timer_add_late(timeout_dbus_handle, t, dbus_timeout_get_interval(t), 0)) { + return FALSE; + } + return TRUE; +} + + +static void remove_dbus_timeout(DBusTimeout * t, void *data) +{ + (void) data; //ignore warning + timer_remove(timeout_dbus_handle, t); +} + +static void toggle_dbus_timeout(DBusTimeout * t, void *data) +{ + remove_dbus_timeout(t, data); + add_dbus_timeout(t, data); +} + +//add the proper events/callbacks so we get notified about out messages +static void setup_dbus_events(DBusConnection * conn) +{ + if (!dbus_connection_set_watch_functions(conn, add_watch, remove_watch, toggle_watch, NULL, NULL)) { + error("[DBus] dbus_connection_set_watch_functions(): Not enough memory!"); + } + if (!dbus_connection_set_timeout_functions + (conn, add_dbus_timeout, remove_dbus_timeout, toggle_dbus_timeout, NULL, NULL)) { + error("[DBus] dbus_connection_set_timeout_functions(): Not enough memory!"); + } +} + +static int lcd_dbus_init(void) +{ + + int success = 3; + dbus_error_init(&err); //dbus_error_free(&err); + sessconn = dbus_bus_get(DBUS_BUS_SESSION, &err); + if (sessconn == NULL) { + info("[DBus] Error connecting to the dbus session bus: %s\n", err.message); + dbus_error_free(&err); + success &= 1; + } else { +#ifdef DEBUG + dbus_connection_set_exit_on_disconnect(sessconn, FALSE); +#endif + setup_dbus_events(sessconn); + } + + sysconn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); + if (sysconn == NULL) { + info("[DBus] Error connecting to the dbus system bus: %s\n", err.message); + success &= 2; + } else { +#ifdef DEBUG + dbus_connection_set_exit_on_disconnect(sysconn, FALSE); +#endif + setup_dbus_events(sysconn); + } + + return success; +} + +static lcd_sig_t *create_signal(const char *sender, const char *path, + const char *interface, const char *member, + void (*callback) (void *user_data, int argc, char **argv), void *user_data, + void (*user_free) (void *)) +{ + lcd_sig_t *sig = malloc(sizeof(lcd_sig_t)); + sig->callback = callback; + sig->user_data = user_data; + sig->user_free = user_free; + sig->sender = malloc(sizeof(char) * (1 + strlen(sender))); + strcpy(sig->sender, sender); + sig->path = malloc(sizeof(char) * (1 + strlen(path))); + strcpy(sig->path, path); + sig->interface = malloc(sizeof(char) * (1 + strlen(interface))); + strcpy(sig->interface, interface); + sig->member = malloc(sizeof(char) * (1 + strlen(member))); + strcpy(sig->member, member); + + size_t len = strlen(sender) + strlen(path) + strlen(interface) + strlen(member); + char *format; + if (strlen(sig->sender) == 0) { + format = "type='signal',path='%s',interface='%s',member='%s'"; + } else { + format = "type='signal',sender='%s',path='%s',interface='%s',member='%s'"; + } + len += strlen(format); + len *= sizeof(char); + sig->rule = malloc(len); + if (strlen(sig->sender) == 0) { + sprintf(sig->rule, format, path, interface, member); + } else { + sprintf(sig->rule, format, sender, path, interface, member); + } + assert(strlen(sig->rule) < len); + return sig; +} + +static void handle_inbound_signal(void *signal, int argc, char **argv) +{ + handle_signal_t *signal_info = (handle_signal_t *) signal; + dbus_signal_t sig; + sig.argc = argc; + sig.arguments = argv; + set_signal_txt(signal_info->id, &sig); + + if (signal_info->event_name != NULL) { + named_event_trigger(signal_info->event_name); + } +} + +static lcd_sig_t *lcd_register_signal(const char *sender, const char *path, + const char *interface, const char *member, + void (*callback) (void *user_data, int argc, char **argv), void *user_data, + void (*user_free) (void *)) +{ + if (__builtin_expect(registered_sig_count >= DBUS_MAX_SIGNALS, 0)) { //gcc >= 2.96 + //i don't think anything will allow this to ever be hit..in fact It's impossible in the form i wrote the plugin + error + ("[DBus] Attempted to add more than %d dus signals, if you actually need more than that edit DBUS_MAX_SIGNALS in plugin_dbus.c", + DBUS_MAX_SIGNALS); + return NULL; + } + //store everything we need in the singal struct + lcd_sig_t *sig = create_signal(sender, path, interface, member, callback, user_data, user_free); + int success = 3; + if (sessconn != NULL) { + dbus_bus_add_match(sessconn, sig->rule, &err); + if (dbus_error_is_set(&err)) { + info("[DBus] Error adding dbus match to the session bus: %s \n", err.message); + dbus_error_free(&err); + success ^= 1; + } + + + if (!dbus_connection_add_filter(sessconn, lcd_sig_received, sig, NULL) && (success & 1)) { + info("[DBus] Dbus signal registration failed to the session bus!\n"); + dbus_bus_remove_match(sessconn, sig->rule, &err); + success ^= 1; + } + } else { + success ^= 1; + } + if (sysconn != NULL) { + dbus_bus_add_match(sysconn, sig->rule, &err); + if (dbus_error_is_set(&err)) { + info("[DBus] Error adding dbus match to the system bus: %s \n", err.message); + success ^= 2; + } + + if (!dbus_connection_add_filter(sysconn, lcd_sig_received, sig, NULL) && (success & 2)) { + info("[DBus] Dbus signal registration failed to the system bus!\n"); + dbus_bus_remove_match(sysconn, sig->rule, &err); + success ^= 2; + } + } else { + success ^= 2; + } + if (!success) { + free_signal(sig); + return NULL; + } + + lcd_registered_signals[registered_sig_count] = sig; + registered_sig_count++; + return sig; +} + +static void free_signal(lcd_sig_t * sig) +{ + if (sig->user_free != NULL) { + sig->user_free(sig->user_data); + } + free(sig->sender); + free(sig->path); + free(sig->interface); + free(sig->member); + free(sig->rule); + free(sig); +} + +static void lcd_unregister_signal(lcd_sig_t * sig) +{ + if (sig == NULL) { + return; + } + //remove filter and match + if (sessconn != NULL) { + dbus_connection_remove_filter(sessconn, lcd_sig_received, sig); + dbus_bus_remove_match(sessconn, sig->rule, NULL); + } + if (sysconn != NULL) { + dbus_connection_remove_filter(sysconn, lcd_sig_received, sig); + dbus_bus_remove_match(sysconn, sig->rule, NULL); + } + //free user data + free_signal(sig); + + //drop it off the list + int i; + for (i = 0; i < registered_sig_count; i++) { + if (lcd_registered_signals[i] == sig) { + registered_sig_count--; + lcd_registered_signals[i] = lcd_registered_signals[registered_sig_count]; + break; + } + } +} + + +static void fill_args(DBusMessage * message, int *argcount, char ***argv) +{ + dbus_message_ref(message); + int argc = 0; + char **args = NULL; + + + DBusMessageIter iter; + int buf_size = 0; + dbus_message_iter_init(message, &iter); + int current_type; + + //iterate over all arguments, casting all primitaves to strings + while ((current_type = dbus_message_iter_get_arg_type(&iter)) != DBUS_TYPE_INVALID) { + assert(argc <= buf_size); + if (argc >= buf_size) { + buf_size = argc * 2; + if (buf_size == 0) { + buf_size = 1; + } + args = realloc(args, sizeof(char **) * buf_size); + } + if (dbus_type_is_basic(current_type)) { + args[argc] = malloc(sizeof(char) * (1 + LCD_MAX_MSG_LEN)); + args[argc][LCD_MAX_MSG_LEN] = '\0'; + //determine the type + switch (current_type) { + /* Primitive types */ + case DBUS_TYPE_BYTE: + { + char value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%hhx", value); + } + + break; + case DBUS_TYPE_BOOLEAN: + { + dbus_bool_t value; + dbus_message_iter_get_basic(&iter, &value); + if (value) { + strcpy(args[argc], "true"); + } else { + strcpy(args[argc], "false"); + } + + } + break; + case DBUS_TYPE_INT16: + { + dbus_int16_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%hd", value); + } + break; + case DBUS_TYPE_UINT16: + { + dbus_uint16_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%hu", value); + } + break; + case DBUS_TYPE_INT32: + { + dbus_int32_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%d", value); + } + break; + case DBUS_TYPE_UINT32: + { + dbus_uint32_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%u", value); + } + break; + case DBUS_TYPE_INT64: + { + dbus_int64_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%jd", (intmax_t) value); + } + break; + case DBUS_TYPE_UINT64: + { + dbus_uint64_t value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%ju", (uintmax_t) value); + } + break; + case DBUS_TYPE_DOUBLE: + { + double value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%f", value); + } + break; + case DBUS_TYPE_STRING: //all strings + case DBUS_TYPE_OBJECT_PATH: + case DBUS_TYPE_SIGNATURE: + { + char *value; + dbus_message_iter_get_basic(&iter, &value); + snprintf(args[argc], LCD_MAX_MSG_LEN, "%s", value); + } + break; + case DBUS_TYPE_INVALID: + default: + //not supported + free(args[argc]); + args[argc] = NULL; + assert(0); //should never ever happen... + + break; + } + } else { + args[argc] = NULL; + } + + argc++; + dbus_message_iter_next(&iter); + } + + + *argcount = argc; + *argv = args; + dbus_message_unref(message); +} + + +static DBusHandlerResult lcd_sig_received(DBusConnection * connection, DBusMessage * msg, void *sigv) +{ + (void) connection; + dbus_message_ref(msg); + lcd_sig_t *sig = sigv; + //compare the signal to the one we were assigned + if (dbus_message_get_type(msg) != DBUS_MESSAGE_TYPE_SIGNAL) { + dbus_message_unref(msg); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + //we don't check the sender because we (probably) asked by name, not by sender + if (!dbus_message_has_member(msg, sig->member) || + !dbus_message_has_path(msg, sig->path) || !dbus_message_has_interface(msg, sig->interface)) { + dbus_message_unref(msg); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + //call the users function + if (sig->callback != NULL) { + char **args; + int argc; + fill_args(msg, &argc, &args); + sig->callback(sig->user_data, argc, args); + free_args(argc, args); + } + + dbus_message_unref(msg); + return DBUS_HANDLER_RESULT_HANDLED; +} + + + +static void free_args(int argc, char **argv) +{ + int i; + //free args + for (i = 0; i < argc; i++) { + if (argv[i] != NULL) { + free(argv[i]); + } + } + + if (argv != NULL && argc != 0) { + free(argv); + } + +} diff --git a/plugin_diskstats.c b/plugin_diskstats.c index e8d04aa..bfaaa0e 100644 --- a/plugin_diskstats.c +++ b/plugin_diskstats.c @@ -1,9 +1,9 @@ -/* $Id: plugin_diskstats.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_diskstats.c $ +/* $Id: plugin_diskstats.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_diskstats.c $ * * plugin for /proc/diskstats parsing * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_dvb.c b/plugin_dvb.c index 3482397..36d515a 100644 --- a/plugin_dvb.c +++ b/plugin_dvb.c @@ -1,9 +1,9 @@ -/* $Id: plugin_dvb.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_dvb.c $ +/* $Id: plugin_dvb.c 939 2009-01-04 14:14:31Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_dvb.c $ * * plugin for DVB status * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -64,6 +64,8 @@ static HASH DVB; static int get_dvb_stats(void) { + static int ioc_disable = 0; + int age; int fd; unsigned short snr, sig; @@ -82,24 +84,40 @@ static int get_dvb_stats(void) return -1; } - if (ioctl(fd, FE_READ_SIGNAL_STRENGTH, &sig) != 0) { + sig = 0; + if ((ioc_disable & 0x01) == 0 && ioctl(fd, FE_READ_SIGNAL_STRENGTH, &sig) != 0) { error("ioctl(FE_READ_SIGNAL_STRENGTH) failed: %s", strerror(errno)); - sig = 0; + if (errno == ENOSYS) { + ioc_disable |= 0x01; + error("ioctl(FE_READ_SIGNAL_STRENGTH) disabled."); + } } - if (ioctl(fd, FE_READ_SNR, &snr) != 0) { + snr = 0; + if ((ioc_disable & 0x02) == 0 && ioctl(fd, FE_READ_SNR, &snr) != 0) { error("ioctl(FE_READ_SNR) failed: %s", strerror(errno)); - snr = 0; + if (errno == ENOSYS) { + ioc_disable |= 0x02; + error("ioctl(FE_READ_SNR) disabled."); + } } - if (ioctl(fd, FE_READ_BER, &ber) != 0) { + ber = 0; + if ((ioc_disable & 0x04) == 0 && ioctl(fd, FE_READ_BER, &ber) != 0) { error("ioctl(FE_READ_BER) failed: %s", strerror(errno)); - ber = 0; + if (errno == ENOSYS) { + ioc_disable |= 0x04; + error("ioctl(FE_READ_BER) disabled."); + } } - if (ioctl(fd, FE_READ_UNCORRECTED_BLOCKS, &ucb) != 0) { + ucb = 0; + if ((ioc_disable & 0x08) == 0 && ioctl(fd, FE_READ_UNCORRECTED_BLOCKS, &ucb) != 0) { error("ioctl(FE_READ_UNCORRECTED_BLOCKS) failed: %s", strerror(errno)); - ucb = 0; + if (errno == ENOSYS) { + ioc_disable |= 0x08; + error("ioctl(FE_READ_UNCORRECTED_BLOCKS) disabled."); + } } close(fd); diff --git a/plugin_event.c b/plugin_event.c new file mode 100644 index 0000000..05f2bea --- /dev/null +++ b/plugin_event.c @@ -0,0 +1,94 @@ +/* $Id: plugin_event.c -1 $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_event.c $ + * + * plugin template + * + * Copyright (C) 2003 Ed Martin <edman007@edman007.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_event (void) + * adds various functions + * + */ + + +/* define the include files you need */ +#include "config.h" + +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" +#include "event.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + + +/* function 'trigger' */ +/* takes one argument, a string */ +/* triggers the event */ + +static void my_trigger(RESULT * result, RESULT * arg1) +{ + char *param; + + /* Get Parameter */ + /* R2N stands for 'Result to Number' */ + param = R2S(arg1); + named_event_trigger(param); + + char *value = ""; + + /* store result */ + /* when called with R_NUMBER, it assumes the */ + /* next parameter to be a pointer to double */ + SetResult(&result, R_NUMBER, &value); +} + + +/* plugin initialization */ +/* MUST NOT be declared 'static'! */ +int plugin_init_event(void) +{ + + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("event::trigger", 1, my_trigger); + + + return 0; +} + +void plugin_exit_event(void) +{ + /* free any allocated memory */ + /* close filedescriptors */ +} diff --git a/plugin_exec.c b/plugin_exec.c index 70700ed..cf5e5ee 100644 --- a/plugin_exec.c +++ b/plugin_exec.c @@ -1,9 +1,9 @@ -/* $Id: plugin_exec.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_exec.c $ +/* $Id: plugin_exec.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_exec.c $ * * plugin for external processes * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old 'exec' client which is diff --git a/plugin_fifo.c b/plugin_fifo.c new file mode 100644 index 0000000..4166b05 --- /dev/null +++ b/plugin_fifo.c @@ -0,0 +1,318 @@ +/* $Id: plugin_fifo.c 1112 2010-02-14 02:47:49Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_fifo.c $ + * + * Fifo plugin + * + * Copyright (C) 2008 Michael Vogt <michu@neophob.com> + * Copyright (C) 2010 Mattia Jona-Lasinio <mjona@users.sourceforge.net> + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * Configuration parameters: + * + * - FifoPath 'string' : use <string> as the fifo complete file path + * If absent use /tmp/lcd4linux.fifo) + * + * - FifoBufSize num : if the plugin is unable to determine the display size then + * set the size of the internal buffer to <num> characters + * otherwise use the display size (number of columns). + * If no display size is available and no FifoBufSize parameter + * is specified then arbitrarily set the internal buffer size + * to 80 characters. + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <signal.h> + +#include "debug.h" +#include "plugin.h" +#include "cfg.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +#define FIFO_MAXPATH 256 +#define FIFO_DEFAULT_PATH /tmp/lcd4linux.fifo +#define FIFO_DEFAULT_BUFSIZE 80 +#define str(s) #s +#define string(s) str(s) + +struct FifoData { + char *path; + char *msg; + int msglen; + int input; + int created; +}; + +static struct FifoData fd = { + .path = NULL, + .msg = NULL, + .msglen = -1, + .input = -1, + .created = -1, +}; + + +static int confFifo(struct FifoData *p) +{ + char *path, *disp, *sect, *fifosect = "Plugin:FIFO"; + unsigned int pathlen; + + info("[FIFO] Reading config file '%s'", cfg_source()); + + path = cfg_get(fifosect, "FifoPath", string(FIFO_DEFAULT_PATH)); + pathlen = strlen(path); + if (pathlen == 0) { + info("[FIFO] Invalid '%s.FifoPath' entry from '%s'. " + "Assuming " string(FIFO_DEFAULT_PATH), fifosect, cfg_source()); + free(path); + path = strdup(string(FIFO_DEFAULT_PATH)); + pathlen = strlen(path); + } + if (pathlen > FIFO_MAXPATH) { + error("[FIFO] Error: Too long '%s.FifoPath' entry from '%s'. " + "(MAX " string(FIFO_MAXPATH) " chars)", fifosect, cfg_source()); + free(path); + return (-1); + } + info("[FIFO] Read '%s.FifoPath' value is '%s'", fifosect, path); + + disp = cfg_get(NULL, "Display", NULL); + if (disp == NULL) { + error("[FIFO] Error: Could not get the Display name from '%s'", cfg_source()); + free(path); + return (-1); + } + if ((sect = malloc(1 + strlen("Display:") + strlen(disp))) == NULL) { + error("[FIFO] Error: Memory allocation failed"); + free(disp); + free(path); + return (-1); + } + strcpy(sect, "Display:"); + strcat(sect, disp); + info("[FIFO] Using display '%s'.", disp); + free(disp); + + disp = cfg_get(sect, "Size", NULL); + if (disp != NULL) { + info("[FIFO] Getting the buffer size from '%s.Size'", sect); + if (sscanf(disp, "%dx%*d", &p->msglen) != 1) { + info("[FIFO] Could not determine the display size. " "Assuming " string(FIFO_DEFAULT_BUFSIZE)); + p->msglen = FIFO_DEFAULT_BUFSIZE; + } + free(disp); + } else { + info("[FIFO] Could not find a '%s.Size' entry.", sect); + if (cfg_number(fifosect, "FifoBufSize", FIFO_DEFAULT_BUFSIZE, 0, -1, &p->msglen) > 0) { + info("[FIFO] Getting the buffer size from '%s.FifoBufSize'", fifosect); + } else { + info("[FIFO] Could not find a valid '%s.FifoBufSize' entry. " + "Assuming " string(FIFO_DEFAULT_BUFSIZE), fifosect); + p->msglen = FIFO_DEFAULT_BUFSIZE; + } + } + info("[FIFO] Read buffer size is '%d'", p->msglen); + free(sect); + + if ((p->msg = malloc(2 + pathlen + p->msglen)) == NULL) { + error("[FIFO] Error: Memory allocation failed"); + free(path); + return (-1); + } + p->msg[0] = 0; + p->path = p->msg + p->msglen + 1; + strcpy(p->path, path); + free(path); + + return (0); +} + + +static int makeFifo(struct FifoData *p) +{ + struct stat st; + + if (stat(p->path, &st) < 0) { + if (errno == ENOENT) { + if (mkfifo(p->path, 0666) == 0) { + p->created = 1; + + return (0); + } + error("Couldn't create FIFO \"%s\": %s\n", p->path, strerror(errno)); + + return (-1); + } + error("Failed to stat FIFO \"%s\": %s\n", p->path, strerror(errno)); + + return (-1); + } + + if (!S_ISFIFO(st.st_mode)) { + error("\"%s\" already exists, but is not a FIFO", p->path); + + return (-1); + } + + return (0); +} + + +static void closeFifo(struct FifoData *p) +{ + struct stat st; + + if (p->input >= 0) { + close(p->input); + p->input = -1; + } + + if ((p->created >= 0) && (stat(p->path, &st) == 0)) { + debug("Removing FIFO \"%s\"\n", p->path); + if (unlink(p->path) < 0) { + error("Could not remove FIFO \"%s\": %s\n", p->path, strerror(errno)); + + return; + } + p->created = -1; + } + + if (p->msg) { + free(p->msg); + p->msg = p->path = NULL; + p->msglen = -1; + } +} + + +static int openFifo(struct FifoData *p) +{ + if (p->created < 0) { + error("Error: FIFO \"%s\" does not exist: %s\n", p->path, strerror(errno)); + + return (-1); + } + + if ((p->input = open(p->path, O_RDONLY | O_NONBLOCK)) < 0) { + error("Could not open FIFO \"%s\" for reading: %s\n", p->path, strerror(errno)); + closeFifo(p); + + return (-1); + } + + return (0); +} + + +static int startFifo(struct FifoData *p) +{ + int res; + + if ((res = confFifo(p))) + return (res); + + if ((res = makeFifo(p))) + return (res); + + if ((res = openFifo(p))) + return (res); + + /* ignore broken pipe */ + signal(SIGPIPE, SIG_IGN); + + return (res); +} + + +static void readFifo(struct FifoData *p) +{ + int bytes; + + bytes = read(p->input, p->msg, p->msglen); + if (bytes == 0) + return; + + if (bytes > 0) { + p->msg[bytes] = 0; + while (bytes--) + if (p->msg[bytes] < 0x20) + p->msg[bytes] = ' '; + } else { + error("[FIFO] Error %i: %s", errno, strerror(errno)); + strcpy(p->msg, "ERROR"); + } +} + + +static void runFifo(RESULT * result) +{ + static int state = 1; + struct FifoData *p = &fd; + char *s; + + switch (state) { + case 1: + /* Called for the first time. Set up everything. */ + state = startFifo(p); + s = ""; + break; + + case 0: + /* Init went fine. Now run in normal operation mode. */ + readFifo(p); + s = p->msg; + break; + + default: + /* There was an error somewhere in init. Do nothing. */ + s = "ERROR"; + break; + } + + /* Store the result */ + SetResult(&result, R_STRING, s); +} + + +/* plugin initialization */ +int plugin_init_fifo(void) +{ + AddFunction("fifo::read", 0, runFifo); + + return (0); +} + + +void plugin_exit_fifo(void) +{ + closeFifo(&fd); +} diff --git a/plugin_file.c b/plugin_file.c index 7103027..8c19924 100644 --- a/plugin_file.c +++ b/plugin_file.c @@ -1,5 +1,5 @@ -/* $Id: plugin_file.c 783 2007-03-22 06:10:36Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_file.c $ +/* $Id: plugin_file.c 782 2007-03-21 05:01:11Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_file.c $ * * plugin to perform simple file operations * diff --git a/plugin_gps.c b/plugin_gps.c new file mode 100644 index 0000000..e803c0c --- /dev/null +++ b/plugin_gps.c @@ -0,0 +1,725 @@ +/* $Id: plugin_gps.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_gps.c $ + * + * gps plugin (nmea), code by michu / www.neophob.com, based on nmeap, http://sourceforge.net/projects/nmeap/ + * + * Copyright (C) 2007 Michu - http://www.neophob.com + * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * GPS Plugin for lcd4linux, by michael vogt / http://www.neophob.com + * contact: michu@neophob.com + * + * based on nmeap by daveh, http://www.dmh2000.com/ or http://sourceforge.net/projects/nmeap/ + * you need a compiled libnmeap to compile this plugin. + * + * History: + * v0.1 -initial release + * v0.2 -fix include files, include <termios.h> and <asm/fcntl.h> (embedded devices) + * -fixed emulation mode (read only x bytes instead of the whole emulated nmea data) + * -improved error handling (if there are no parameters defined, lcd4linx will display "GPS ARG ERR") + * -display raw nmea string from the gps receiver + * -added support for gps device with 9600 baud (env. variable) + * -added the option that the widget graps data from the buffer and not from the gps device (usefull for multible widgets) + * v0.3 -improved nmea parsing + * -improved gps-emulator + * -time is now updated with rmc and gga sentence + * + * TODO: + * -update direction only when speed > 5 kmh + * -add more data fields + * -dump nmea string to external file + * + * Exported functions: + * int plugin_init_gps (void) - default plugin initialisation + * void parse(SHOW-OPTIONS, DISPLAY-OPTIONS) + * display option define, what the plugin should display + * + * OPTION: EXAMPLE: + * ------- -------- + * + * PARAMETER 1: + * #define SHOW_ALTITUDE 0x000000001 alt:500 + * #define SHOW_SPEED 0x000000010 spd:30 + * #define SHOW_COURSE 0x000000100 dir:NO + * #define SHOW_SATELLITES 0x000001000 sat:4 + * #define SHOW_QUALITY 0x000010000 qua:1 + * #define SHOW_STATUS 0x000100000 sta:V + * #define SHOW_TIME_UTC 0x001000000 utc:113459 + * #define SHOW_DATE 0x010000000 dat:190204 (19.02.2004) + * + * PARAMETER 2: + * #define OPTION_NO_PREFIX 0x000000001 disable prefix (example, instead of "alt:500" it displays "500" + * #define OPTION_SPEED_IN_KNOTS 0x000000010 when use the SHOW_SPEED option, display speed in knots instead in km/h + * #define OPTION_RAW_NMEA 0x000000100 outputs the parsed nmea string, only valid when EMULATE is not defined! + * #define OPTION_GET_BUFFERDATA 0x000001000 when you define more than 1 gps widget + * each widget will get updates and cause some ugly side effects, specially when you display the time + * by enabling this option, the widget will not read any nmea data from the serial port. + * KEEP IN MIND that there must be ONE widget which get buffered data (means read data from the port) + * + * #define SHOW_NMEA_STATUS 0x010000000 OK:0033/Error:0002/Incomplete:0002 + * + * + * Examples: + * - gps::parse('0x011','0') will display the altitude and speed -> alt:500 spd:43 + * - gps::parse('0x01100','0') will display the course and the numbers of satellites -> dir:NO sat:3 + * - gps::parse('0x01','0x01') will display the speed without prefix -> 50 + * - gps::parse('0x01','0x01') will display the speed in knots without prefix -> 27 + * + * ENV VARIABLES + * To finetune plugin_gps you may define some env variables: + * GPS_PORT gps device, default value is /dev/usb/tts/1 + * GPS_9600 serial port speed, default is 4800 baud, if you define this var speed will be 9600 (export GPS_9600=dummy) + */ + + +/* define the include files you need */ +#include "config.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <termios.h> //used for serial port flags +#include <asm/fcntl.h> + + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +#include "nmeap.h" + +//#define EMULATE //remove comment to enable gps data emulation... +#define EMU_BUFFER_READ_SIZE 128 //how many bytes are read each loop aka emulation speed +#define BUFFER_SIZE 256 + +#define SHOW_ALTITUDE 0x000000001 +#define SHOW_SPEED 0x000000010 +#define SHOW_COURSE 0x000000100 +#define SHOW_SATELLITES 0x000001000 +#define SHOW_QUALITY 0x000010000 +#define SHOW_STATUS 0x000100000 +#define SHOW_TIME_UTC 0x001000000 +#define SHOW_DATE 0x010000000 + +#define OPTION_NO_PREFIX 0x000000001 +#define OPTION_SPEED_IN_KNOTS 0x000000010 +#define OPTION_RAW_NMEA 0x000000100 //outputs the parsed nmea string, only valid when EMULATE is not defined! +#define OPTION_GET_BUFFERDATA 0x000001000 //when you define more than 1 gps widget + //each widget will get updates and cause some ugly side effects, specially when you display the time + //by enabling this option, the widget will not read any nmea data from the serial port. + //KEEP IN MIND that there must be ONE widget which does not get buffered data (means read data from the port) +#define OPTION_DEBUG 0x000010000 +#define SHOW_NMEA_STATUS 0x010000000 + +static float course = 0.f; //degrees +static float altitude = 0.f; +static float speed = 0.f; //Speed over ground in KNOTS!! +static int satellites = 0; //Number of satellites in use (00-12) +static int quality = 0; //GPS quality indicator (0 - fix not valid, 1 - GPS fix, 2 - DGPS fix) +static char gpsStatus = 'V'; //A=active or V=Void +static unsigned long gpsTime = 0; //UTC of position fix in hhmmss format +static unsigned long gpsDate = 0; //Date in ddmmyy format + +static int msgCounter = 0; //parsed nmea-sentence +static int errCounter = 0; //parsed error nmea-sentence +static int incomplCounter = 0; //incomplete parsed nmea-sentence +/* ---------------------------------------------------------------------------------------*/ +/* STEP 1 : allocate the data structures. be careful if you put them on the stack because */ +/* they need to be live for the duration of the parser */ +/* ---------------------------------------------------------------------------------------*/ +static nmeap_context_t nmea; /* parser context */ +static nmeap_gga_t gga; /* this is where the data from GGA messages will show up */ +static nmeap_rmc_t rmc; /* this is where the data from RMC messages will show up */ +static int user_data; /* user can pass in anything. typically it will be a pointer to some user data */ + +static int fd_g; /* port handler */ +static unsigned int emu_read_ofs = 0; +static int debug = 0; //debug flag + +static char Name[] = "plugin_gps.c"; + +static int fndStr = 0; //how many bytes were saved from the last read +static char backBuffer[BUFFER_SIZE]; //the buffer to save incomplete nmea strings + + +#ifdef EMULATE +char test_vector[] = { +/* "$GPGGA,123519,3929.946667,N,11946.086667,E,1,08,0.9,545.4,M,46.9,M,,*4A\r\n" // good + "$xyz,1234,asdfadfasdfasdfljsadfkjasdfk\r\n" // junk + "$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68\r\n" // good + "$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*48\r\n" // checksum error + "$GPRMC,165110.000,A,5601.0318,N,01211.3503,E,0.09,28.11,190706,,*35\r\n" //some more data + "$GPGGA,165111.000,5601.0318,N,01211.3503,E,1,07,1.2,22.3,M,41.6,M,,0000*65\r\n" + "$GPRMC,165111.000,A,5601.0318,N,01211.3503,E,0.08,43.53,190706,,*3E\r\n" + "$GPGGA,165112.000,5601.0318,N,01211.3503,E,1,07,1.2,22.3,M,41.6,M,,0000*66\r\n" + "$GPRMC,165112.000,A,5601.0318,N,01211.3503,E,0.08,37.38,190706,,*33\r\n" + "$GPGGA,165113.000,5601.0318,N,01211.3503,E,1,07,1.2,22.4,M,41.6,M,,0000*60\r\n" + "$GPRMC,165113.000,A,5601.0318,N,01211.3503,E,0.11,21.03,190706,,*35\r\n" + "$GPGGA,165114.000,5601.0318,N,01211.3504,E,1,07,1.2,22.6,M,41.6,M,,0000*62\r\n" + "$GPRMC,165114.000,A,5601.0318,N,01211.3504,E,0.08,45.67,190706,,*3D\r\n" + "$GPGGA,165115.000,5601.0318,N,01211.3504,E,1,07,1.2,22.7,M,41.6,M,,0000*62\r\n" + "$GPRMC,165115.000,A,5601.0318,N,01211.3504,E,0.10,59.41,190706,,*3C\r\n" + "$GPGGA,165116.000,5601.0318,N,01211.3504,E,1,07,1.2,22.8,M,41.6,M,,0000*6E\r\n" + "$GPRMC,165116.000,A,5601.0318,N,01211.3504,E,0.06,50.22,190706,,*34\r\n" + "$GPGGA,165117.000,5601.0318,N,01211.3505,E,1,07,1.2,22.9,M,41.6,M,,0000*6F\r\n" + "$GPRMC,165117.000,A,5601.0318,N,01211.3505,E,0.08,45.32,190706,,*3F\r\n" + "$GPGGA,165118.000,5601.0318,N,01211.3505,E,1,07,1.2,23.0,M,41.6,M,,0000*68\r\n" + "$GPRMC,165118.000,A,5601.0318,N,01211.3505,E,0.10,37.49,190706,,*30\r\n"*/ + "$GPGGA,165119.000,5601.0318,N,01211.3504,E,1,06,1.2,23.0,M,41.6,M,,0000*69\r\n" + "$GPRMC,165119.000,A,5601.0318,N,01211.3504,E,0.08,27.23,190706,,*34\r\n" + "$GPGGA,165120.000,5601.0318,N,01211.3504,E,1,07,1.2,23.0,M,41.6,M,,0000*62\r\n" + "$GPRMC,165120.000,A,5601.0318,N,01211.3504,E,0.08,41.52,190706,,*38\r\n" + "$GPGGA,165121.000,5601.0319,N,01211.3505,E,1,07,1.2,23.1,M,41.6,M,,0000*62\r\n" + "$GPRMC,165121.000,A,5601.0319,N,01211.3505,E,0.09,57.19,190706,,*30\r\n" + "$GPGGA,165122.000,5601.0319,N,01211.3505,E,1,07,1.2,23.2,M,41.6,M,,0000*62\r\n" + "$GPRMC,165122.000,A,5601.0319,N,01211.3505,E,0.10,30.60,190706,,*34\r\n" + "$GPGGA,165123.000,5601.0319,N,01211.3505,E,1,07,1.2,23.3,M,41.6,M,,0000*62\r\n" + "$GPRMC,165123.000,A,5601.0319,N,01211.3505,E,0.07,45.49,190706,,*3A\r\n" + "$GPGGA,165124.000,5601.0319,N,01211.3505,E,1,07,1.2,23.4,M,41.6,M,,0000*62\r\n" + "$GPRMC,165124.000,A,5601.0319,N,01211.3505,E,0.09,34.85,190706,,*35\r\n" + "$GPGGA,165125.000,5601.0319,N,01211.3506,E,1,07,1.2,23.4,M,41.6,M,,0000*60\r\n" + "$GPRMC,165125.000,A,5601.0319,N,01211.3506,E,0.06,43.06,190706,,*33\r\n" + "$GPGGA,165126.000,5601.0319,N,01211.3506,E,1,07,1.2,23.4,M,41.6,M,,0000*63\r\n" + "$GPRMC,165126.000,A,5601.0319,N,01211.3506,E,0.10,37.63,190706,,*37\r\n" + "$GPGGA,165127.000,5601.0319,N,01211.3505,E,1,07,1.2,23.4,M,41.6,M,,0000*61\r\n" + "$GPRMC,165127.000,A,5601.0319,N,01211.3505,E,0.07,42.23,190706,,*35\r\n" + "$GPGGA,165128.000,5601.0319,N,01211.3505,E,1,07,1.2,23.4,M,41.6,M,,0000*6E\r\n" + "$GPRMC,165128.000,A,5601.0319,N,01211.3505,E,0.09,27.98,190706,,*37\r\n" + "$GPGGA,165129.000,5601.0319,N,01211.3505,E,1,07,1.2,23.3,M,41.6,M,,0000*68\r\n" + "$GPRMC,165129.000,A,5601.0319,N,01211.3505,E,0.08,51.89,190706,,*36\r\n" + "$GPGGA,165130.000,5601.0319,N,01211.3505,E,1,07,1.2,23.2,M,41.6,M,,0000*61\r\n" + "$GPRMC,094055.000,A,5409.998645,N,00859.370546,E,0.044,0.00,301206,,,A*55\r\n" + "$GPGGA,094056.000,5409.998657,N,00859.370528,E,1,12,0.82,-5.168,M,45.414,M,,*47\r\n" + "$GPRMC,094056.000,A,5409.998657,N,00859.370528,E,0.263,0.00,301206,,,A*5A\r\n" + "$GPGGA,094057.000,5409.998726,N,00859.370512,E,1,12,0.82,-5.171,M,45.414,M,,*40\r\n" + "$GPRMC,094057.000,A,5409.998726,N,00859.370512,E,0.311,0.00,301206,,,A*51\r\n" + "$GPGGA,094058.000,5409.998812,N,00859.370518,E,1,12,0.82,-5.172,M,45.414,M,,*4E\r\n" + "$GPRMC,094058.000,A,5409.998812,N,00859.370518,E,0.423,0.00,301206,,,A*5A\r\n" + "$GPGGA,094059.000,5409.998934,N,00859.370505,E,1,12,0.82,-5.177,M,45.414,M,,*43\r\n" + "$GPRMC,094059.000,A,5409.998934,N,00859.370505,E,0.576,0.00,301206,,,A*53\r\n" + "$GPGGA,094100.000,5409.999097,N,00859.370542,E,1,12,0.82,-5.177,M,45.414,M,,*4C\r\n" + "$GPRMC,094100.000,A,5409.999097,N,00859.370542,E,0.705,0.00,301206,,,A\r\n" + "$GPGGA,004037.851,0000.0000,N,00000.0000,E,0,00,50.0,0.0,M,0.0,M,0.0,0000*7A\r\n" + "$GPGGA,175218.255,4657.3391,N,00726.2666,E,1,04,9.0,568.6,M,48.0,M,0.0,0000*7B\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.08\r\n" + "$GPRMC,175218.255,A,4657.3391,N,00726.2666,E,0.$GPGGA,175219.255,4657.3391,N,00726.2666,E,1,04,9.0,568.5,M,48.0,M,0.0,0000*79\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.7*38\r\n" + "$7,,*06\r\n" + "$GPGGA,175220.255,4657.3392,N,00726.2667,E,1,04,9.0,568.4,M,48.0,M,0.0,0000*70\r\n" + "$GPGSA,A,3,26,29,17,12,,,,$GPGGA,175221.255,4657.3392,N,00726.2667,E,1,04,9.0,568.3,M,48.0,M,0.0,0000*76\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.7*38\r\n" + "$GPRMC,175221.255,A,4657.3392,N,00726.2667,E,0.14,150.24,230507,,*0A\r\n" + "$GPGGA,175222.255,4657.3393,N,00726.2668,E,1,04,9.0,568,29,17,12,,,,,,,,,9.5,9.0,2.7*38\r\n" + "$GPGSV,2,1,08,26,71,153,45,29,60,14$GPGGA,175223.255,4657.3393,N,00726.2669,E,1,04,9.0,568.2,M,48.0,M,7.3393,N,00726.2669,E,0.11,141.32,230507,,*05\r\n" + "$GPGGA,175224.255,4657.3394,N,00726.2670,E,1,04,9.0,568.0,M,48.0,M,0.0,0000*70\r\n" + "$GPGSA,$GPGGA,175225.255,4657.3395,N,00726.2670,E,1,04,9.0,567.8,M,48.0,M,0.0,0000*77\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.7*38\r\n" + "$GPRMC,175225.255,A,4657.3395,N,00726.2670,E,0.10,146.99,230507,,*0A\r\n" + "$GPGGA,175226.255,465567.5,M,48.0,M,0.0,0000*7B\r\n" + "$GPGSA,A,3,26,29,17,12$GPGGA,175227.255,4657.3397,N,00726.2671,E,1,04,9.0,567.1,M,48.0,M,0.0,0000*7F\r\n" + "$.7*38\r\n" + "$GPGSV,2,1,08,26,71,153,46,29,60,149,46,09,55,286,00,28,32,051$GPGGA,175228.254,4657.3399,N,00726.2672,E,1,04,9.0,566.8,M,48.0,M,0.0,0000*74\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.72,E,0.12,146.43,230507,,*0D\r\n" + "$GPGGA,175229.254,4657.3400,N,00726.2673,E,1,04,9.0,566.4,M,48.0,M,0.0,0000*7F\r\n" + "$GPGSA,A,3,26,29,17,1$GPGGA,175230.254,4657.3401,N,00726.2675,E,1,04,9.0,566.0,M,48.0,M,0.0,0000*74\r\n" + "$GPGSA,A,3,26,29,17,12$GPGGA,175231.254,4657.3402,N,00726.2676,E,1,04,9.0,565.7,M,48.0,M,0.0,0000*71\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.7*38\r\n" + "$GPRMC,175231.2$GPGGA,175232.254,4657.3404,N,00726.2677,E,1,04,9.,153,45,29,60,149,46,09,55,286,00,28,32,051,00*7F\r\n" + "$GPGSV,2,2,08,17,32,102,38,18,28,298,00,12,12,21$GPGGA,175233.254,4657.3405,N,00726.2678,E,1,04,9.0,565.1,M,48.0,M,0.0,0000*7C\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$,*09\r\n" + "$GPGGA,175234.254,4657.3406,N,00726.2679,E,1,04,9.0,564.9,M,48.0,M,0.0,0000*70\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175234.254,A,4657.3$GPGGA,175235.254,4657.3408,N,00726.2680,E,1,04,9.00,M,0.0,0000*76\r\n" + "$GPGSA,A,3,26,$GPGGA,175236.254,439\r\n" + "$GPRMC,175236.254,A,4657.3409,N,00726.2681,E,0.14,142.56,230507,,*06\r\n" + "$GPGGA,175237.254,4657.3410,N,00726.2682,E,1,04,9.0,564.5,M,48.0,M,0.0,0000*7C\r\n" + "$GPGSA,A,3,26,29,17,12,,,,00,28,32,051,00*7F\r\n" + "$GPGSV,2,2,08,17,32,102,39,18,28,298,00,12,12,218,35,22,09,3$GPGGA,175238.254,4657.3411,N,00726.2682,E,1,04$GPGGA,175239.254,4657.3412,N,00726.2683,E,1,04,9.0,564.7,M,48.0,M,0.0,0000*73\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175239.254,A,4657.3412,N$GPGGA,175240.254,4657.3412,N,00726.2684,E,1,04,9.0,564.8,M,48.0,M,0.0,0000*75\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,$GPGGA,175241.254,4657.3413,N,00726.2684,E,1,04,9.0,565.1,M,48.0,M,0.0,0000*7D\r\n" + ",,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175241.254,A,4657.3413,N,00726.2684,E,0.$GPGGA,175242.254,4657.3413,N,00726.2684,E,1,04,9.0,565.3,M,48.0,M,0.0,0000*7C\r\n" + "$GPGSA,A,3,26,29,179,60,149,46,09,55,286,00,28,32,051,00*7C\r\n" + "$GPGS$GPGGA,175243.254,4657.3414,N,00726.2685,E,1,04,9.0,565.7,M,48.0,M,0.0,0000*7F\r\n" + "$GPGSA,A,3$GPGGA,175244.253,4657.3414,N,00726.2685,E,1,04,9.0,566.0,M,48.0,M,0.0,0000*7B\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPGGA,175245.253,4657.3415,N,00726.2685,E,1,04,9.0,566.3,M,48.0,M,0.0,0000*78\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175245.253,A,4657.3415,N,00726.2685,E,0.2$GPGGA,175246.253,4657.3415,N,00726.2686,E,1,04,9.0,566.5,M,48.0,M,0.0,0000*7E\r\n" + ",175246.253,A,4657.3415,N,00726.2686,E,0.13,145$GPGGA,175247.253,4657.3416,N,00726.2686,E,1,04,9.0,566.8,M,48.0,M,0.0,0000*71\r\n" + "$GPGSA,A,3,26,17,32,101,39*7D\r\n" + "$GPGSV,2,2,08,28,32,051,00,18,$GPGGA,175248.253,4657.3417,N,00726.2686,E,1,04,9.0,567.0,M,48.0,M,0.0,0000*76\r\n" + "$GPGSA,A,3,26,29$GPGGA,175249.253,4657.3417,N,00726.2686,E,1,04.3,M,48.0,M,0.0,0000*7$GPGGA,175250.253,4657.3418,N,00726.2686,E,1,04,9.0,567.4,M,48.0,M,0.0,0000*74\r\n" + ".5,9.0,2.6*39\r\n" + "$GPRMC,175250.253,A,4657.3$GPGGA,175251.253,4657.3418,N,00726.2687,E,1,04,9.0,567.5,M,48.0,M,0.0,0000*75\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + ".2687,E,0.14,146.26,230507,,*05\r\n" + "$GPGGA,175252.253,4657.,00,18,28,298,00,12,12,218,36,22,09,326,00*7E\r\n" + "$GPRMC,175252.253,A,4657.3419,N,04,9.0,567.9,M,48.0,M,0.0,0000*7A\r\n" + "$GPGSA,A,3,26,29,17,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175253.253,A,4657.$GPGGA,175254.253,4657.3420,N,00726.2687,E,1,0417,12,,,,,,,,,9.5,9.0,2.6*39\r\n" + "$GPRMC,175254.253,A,4657.3420,N,00726.26$GPGGA,175255.253,4657.3421,N,00726.2688,E,1,04,9.0,568.4,M,48.0,M,0.0,0000*7A\r\n" + "$GPGSA,A,,E,0.16,151.85,230507,,*09\r\n" +}; +#endif + + +/*************************************************************************/ + +/* + * open the specified serial port for read/write + * @return port file descriptor or -1 + */ + +#ifndef EMULATE +static int openPort(const char *tty, int baud) +{ + int status; + int fd; + struct termios newtio; + + /* open the tty */ + fd = open(tty, O_RDWR | O_NOCTTY); + if (fd < 0) { + error("openPort: error open"); + return fd; + } + + /* flush serial port */ + status = tcflush(fd, TCIFLUSH); + if (status < 0) { + error("openPort: error tcflush"); + close(fd); + return -1; + } + + /* get current terminal state */ + tcgetattr(fd, &newtio); + + /* set to raw terminal type */ + newtio.c_cflag = baud | CS8 | CLOCAL | CREAD; + newtio.c_iflag = IGNBRK | IGNPAR; + newtio.c_oflag = 0; + + /* control parameters */ + newtio.c_cc[VMIN] = 1; /* block for at least one charater */ + + /* set its new attrigutes */ + status = tcsetattr(fd, TCSANOW, &newtio); + if (status < 0) { + //error("tcsetattr() failed: %s", strerror(errno)); + error("tcsetattr() failed: __ERRNO removed due lazy coder"); + close(fd); + fd = -1; + return fd; + } + return fd; +} +#endif + +/** called when a gpgga message is received and parsed */ +static void gpgga_callout( __attribute__ ((unused)) nmeap_context_t * context, void *data, __attribute__ ((unused)) + void *user_data) +{ + nmeap_gga_t *gga = (nmeap_gga_t *) data; + + altitude = gga->altitude; + satellites = gga->satellites; + quality = gga->quality; + gpsTime = gga->time; + + if (debug == 1) + debug("gps:debug: get gga callout\n"); + +} + + +//search a buffer for a string (forwards) +int strLastOcc(char *theBuffer, char searchChar, int size) +{ + int i, ret; + + ret = -1; + for (i = size; i >= 0; i--) { + if (theBuffer[i] == searchChar) { + ret = i; + break; + } + } + return ret; +} + +//search a buffer for a string (backwards) +int strFirstOcc(char *theBuffer, char searchChar, int size) +{ + int i, ret; + ret = -1; + for (i = 0; i < size; i++) { + if (theBuffer[i] == searchChar) { + ret = i; + break; + } + } + return ret; +} + + + +/** called when a gprmc message is received and parsed */ +static void gprmc_callout( __attribute__ ((unused)) nmeap_context_t * context, void *data, __attribute__ ((unused)) + void *user_data) +{ + nmeap_rmc_t *rmc = (nmeap_rmc_t *) data; + + speed = rmc->speed; + gpsStatus = rmc->warn; + gpsTime = rmc->time; + gpsDate = rmc->date; + + if (debug == 1) + debug("gps:debug: get rmc callout\n"); + +} + + +static int prepare_gps_parser() +{ + int status; + char *port = "/dev/usb/tts/1"; + char *test; + int speed = 0; // 0 = default 4800 baud, 1 is 9600 baud + + if ((test = getenv("GPS_PORT"))) { /* define your port via env variable */ + port = test; + } + + if ((test = getenv("GPS_9600"))) { /* define your port via env variable */ + speed = 1; + } + + /* --------------------------------------- */ + /* open the serial port device */ + /* using default 4800 baud for most GPS */ + /* --------------------------------------- */ +#ifndef EMULATE + if (speed == 0) + fd_g = openPort(port, B4800); + else + fd_g = openPort(port, B9600); + + if (fd_g < 0) { + /* open failed */ + error("GPS PLUGIN, Error: openPort %d", fd_g); + return fd_g; + } +#endif + + /* --------------------------------------- */ + /*STEP 2 : initialize the nmea context */ + /* --------------------------------------- */ + status = nmeap_init(&nmea, (void *) &user_data); + if (status != 0) { + error("GPS PLUGIN, Error: nmeap_init %d", status); + exit(1); + } + + /* --------------------------------------- */ + /*STEP 3 : add standard GPGGA parser */ + /* -------------------------------------- */ + status = nmeap_addParser(&nmea, "GPGGA", nmeap_gpgga, gpgga_callout, &gga); + if (status != 0) { + error("GPS PLUGIN, Error: nmeap_add GPGGA parser, error:%d", status); + return -1; + } + + /* --------------------------------------- */ + /*STEP 4 : add standard GPRMC parser */ + /* -------------------------------------- */ + /* status = nmeap_addParser(&nmea,"GPRMC",nmeap_gprmc,gprmc_callout,&rmc); */ + status = nmeap_addParser(&nmea, "GPRMC", nmeap_gprmc, gprmc_callout, &rmc); + if (status != 0) { + error("GPS PLUGIN, Error: nmeap_add GPRMC parser, error:%d", status); + return -1; + } + + return fd_g; +} + + + +static void parse(RESULT * result, RESULT * theOptions, RESULT * displayOptions) +{ + int rem; + int offset; + int status; + int len; + + long options; + long dispOptions; + + char buffer[BUFFER_SIZE]; + char bufferTmp[BUFFER_SIZE]; + + int validStart, validEnd; + + options = R2N(theOptions); + dispOptions = R2N(displayOptions); + //error("options: %x\n",options); + + if (dispOptions & OPTION_DEBUG) + debug = 1; + + if ((dispOptions & OPTION_GET_BUFFERDATA) == 0) { + + /* ---------------------------------------- */ + /* STEP 6 : get a buffer of input */ + /* --------------------------------------- */ + + memset(buffer, 0, BUFFER_SIZE); + if (fndStr > BUFFER_SIZE) + fndStr = 0; + //copy unfinished nmea strings back + if (fndStr > 0) { + memcpy(buffer, backBuffer, fndStr); + } +#ifdef EMULATE + memcpy(&buffer[fndStr], &test_vector[emu_read_ofs], BUFFER_SIZE - fndStr); + + len = rem = EMU_BUFFER_READ_SIZE; + emu_read_ofs += EMU_BUFFER_READ_SIZE; + if (emu_read_ofs > (sizeof(test_vector) - BUFFER_SIZE)) { + emu_read_ofs = 0; + memset(buffer, 0, BUFFER_SIZE); + } +#else + + len = rem = read(fd_g, buffer, BUFFER_SIZE - fndStr); + if (len <= 0) { + error("GPS Plugin, Error read from port, try using the GPS_PORT env variable (export GPS_PORT=/dev/mydev)"); + //break; + } + if (debug == 1) + debug("gps:debug: read %d bytes\n", len); + +#endif + if (dispOptions & OPTION_RAW_NMEA) + printf("\n__[%s]", buffer + '\0'); + + /* ---------------------------------------------- */ + /* STEP 7 : process input until buffer is used up */ + /* ---------------------------------------------- */ + validStart = strFirstOcc(buffer, '$', len); + validEnd = strLastOcc(buffer, '\n', len); + + if (validStart >= 0 && validEnd > 0 && validStart < validEnd) { + //valid string found + memcpy(bufferTmp, buffer, sizeof(buffer)); //save buffer + memset(backBuffer, 0, sizeof(backBuffer)); //clear backup buffer + memcpy(backBuffer, buffer + validEnd, len - validEnd); // save incomplete nmea string + memset(buffer, 0, sizeof(buffer)); //clean buffer + memcpy(buffer, bufferTmp + validStart, validEnd - validStart + 1); //copy valid name string + fndStr = len - validEnd + validStart; //save the size of the buffer + } else { + //no valid nmea string found + fndStr = 0; + memset(buffer, 0, sizeof(buffer)); + memset(backBuffer, 0, sizeof(backBuffer)); + } + + offset = 0; + if (debug == 1) + debug("backBuffer: %s\n", backBuffer); + + //the nmeap_parseBuffer function needs whole nmea strings, combined string will NOT work! + validStart = strFirstOcc(buffer, '$', len); + validEnd = strFirstOcc(buffer, '\n', len); + while (validStart >= 0 && validEnd > 0 && validStart < validEnd) { + memset(bufferTmp, 0, sizeof(bufferTmp)); //empty temp buffer + memcpy(bufferTmp, buffer + offset + validStart, validEnd - validStart + 1); //fill temp buffer + + if (debug == 1) + debug("submit: %s\n", bufferTmp); + + rem = len - offset; + status = nmeap_parseBuffer(&nmea, (const char *) &bufferTmp, &rem); //parse it + if (status == -1) { + errCounter++; + error("parser error occurred! (cnt: %i)\n", errCounter); + } else if (status == 0) { + incomplCounter++; + } else if (status > 0) + msgCounter++; + + offset += validEnd - validStart + 1; //update offset + validStart = strFirstOcc(buffer + offset, '$', len - offset); //find next sentence + validEnd = strFirstOcc(buffer + offset, '\n', len - offset); + } + + +/* while (rem > 0) { + status = nmeap_parseBuffer(&nmea, &buffer[offset], &rem); + debug("\nGPS::debug: remaining: %d bytes\n",rem); + offset += (len - rem); + }*/ + } // end of OPTION get bufferdata + + + /* --------------------------------------- */ + /* DISPLAY stuff comes here... */ + /* --------------------------------------- */ + char *value = " "; + char outputStr[80]; + memset(outputStr, 0, 80); + + if (options & SHOW_ALTITUDE) { + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%.0f ", outputStr, altitude); + else + sprintf(outputStr, "%salt:%.0f ", outputStr, altitude); + } + if (options & SHOW_SPEED) { + float knotsConvert = 1.852f; //default speed display=km/h + if (dispOptions & OPTION_SPEED_IN_KNOTS) + knotsConvert = 1.0f; //use knots + + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%.0f ", outputStr, speed * knotsConvert); + else + sprintf(outputStr, "%sspd:%.0f ", outputStr, speed * knotsConvert); + } + if (options & SHOW_COURSE) { + char courses[8][3] = { "N ", "NO", "O ", "SO", "S ", "SW", "W ", "NW" }; + float degrees[8] = { 22.5f, 67.5f, 112.5f, 157.5f, 202.5f, 247.5f, 292.5f, 337.5f }; + int selectedDegree = 0; + int n; + + for (n = 0; n < 8; n++) { + if (course < degrees[n]) { + selectedDegree = n; + break; + } + } + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%s ", outputStr, courses[selectedDegree]); + else + sprintf(outputStr, "%sdir:%s ", outputStr, courses[selectedDegree]); + } + if (options & SHOW_SATELLITES) { + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%d ", outputStr, satellites); + else + sprintf(outputStr, "%ssat:%d ", outputStr, satellites); + } + if (options & SHOW_QUALITY) { + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%d ", outputStr, quality); + else + sprintf(outputStr, "%squa:%d ", outputStr, quality); + } + if (options & SHOW_STATUS) { + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%c ", outputStr, gpsStatus); + else + sprintf(outputStr, "%ssta:%c ", outputStr, gpsStatus); + } + if (options & SHOW_TIME_UTC) { + char digitizer[9]; //01:34:67 + sprintf(digitizer, "%.6ld", gpsTime); //<012345> + digitizer[7] = digitizer[5]; + digitizer[6] = digitizer[4]; + digitizer[4] = digitizer[3]; + digitizer[3] = digitizer[2]; + digitizer[2] = ':'; + digitizer[5] = ':'; + digitizer[8] = '\0'; + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%s ", outputStr, digitizer); + else + sprintf(outputStr, "%sutc:%s ", outputStr, digitizer); + } + if (options & SHOW_DATE) { + char digitizer[9]; //01:34:67 + sprintf(digitizer, "%.6ld", gpsDate); //<012345> + digitizer[7] = digitizer[5]; + digitizer[6] = digitizer[4]; + digitizer[4] = digitizer[3]; + digitizer[3] = digitizer[2]; + digitizer[2] = '/'; + digitizer[5] = '/'; + digitizer[8] = '\0'; + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%s ", outputStr, digitizer); + else + sprintf(outputStr, "%sdat:%s ", outputStr, digitizer); + } + + + if (dispOptions & SHOW_NMEA_STATUS) { + if (dispOptions & OPTION_NO_PREFIX) + sprintf(outputStr, "%s%04d/%04d/%04d ", outputStr, msgCounter, errCounter, incomplCounter); + else + sprintf(outputStr, "%sOK:%03d/Er:%03d/In:%03d ", outputStr, msgCounter, errCounter, incomplCounter); + } + + if (options == 0 && dispOptions == 0) { //error, no parameter defined! + error("gps::parse() ERROR, no parameter specified!"); + value = strdup("GPS ARG ERR"); + } else { + value = strdup(outputStr); + } + + SetResult(&result, R_STRING, value); + free(value); +} + + +/* plugin initialization */ +/* MUST NOT be declared 'static'! */ +int plugin_init_gps(void) +{ + info("%s: v%s", Name, "0.2"); + prepare_gps_parser(); + + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("gps::parse", 2, parse); + + return 0; +} + +void plugin_exit_gps(void) +{ + info("%s: shutting down plugin.", Name); +#ifndef EMULATE + close(fd_g); +#endif +} diff --git a/plugin_hddtemp.c b/plugin_hddtemp.c new file mode 100644 index 0000000..6d3d8a1 --- /dev/null +++ b/plugin_hddtemp.c @@ -0,0 +1,282 @@ +/* $Id: plugin_hddtemp.c 950 2009-01-08 14:59:24Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_hddtemp.c $ + * + * plugin hddtemp + * + * Copyright (C) 2007 Scott Bronson <brons_lcd4linux@rinspin.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* Example: + * (I tried to put this info on the wiki but Akismet claimed it was spam) + + Widget SmallHDDTemp { + class 'Text' + expression hddtemp('/dev/hda') + width 4 + precision 1 + align 'R' + update tick + } + + hddtemp home page: http://www.guzu.net/linux/hddtemp.php + + Quick Examples: + * hddtemp() -- return temperature of first drive (order is defined by the hddtemp daemon). + * hddtemp('/dev/hda') -- return temperature of /dev/hda on localhost. + * hddtemp('ST3400832A') -- return temperature of the drive with the given ID. + * hddtemp('burly', '') -- return temperature of the first drive on host burly. + * hddtemp('burly', 17634, '/dev/hda') -- return temperature of /dev/hda on burly connecting to the hddtemp daemon listening on port 17634. + +You can find out what drives are being monitored by running + telnet HOST PORT + +i.e. + + $ telnet localhost 7634 + Trying 127.0.0.1... + Connected to localhost. + Escape character is '^]'. + |/dev/hda|ST3400832A|53|C|Connection closed by foreign host. + +This tells me that /dev/hda is a Seagate ST3400832A running at an awfully +toasty 53 degC. + + */ + + +/* + * exported functions: + * + * int plugin_init_hddtemp (void) + * adds various functions + * void plugin_exit_hddtemp (void) + * + */ + +#include "config.h" + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +/* network specific includes */ +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#include <arpa/inet.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" + + + +static int socket_open(const char *name, int port) +{ + struct sockaddr_in server; + struct hostent *host_info; + unsigned long addr; + int sock; + + sock = socket(PF_INET, SOCK_STREAM, 0); + if (sock < 0) { + error("[hddtemp] failed to create socket: %s", strerror(errno)); + return -1; + } + + memset(&server, 0, sizeof(server)); + if ((addr = inet_addr(name)) != INADDR_NONE) { + memcpy((char *) &server.sin_addr, &addr, sizeof(addr)); + } else { + host_info = gethostbyname(name); + if (NULL == host_info) { + error("[hddtemp] Unknown server: %s", name); + return -1; + } + memcpy((char *) &server.sin_addr, host_info->h_addr, host_info->h_length); + } + + server.sin_family = AF_INET; + server.sin_port = htons(port); + + if (connect(sock, (struct sockaddr *) &server, sizeof(server)) < 0) { + error("[hddtemp] can't connect to server %s: %s", name, strerror(errno)); + return -1; + } + + return sock; +} + + +static size_t hddtemp_read(int socket, char *buffer, size_t size) +{ + size_t count = 0; + ssize_t len; + + while (count < size) { + len = read(socket, buffer + count, size - count); + if (len > 0) { + count += len; + } else if (len < 0) { + error("[hddtemp] couldn't read from socket: %s", strerror(errno)); + return -1; + } else { + break; /* remote socket has closed */ + } + } + + // null-terminate the string + if (count < size) { + buffer[count] = '\0'; + } else { + buffer[size - 1] = '\0'; + } + + return count; +} + + +static int hddtemp_connect(const char *host, int port, char *buffer, size_t size) +{ + int socket, ret; + + socket = socket_open(host, port); + if (socket < 0) { + error("[hddtemp] Error accessing %s:%d: %s", host, port, strerror(errno)); + return -1; + } + + ret = hddtemp_read(socket, buffer, size); + close(socket); + + return ret; +} + + +/* split a value into columns and return the nth column */ +/* WARNING: does return a pointer to a static string!! */ +static char *split(const char *value, const int column) +{ + static char buffer[256]; + const char *p, *q, *v; + size_t l; + int c; + + c = 0; + p = value; + q = NULL; + for (v = value; v && *v; v++) { + if (*v == '|') { + if (c == column) { + q = v; + break; + } else { + p = v + 1; + } + c++; + } + } + + if (c < column) + return NULL; + + l = q ? (size_t) (q - p) : strlen(p); + if (l >= sizeof(buffer)) + l = sizeof(buffer) - 1; + strncpy(buffer, p, l); + + buffer[l] = '\0'; + return buffer; +} + +static char *hddtemp_fetch(const char *host, int port, const char *device) +{ + char buffer[4096]; + char *key; + int i; + + /* fetch a buffer of all hddtemps */ + if (!hddtemp_connect(host, port, buffer, sizeof(buffer))) { + return "err"; + } + + i = 1; + while (1) { + key = split(buffer, i); + if (key == NULL) + break; + if (strcmp(device, key) == 0) { + return split(buffer, i + 2); + } + i += 5; + } + + return "n/a"; +} + + +static void my_hddtemp(RESULT * result, int argc, RESULT * argv[]) +{ + char *device = ""; + int port = 7634; + char *host = "localhost"; + char *value; + + switch (argc) { + case 0: + break; + case 1: + device = R2S(argv[0]); + break; + case 2: + host = R2S(argv[0]); + device = R2S(argv[1]); + break; + case 3: + host = R2S(argv[0]); + port = (int) R2N(argv[1]); + device = R2S(argv[2]); + break; + default: + error("hddtemp(): too many parameters"); + SetResult(&result, R_STRING, ""); + return; + } + + value = hddtemp_fetch(host, port, device); + SetResult(&result, R_STRING, value); +} + + +int plugin_init_hddtemp(void) +{ + AddFunction("hddtemp", -1, my_hddtemp); + + return 0; +} + + +void plugin_exit_hddtemp(void) +{ +} diff --git a/plugin_huawei.c b/plugin_huawei.c new file mode 100644 index 0000000..fbe73b8 --- /dev/null +++ b/plugin_huawei.c @@ -0,0 +1,1169 @@ +/* $Id: plugin_huawei.c 870 2008-04-10 14:55:23Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_huawei.c $ + * + * plugin plugin_huawei. Copyright (C) 2010 Jar <jar@pcuf.fi> + * + * Huawei E220 3G modem statistics via /dev/ttyUSB* user interface. It may (or may not) work well + * with other Huawei 3G USB modems too (which uses PPP interface between modem and computer), like + * E160, E169, E226, E272, E230 etc. Since they all seem to use same kind of set AT commands and + * responses. Tested with Huawei E220, E160E and Vodafone Huawei K3565. + * + * Thanks to Mikko <vmj@linuxbox.fi> for contributing the scan_uint() function and some other code. + * + * Based on sample plugin which is + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +/* define the include files you need */ +#include "config.h" + +#include <stdio.h> /* standard buffered input/output */ +#include <stdlib.h> /* standard library definitions */ +#include <stdarg.h> /* for va_start et al */ +#include <string.h> /* string operations */ +#include <unistd.h> /* read(), close() */ +#include <fcntl.h> /* open() */ +#include <termios.h> /* tcflush() */ +#include <sys/types.h> /* data types */ +#include <sys/stat.h> /* stat structure */ +#include <sys/time.h> /* timeval structure */ +#include <errno.h> /* system error numbers */ + + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" + + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + +#define PORT "/dev/ttyUSB1" /* default port */ +#define BAUDRATE B38400 /* default baudrate */ +#define SEND_BUFFER_SIZE 128 /* send buffer size */ +#define RECV_BUFFER_SIZE 256 /* receive buffer size */ +#define MIN_INTERVAL 100 /* minimum query interval 100 ms */ + + +#define INIT_STRING "ATE1 ^CURC=0;^DSFLOWCLR" /* disable unsolicited report codes and reset DS traffic + * with local echo enabled + */ +#define QUALITY "ATE1 +CSQ" /* signal quality query with local echo enabled */ +#define SYSINFO "ATE1 ^SYSINFO" /* network access query with local echo enabled */ +#define MANUF "ATE1 +GMI" /* manufacturer query with local echo enabled */ +#define MODEL "ATE1 +GMM" /* model query with local echo enabled */ +#define FWVER "ATE1 +CGMR" /* firmware version query with local echo enabled */ +#define FLOWREPORT "ATE1 ^DSFLOWQRY" /* DS traffic query with local echo enabled */ +#define OPERATOR "ATE1 +COPS=3,0;+COPS?" /* gsm/umts operator query (3=set format only, 0=long alphanum. string) + * with local echo enabled + */ + +static char name[] = "plugin_huawei.c"; + +static char *sub_system_mode[] = { + "NO CONN", /* no service */ + "GSM", /* 2G/GSM */ + "GPRS", /* 2.5G/GPRS */ + "EDGE", /* 2.75G/EDGE */ + "WCDMA", /* 3G/UMTS */ + "HSDPA", /* 3.5G/UMTS */ + "HSUPA", /* 3.5G/UMTS */ + "HSPA", /* HSDPA+HSUPA */ + "UNKNOWN" +}; + +static int fd = -2; /* serial fd */ +static char *port = NULL; /* serial device */ + +/* signal strength query */ +static unsigned int rssi = 0; /* relative rssi 0...31 */ +static unsigned int ber = 0; /* ber (bit error rate, not supported) */ + +/* manufacturer query */ +static char manuf[32] = ""; /* manufacturer */ + +/* model query */ +static char model[32] = ""; /* model */ + +/* fw version query */ +static char fwver[32] = ""; /* firmware version */ + +/* gsm/umts operator query */ +static char operator[64] = ""; /* current gsm/umts network operator */ + +/* DS traffic report query */ +static unsigned long int last_ds_time = 0; /* last DS connection time [s] */ +static unsigned long long int last_tx_flow = 0; /* last DS transmiting trafic [Bytes] */ +static unsigned long long int last_rx_flow = 0; /* last DS receiving trafic [Bytes] */ +static unsigned long int total_ds_time = 0; /* total DS connection time [s] */ +static unsigned long long int total_tx_flow = 0; /* total transmitting DS traffic [Bytes] */ +static unsigned long long int total_rx_flow = 0; /* total receiving DS traffic [Bytes] */ + +static double calc_tx_rate = 0; /* calculated tx rate */ +static double calc_rx_rate = 0; /* calculated rx rate */ + +/* system information query */ +static unsigned int status = 0; /* system service state */ +static unsigned int domain = 0; /* system service domain */ +static unsigned int roaming_status = 0; /* roaming status */ +static unsigned int mode = 0; /* system mode */ +static unsigned int sim_state = 0; /* SIM card state */ +static unsigned int reserved = 0; /* reserved, E618 used it to indicate the simlock state */ +static unsigned int sub_mode = 0; /* system sub mode */ + +static int debug = 0; /* enable debug messages */ + + +static int age_diff(struct timeval prev_age) +{ + int diff; + struct timeval now; + + gettimeofday(&now, NULL); + diff = (now.tv_sec - prev_age.tv_sec) * 1000 + (now.tv_usec - prev_age.tv_usec) / 1000; + + return diff; +} + +static int scan_uint(const char *str, unsigned int nargs, ...) +{ + unsigned int wall = 0; + unsigned int i = 0; /* number of parsed numbers */ + unsigned int *a = NULL; /* pointer to currently parsed number (type + must be that of the actual arguments) */ + + /* initialize the argument list */ + va_list argv; + va_start(argv, nargs); + + if (nargs > 0) { + /* initialize to first argument */ + a = va_arg(argv, unsigned int *); + /* initialize it to zero */ + *a = 0; + } + + /* loop through the argument list and the string */ + while (str && *str && wall < 1024) { + switch (*str) { + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '0': + /* intent: multiply current value of 'a' with 10 and add + numeric value of character str) */ + if (i < nargs) { + *a = ((*a) * 10) + ((*str) - '0'); + } + break; + + case ',': + if (++i < nargs) { + /* proceed to next argument */ + a = va_arg(argv, unsigned int *); + /* initialize it to zero */ + *a = 0; + } else { + /* this was the last number to parse */ + /* (comma indicates that there are more) */ + } + break; + + default: + /* ignore any unknown characters */ + break; + } + + /* proceed to next character */ + str++; + wall++; + } + + /* fill any extraneous arguments with zero */ + if (str && !(*str) && i < nargs - 1) { + unsigned int j = i; + for (j++; j < nargs; j++) { + a = va_arg(argv, unsigned int *); + *a = 0; + } + } + + /* finalize the argument list */ + va_end(argv); + + /* return the number of parsed numbers */ + return (int) (i > 0) ? i + 1 : i; +} + +static int huawei_port_exists(const char *device) +{ + int ret; + struct stat stat_ptr; + + /* check the device is present */ + ret = stat(device, &stat_ptr); + if (ret < 0) + return 0; + + /* check the device is character device */ + return (S_ISCHR(stat_ptr.st_mode)); +} + +static void huawei_read_port(void) +{ + char *test; + + /* port can be defined via env variable */ + if ((test = getenv("HUAWEI_PORT"))) { + if (port != test) { + port = test; + info("%s: Using HUAWEI_PORT=%s from env variable for user interface device", name, port); + } + } else + port = PORT; + + return; +} + +static int huawei_configure_port(void) +{ + int ret; + struct termios options; + + /* open port */ + fd = open(port, O_RDWR | O_NOCTTY | O_NDELAY); + if (fd < 0) { + error("%s: ERROR: Problem opening %s. Try using the HUAWEI_PORT env variable (export HUAWEI_PORT=/dev/ttyUSB*)", + name, port); + return -1; + } + + /* enable blocking behavior with timeout */ + ret = fcntl(fd, F_SETFL, 0); + if (ret < 0) { + error("%s: ERROR: Problem setting file descriptor status flags %i", name, fd); + close(fd); + fd = -2; + return -1; + } + + /* get the current options */ + ret = tcgetattr(fd, &options); + if (ret < 0) { + error("%s: ERROR: Problem getting terminal attributes %s", name, port); + close(fd); + fd = -2; + return -1; + } + + /* set raw input */ + options.c_cflag |= (CS8 | CLOCAL | CREAD); + options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); + options.c_iflag &= ~(IGNBRK | BRKINT | IGNPAR | IGNCR | INLCR | ICRNL | + IUCLC | IXANY | IXON | IXOFF | INPCK | ISTRIP); + options.c_oflag = 0; /* raw output */ + options.c_cc[VMIN] = 0; + options.c_cc[VTIME] = 1; /* 0.1 second timeout */ + + /* set the input baud rate to BAUDRATE */ + ret = cfsetispeed(&options, BAUDRATE); + if (ret < 0) { + error("%s: ERROR: Problem setting input baud rate %s", name, port); + close(fd); + fd = -2; + return -1; + } + + /* set the output baud rate to BAUDRATE */ + ret = cfsetospeed(&options, BAUDRATE); + if (ret < 0) { + error("%s: ERROR: Problem setting output baud rate %s", name, port); + close(fd); + fd = -2; + return -1; + } + + /* set the options */ + ret = tcsetattr(fd, TCSANOW, &options); + if (ret < 0) { + error("%s: ERROR: Problem setting terminal attributes %s", name, port); + close(fd); + fd = -2; + return -1; + } + + /* flush input and output buffers */ + ret = tcflush(fd, TCIFLUSH); + if (ret < 0) { + error("%s: ERROR: Problem flushing input and output buffers %s", name, port); + close(fd); + fd = -2; + return -1; + } + + return fd; +} + +static int huawei_send(const char *cmd) +{ + int len, bytes; + char buf[SEND_BUFFER_SIZE]; + + sprintf(buf, "%s\r", cmd); + len = strlen(buf); + + /* write */ + bytes = write(fd, buf, len); + + /* force null termination */ + if (bytes > 0) + buf[bytes] = '\0'; + else + buf[0] = '\0'; + + if (bytes < 0 && errno != EAGAIN) { + error("%s: ERROR: Writing to device %s failed: %s", name, port, strerror(errno)); + return -1; + } else if (bytes != len) { + error("%s: ERROR: Partial write when writing to device %s", name, port); + return -1; + } + + /* remove trailing CR */ + while (bytes > 0 && buf[bytes - 1] == '\r') { + buf[--bytes] = '\0'; + } + + if (debug) + debug("DEBUG: <-Send bytes=%i, send buf=%s", bytes, buf); + + return bytes; +} + +static char *huawei_receive(void) +{ + int run, count, bytes; + char c[1], *p; + static char buf[RECV_BUFFER_SIZE]; + + /* skip the plain NL's and CR's (<CR><LF><CR><LF> makes max. 4 pcs. of them) and re-read */ + for (run = 0; run < 4; run++) { + + /* pointer to the current position in the buffer */ + p = buf; + + /* set count to buffer size */ + count = RECV_BUFFER_SIZE; + + /* Read until a NL or a CR is encountered. If 'buf' fills up before newline is seen, + * exit the loop when there's still room for zero termination (count == 1). + */ + while (count > 1) { + bytes = read(fd, c, 1); + + if (*c == '\n' || *c == '\r' || (bytes < 0 && errno != EAGAIN)) + break; + + *p = *c; + p++; + count--; + } + + /* force null termination */ + *p = '\0'; + + /* now we have data (when buf len > 0), exit from for-loop and return the data to caller */ + if (strlen(buf) > 0 || (bytes < 0 && errno != EAGAIN)) + break; + } + + if (bytes < 0 && errno != EAGAIN) { + error("%s: ERROR: Reading from device %s failed: %s", name, port, strerror(errno)); + return (""); + } + + /* print bytes read and buffer data when debuging enabled */ + if (debug) + debug("DEBUG: ->Received bytes=%i, receive buf=%s", (int) strlen(buf), buf); + + return (buf); +} + +static int huawei_recv_error(const char *msg) +{ + if (strstr(msg, "ERROR") != NULL || strncmp(msg, "NO CARRIER", 10) == 0 || + strncmp(msg, "COMMAND NOT SUPPORT", 19) == 0 || strncmp(msg, "TOO MANY PARAMETERS", 19) == 0) + return 1; + + return 0; +} + +static char *huawei_send_receive(const char *cmd) +{ + int run, bytes_send, recv_seq; + char *tmp; + static char reply[RECV_BUFFER_SIZE]; + + /* send command to modem */ + bytes_send = huawei_send(cmd); + + /* start with an empty reply */ + strcpy(reply, ""); + + if (bytes_send > 0) { + + recv_seq = 0; + + /* receive modem responses (currently handle only 3 lines of responses: + * request->reply->ok|error) + */ + for (run = 0; run < 3; run++) { + + tmp = huawei_receive(); + + /* init cmd */ + if (strncmp(cmd, INIT_STRING, strlen(INIT_STRING)) == 0) { + + /* waiting local echo back after the init string has been sent */ + if (recv_seq == 0 && strncmp(tmp, INIT_STRING, strlen(INIT_STRING)) == 0) { + recv_seq = 1; + } + + /* waiting "OK" after local echo has been received */ + else if (recv_seq == 1 && strncmp(tmp, "OK", 2) == 0) { + strncpy(reply, tmp, sizeof(reply) - 1); + break; + } + + /* waiting possible "ERROR" after local echo has been received */ + else if (recv_seq == 1 && huawei_recv_error(tmp) == 1) { + strncpy(reply, tmp, sizeof(reply) - 1); + break; + } + + /* data query cmd */ + } else { + + /* waiting local echo back after the cmd has been sent */ + if (recv_seq == 0 && strncmp(tmp, cmd, strlen(cmd)) == 0) { + recv_seq = 1; + } + + /* waiting data (but not "OK" or "ERROR") after local echo has been received */ + else if (recv_seq == 1 && strlen(tmp) > 0 && huawei_recv_error(tmp) == 0) { + recv_seq = 2; + strncpy(reply, tmp, sizeof(reply) - 1); + } + + /* waiting "OK" after data has been received */ + else if (recv_seq == 2 && strncmp(tmp, "OK", 2) == 0) { + break; + } + + /* waiting possible "ERROR" after local echo has been received */ + else if (recv_seq == 1 && huawei_recv_error(tmp) == 1) { + strncpy(reply, tmp, sizeof(reply) - 1); + break; + } + } + } + } + + return (reply); +} + +static int huawei_configured(void) +{ + int port_exists, ret, bytes; + static int connected = -1, configured = 0; + char *buf; + + /* re-read port because device name may change during plugin execution */ + huawei_read_port(); + + /* check the device exists before reading on it */ + port_exists = huawei_port_exists(port); + + /* modem removed event */ + if (port_exists < 1 && (connected == -1 || connected == 1)) { + info("%s: Modem doesn't exists or has been removed, device %s is to be closed", name, port); + if (fd > 0) { + ret = close(fd); + if (ret < 0) { + error("%s: ERROR: Error when closing device %s after modem removal, ret=%i", name, port, ret); + } + fd = -2; + } + connected = 0; + } + + /* modem inserted event */ + if (port_exists > 0 && (connected == -1 || connected == 0)) { + info("%s: Modem has been inserted, device %s will be opened", name, port); + if (fd < 0) { + ret = huawei_configure_port(); + if (ret > 0) { + connected = 1; + if (debug) + debug("DEBUG: Device %s configured successfully, fd=%i", port, ret); + } else { + error("%s: ERROR: Device %s configuring failure->retrying..., ret=%i", name, port, ret); + } + } + } + + /* init variables to zero (except tx/rx total flows) when device disconnected */ + if (connected == 0) { + rssi = 0; + sub_mode = 0; + last_ds_time = 0; + total_ds_time = 0; + last_tx_flow = 0; + last_rx_flow = 0; + calc_tx_rate = 0; + calc_rx_rate = 0; + strcpy(manuf, ""); + strcpy(model, ""); + strcpy(fwver, ""); + strcpy(operator, ""); + configured = 0; + } + + /* modem initialization */ + if (connected == 1 && configured != 1) { + buf = huawei_send_receive(INIT_STRING); + bytes = strlen(buf); + + if (strncmp(buf, "OK", 2) == 0) { + configured = 1; + info("%s: Modem user inerface succesfully initialized to: \'%s\'", name, INIT_STRING); + } else { + configured = 0; + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, INIT_STRING); + } + } + + return configured; +} + +static void huawei_read_quality(const char *cmd) +{ + int bytes; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + if (strncmp(buf, "+CSQ: ", 6) == 0) { + + /* Returns relative signal strength (RSSI) and ber (not supported by modems). + * + * +CSQ: 14,99 + * rssi,ber + * + * 0 <= -113 dBm + * 1 -111 dBm + * 2 to 30 -109 dBm to -53 dBm + * 31 >= -51 dBm + * 99 unknown or unmeasurable + */ + + if (scan_uint(buf + 6, 2, &rssi, &ber) != 2) + error("%s: ERROR: Cannot parse all +CSQ: data fields, some data may be wrong or missing", name); + + if (debug) + debug("DEBUG: Relative rssi value: %u", rssi); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_sysinfo(const char *cmd) +{ + int bytes; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + if (strncmp(buf, "^SYSINFO:", 9) == 0) { + + /* Returns system information. + * + * ^SYSINFO:2,3,0,5,1,,4 + * status,domain,roaming_status,mode,SIM state,reserved,sub_mode + */ + + if (scan_uint(buf + 9, 7, &status, &domain, &roaming_status, &mode, &sim_state, &reserved, &sub_mode) != 7) + error("%s: ERROR: Cannot parse all ^SYSINFO: data fields, some data may be wrong or missing", name); + + if (debug) + debug("DEBUG: Sub mode value: %u", sub_mode); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_manuf(const char *cmd) +{ + int bytes; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + /* accept all but "ERROR" */ + if (bytes > 0 && huawei_recv_error(buf) == 0) { + + /* Returns manufacturer string. + * + * huawei + */ + strncpy(manuf, buf, sizeof(manuf) - 1); + + if (debug) + debug("DEBUG: Manufacturer string: %s", manuf); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_model(const char *cmd) +{ + int bytes; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + /* accept all but "ERROR" */ + if (bytes > 0 && huawei_recv_error(buf) == 0) { + + /* Returns model string. + * + * E220 + */ + strncpy(model, buf, sizeof(model) - 1); + + if (debug) + debug("DEBUG: Model string: %s", model); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_fwver(const char *cmd) +{ + int bytes; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + /* accept all but "ERROR" */ + if (bytes > 0 && huawei_recv_error(buf) == 0) { + + /* Returns firmware version string. + * + * 11.110.03.00.00 + */ + strncpy(fwver, buf, sizeof(fwver) - 1); + + if (debug) + debug("DEBUG: Firmware version string: %s", fwver); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_operator(const char *cmd) +{ + int bytes, i, pos = 0, copy = 0; + char *buf; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + if (strncmp(buf, "+COPS:", 6) == 0) { + + /* Returns operator string. + * + * +COPS: 0,0,"vodafone ES",2 + * reg_mode,format,operator string (based on format),network access type + */ + + /* parse "operator string" */ + for (i = 6; i <= bytes; i++) { + if (buf[i] == '\"' && copy == 0) { + i++; + copy = 1; + } else if ((buf[i] == '\"') && copy == 1) + copy = 0; + + if (copy == 1 && strlen(operator) < sizeof(operator) - 1) { + operator[pos] = buf[i]; + pos++; + } + } + + if (debug) + debug("DEBUG: Operator version string: \'%s\'", operator); + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void huawei_read_flowreport(const char *cmd) +{ + char *buf; + int bytes; + static unsigned long long int prev_tx_flow = 0, prev_rx_flow = 0; + static unsigned long int prev_ds_time = 0; + + buf = huawei_send_receive(cmd); + bytes = strlen(buf); + + if (strncmp(buf, "^DSFLOWQRY:", 11) == 0) { + + /* Returns flow report. + * + * ^DSFLOWQRY:00000E8E,0000000000333ACC,000000000A93E9AD,007B3514,000000007C0E5F69,00000007AD1AE9C6 + * last_ds_time,last_rx_flow ,last_tx_flow ,total_ds_time,total_tx_flow,total_rx_flow + */ + + if (sscanf(buf + 11, "%lX,%LX,%LX,%lX,%LX,%LX", &last_ds_time, &last_tx_flow, &last_rx_flow, &total_ds_time, + &total_tx_flow, &total_rx_flow) != 6) + error("%s: ERROR: Cannot parse all ^DSFLOWQRY: data fields, some data may be wrong or missing", name); + + /* ^DSFLOWQRY: lacks tx_rate and rx_rate values (^DSFLOWRPT has them), we try to calculate them here. + * Values comes at 2s interval. + */ + + /* tx_rate calculation */ + if (last_ds_time >= prev_ds_time + 2 && last_tx_flow > prev_tx_flow) + calc_tx_rate = ((double) (last_tx_flow - prev_tx_flow)) / ((double) (last_ds_time - prev_ds_time)); + else if (last_ds_time >= prev_ds_time + 2 && last_tx_flow == prev_tx_flow) + calc_tx_rate = 0; + + /* rx_rate calculation */ + if (last_ds_time >= prev_ds_time + 2 && last_rx_flow > prev_rx_flow) + calc_rx_rate = ((double) (last_rx_flow - prev_rx_flow)) / ((double) (last_ds_time - prev_ds_time)); + else if (last_ds_time >= prev_ds_time + 2 && last_rx_flow == prev_rx_flow) + calc_rx_rate = 0; + + /* previous values */ + prev_tx_flow = last_tx_flow; + prev_rx_flow = last_rx_flow; + prev_ds_time = last_ds_time; + + if (debug) { + debug("DEBUG: Last DS connection time [s]: %lu", last_ds_time); + debug("DEBUG: Last DS transmiting traffic [bytes]: %llu", last_tx_flow); + debug("DEBUG: Last DS receiving traffic [bytes]: %llu", last_rx_flow); + debug("DEBUG: Total DS connection time [s]: %lu", total_ds_time); + debug("DEBUG: Total DS transmiting trafic [bytes]: %llu", total_tx_flow); + debug("DEBUG: Total DS receiving trafic [bytes]: %llu", total_rx_flow); + debug("DEBUG: Calculated tx rate [bytes/s]: %lf", calc_tx_rate); + debug("DEBUG: Calculated rx rate [bytes/s]: %lf", calc_rx_rate); + } + + } else + error("%s: ERROR: Invalid or empty response: \'%s\' received for: \'%s\'", name, buf, cmd); + + return; +} + +static void my_quality(RESULT * result, RESULT * arg1) +{ + int age; + static struct timeval prev_age; + static double value; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_quality(QUALITY); + } + + /* Note: R2S stands for 'Result to String' */ + if (strncmp(R2S(arg1), "%", 1) == 0) { + /* scale rssi 0...31 to 0..100% value */ + if (rssi > 0 && rssi < 32) + value = (double) rssi *100 / 31; + else if (rssi == 0) + value = 0; + + } else if (strncmp(R2S(arg1), "dbm", 3) == 0) { + /* scale rssi 0...31 to -113 dBm...-51 dBm value */ + if (rssi > 0 && rssi < 32) + value = ((double) rssi * 2) - 113; + else if (rssi == 0) + value = -113; + + } else if (strncmp(R2S(arg1), "rssi", 4) == 0) { + /* pass through relative rssi 0...31 value */ + if (rssi > 0 && rssi < 32) + value = (double) rssi; + else if (rssi == 0) + value = 0; + + } else { + error("%s: ERROR: Argument for huawei::quality() is missing, give: '%%'|'dbm'|'rssi'", name); + value = 0; + } + + /* store result */ + SetResult(&result, R_NUMBER, &value); + + return; +} + +static void my_mode(RESULT * result, RESULT * arg1) +{ + int age; + static struct timeval prev_age; + double value_num; + char *value_str, *mode_str; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_sysinfo(SYSINFO); + } + + if (strncmp(R2S(arg1), "text", 4) == 0) { + /* sub modes 8 and 9 are unknown */ + if (sub_mode > 7) + sub_mode = 8; + + /* start with an empty string */ + value_str = strdup(""); + + /* mode string */ + mode_str = sub_system_mode[sub_mode]; + + /* allocate memory for value */ + value_str = realloc(value_str, strlen(mode_str) + 1); + + /* write mode string to value */ + strcat(value_str, mode_str); + + /* store result */ + SetResult(&result, R_STRING, value_str); + + /* free local string */ + free(value_str); + + } else if (strncmp(R2S(arg1), "number", 6) == 0) { + value_num = (double) mode; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + } else { + error("%s: ERROR: Argument for huawei::mode() is missing, give: 'text'|'number'", name); + + value_num = 0; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + } + + return; +} + +static void my_manuf(RESULT * result) +{ + int age; + static struct timeval prev_age; + char *value_str; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_manuf(MANUF); + } + + /* start with an empty string */ + value_str = strdup(""); + + /* allocate memory for value */ + value_str = realloc(value_str, strlen(manuf) + 1); + + /* write mode string to value */ + strcat(value_str, manuf); + + /* store result */ + SetResult(&result, R_STRING, value_str); + + /* free local string */ + free(value_str); + + return; +} + +static void my_model(RESULT * result) +{ + int age; + static struct timeval prev_age; + char *value_str; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_model(MODEL); + } + + /* start with an empty string */ + value_str = strdup(""); + + /* allocate memory for value */ + value_str = realloc(value_str, strlen(model) + 1); + + /* write mode string to value */ + strcat(value_str, model); + + /* store result */ + SetResult(&result, R_STRING, value_str); + + /* free local string */ + free(value_str); + + return; +} + +static void my_fwver(RESULT * result) +{ + int age; + static struct timeval prev_age; + char *value_str; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_fwver(FWVER); + } + + /* start with an empty string */ + value_str = strdup(""); + + /* allocate memory for value */ + value_str = realloc(value_str, strlen(fwver) + 1); + + /* write mode string to value */ + strcat(value_str, fwver); + + /* store result */ + SetResult(&result, R_STRING, value_str); + + /* free local string */ + free(value_str); + + return; +} + +static void my_operator(RESULT * result) +{ + int age; + static struct timeval prev_age; + char *value_str; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_operator(OPERATOR); + } + + /* start with an empty string */ + value_str = strdup(""); + + /* allocate memory for value */ + value_str = realloc(value_str, strlen(operator) + 1); + + /* write mode string to value */ + strcat(value_str, operator); + + /* store result */ + SetResult(&result, R_STRING, value_str); + + /* free local string */ + free(value_str); + + return; +} + +static void my_flowreport(RESULT * result, RESULT * arg1) +{ + int age; + unsigned int days, hours, mins, secs; + double value_num; + char value_str[32]; + static struct timeval prev_age; + + age = age_diff(prev_age); + + if (age < 0 || age >= MIN_INTERVAL) { + gettimeofday(&prev_age, NULL); + + if (huawei_configured() == 1) + huawei_read_flowreport(FLOWREPORT); + } + + if (strncmp(R2S(arg1), "uptime", 6) == 0) { + + days = last_ds_time / 86400; + hours = (last_ds_time / 3600) - (days * 24); + mins = (last_ds_time / 60) - (days * 1440) - (hours * 60); + secs = last_ds_time % 60; + + if (days > 0) + sprintf(value_str, "%u days %02u:%02u:%02u", days, hours, mins, secs); + else + sprintf(value_str, "%02u:%02u:%02u", hours, mins, secs); + + /* store result: days, hours, mins, secs */ + SetResult(&result, R_STRING, value_str); + + return; + } + + if (strncmp(R2S(arg1), "uptime_seconds", 14) == 0) { + /* uptime in seconds */ + value_num = (double) last_ds_time; + + /* store result: seconds */ + SetResult(&result, R_NUMBER, &value_num); + + return; + } + + if (strncmp(R2S(arg1), "tx_rate", 7) == 0) { + /* tx data in Bytes/s */ + value_num = calc_tx_rate; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + return; + } + + if (strncmp(R2S(arg1), "rx_rate", 7) == 0) { + /* rx data in Bytes/s */ + value_num = calc_rx_rate; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + return; + } + + if (strncmp(R2S(arg1), "total_tx", 8) == 0) { + /* total rx data in Bytes */ + value_num = (double) total_tx_flow; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + return; + } + + if (strncmp(R2S(arg1), "total_rx", 8) == 0) { + /* total rx data in Bytes */ + value_num = (double) total_rx_flow; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + return; + } + + error + ("%s: ERROR: Argument for huawei::flowreport() is missing, give: 'uptime'|'uptime_seconds'|'tx_rate'|'rx_rate'|'total_tx'|'total_rx')", + name); + value_num = 0; + + /* store result */ + SetResult(&result, R_NUMBER, &value_num); + + return; +} + +/* plugin initialization. MUST NOT be declared 'static'! */ +int plugin_init_huawei(void) +{ + /* register our functions */ + AddFunction("huawei::quality", 1, my_quality); + AddFunction("huawei::mode", 1, my_mode); + AddFunction("huawei::model", 0, my_model); + AddFunction("huawei::manuf", 0, my_manuf); + AddFunction("huawei::fwver", 0, my_fwver); + AddFunction("huawei::operator", 0, my_operator); + AddFunction("huawei::flowreport", 1, my_flowreport); + + return 0; +} + +void plugin_exit_huawei(void) +{ + int ret; + + /* close file descriptor */ + if (fd > 0) { + ret = close(fd); + if (ret < 0) + error("%s: ERROR: Device %s closing failure on plugin_exit, %i", name, port, ret); + } + fd = -2; +} diff --git a/plugin_i2c_sensors.c b/plugin_i2c_sensors.c index e47f407..ce70e35 100644 --- a/plugin_i2c_sensors.c +++ b/plugin_i2c_sensors.c @@ -1,5 +1,5 @@ -/* $Id: plugin_i2c_sensors.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_i2c_sensors.c $ +/* $Id: plugin_i2c_sensors.c 1082 2010-01-17 14:40:03Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_i2c_sensors.c $ * * I2C sensors plugin * @@ -44,7 +44,7 @@ /* * Available tokens : # represents an int from 1 to 3 (or more) - * temp_input# -> temperature of sensor # (in °C) + * temp_input# -> temperature of sensor # (in ∞C) * temp_max# and temp_hyst# -> max and min of sensor # * in_input#, in_min# and in_max# -> voltages * fan_input# -> speed (in RPM) of fan # @@ -74,6 +74,7 @@ #include "cfg.h" #include "hash.h" #include "qprintf.h" +#include "evaluator.h" // if strndup() is not available #ifdef WITH_DMALLOC #include <dmalloc.h> @@ -188,7 +189,7 @@ static int parse_i2c_sensors_procfs(const char *key) return -1; } - running = strdupa(buffer); + running = strndup(buffer, sizeof(buffer)); while (1) { value = strsep(&running, delim); /* debug("%s pos %i -> %s", file, pos , value); */ @@ -202,6 +203,7 @@ static int parse_i2c_sensors_procfs(const char *key) pos++; } } + free(running); return 0; } @@ -296,7 +298,7 @@ static int configure_i2c_sensors(void) path_cfg = realloc(path_cfg, strlen(path_cfg) + 2); strcat(path_cfg, "/"); } - debug("using i2c sensors at %s (from %s)", path, cfg_source()); + debug("using i2c sensors at %s (from %s)", path_cfg, cfg_source()); path = realloc(path, strlen(path_cfg) + 1); strcpy(path, path_cfg); } diff --git a/plugin_iconv.c b/plugin_iconv.c index 3b0e134..6d5a8a6 100644 --- a/plugin_iconv.c +++ b/plugin_iconv.c @@ -1,5 +1,5 @@ -/* $Id: plugin_iconv.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_iconv.c $ +/* $Id: plugin_iconv.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_iconv.c $ * * iconv charset conversion plugin * @@ -104,7 +104,7 @@ static void my_iconv(RESULT * result, RESULT * charset_from, RESULT * charset_to source_left = 0; break; default: - error("plugin_iconv: strange errno state (%d) occured", errno); + error("plugin_iconv: strange errno state (%d) occurred", errno); source_left = 0; } } diff --git a/plugin_imon.c b/plugin_imon.c index 222396f..c0fdc29 100644 --- a/plugin_imon.c +++ b/plugin_imon.c @@ -1,5 +1,5 @@ -/* $Id: plugin_imon.c 790 2007-04-30 04:50:30Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_imon.c $ +/* $Id: plugin_imon.c 782 2007-03-21 05:01:11Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_imon.c $ * * imond/telmond data processing * diff --git a/plugin_isdn.c b/plugin_isdn.c index 4acb6a7..a5e6972 100644 --- a/plugin_isdn.c +++ b/plugin_isdn.c @@ -1,13 +1,13 @@ -/* $Id: plugin_isdn.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_isdn.c $ +/* $Id: plugin_isdn.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_isdn.c $ * * plugin for ISDN subsystem * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * Based on the old isdn client (isdn.c) which is - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * * This file is part of LCD4Linux. * diff --git a/plugin_kvv.c b/plugin_kvv.c index d228575..f0950d3 100644 --- a/plugin_kvv.c +++ b/plugin_kvv.c @@ -1,5 +1,5 @@ -/* $Id: plugin_kvv.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_kvv.c $ +/* $Id: plugin_kvv.c 944 2009-01-06 06:46:50Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_kvv.c $ * * plugin kvv (karlsruher verkehrsverbund) * @@ -413,7 +413,7 @@ static void kvv_client( __attribute__ ((unused)) info("[KVV] empty/no reply"); if (count > 0) { - char *input, *cookie, *name, *value; + char *input, *cookie, *name = NULL, *value = NULL; int input_len, cookie_len, name_len, value_len; /* buffer to html encode value */ @@ -642,10 +642,60 @@ static int kvv_fork(void) return 0; } +static void kvv_start(void) +{ + static int started = 0; + int val; + char *p; + + + if (started) + return; + + started = 1; + + /* parse parameter */ + if ((p = cfg_get(SECTION, "StationID", DEFAULT_STATION_ID)) != NULL) { + station_id = malloc(strlen(p) + 1); + strcpy(station_id, p); + } + info("[KVV] Using station %s", station_id); + + if ((p = cfg_get(SECTION, "Proxy", NULL)) != NULL) { + proxy_name = malloc(strlen(p) + 1); + strcpy(proxy_name, p); + info("[KVV] Using proxy \"%s\"", proxy_name); + } + + if (cfg_number(SECTION, "Port", 0, 0, 65535, &val) > 0) { + port = val; + info("[KVV] Using port %d", port); + } else { + info("[KVV] Using default port %d", port); + } + + if (cfg_number(SECTION, "Refresh", 0, 0, 65535, &val) > 0) { + refresh = val; + info("[KVV] Using %d seconds refresh interval", refresh); + } else { + info("[KVV] Using default refresh interval of %d seconds", refresh); + } + + if (cfg_number(SECTION, "Abbreviate", 0, 0, 65535, &val) > 0) { + abbreviate = val; + info("[KVV] Abbreviation enabled: %s", abbreviate ? "on" : "off"); + } else { + info("[KVV] Default abbreviation setting: %s", abbreviate ? "on" : "off"); + } + +} + static void kvv_line(RESULT * result, RESULT * arg1) { int index = (int) R2N(arg1); + kvv_start(); + if (kvv_fork() != 0) { SetResult(&result, R_STRING, ""); return; @@ -665,6 +715,8 @@ static void kvv_station(RESULT * result, RESULT * arg1) { int index = (int) R2N(arg1); + kvv_start(); + if (kvv_fork() != 0) { SetResult(&result, R_STRING, ""); return; @@ -689,6 +741,8 @@ static void kvv_time(RESULT * result, RESULT * arg1) int index = (int) R2N(arg1); double value = -1.0; + kvv_start(); + if (kvv_fork() != 0) { SetResult(&result, R_STRING, ""); return; @@ -708,6 +762,8 @@ static void kvv_time_str(RESULT * result, RESULT * arg1) { int index = (int) R2N(arg1); + kvv_start(); + if (kvv_fork() != 0) { SetResult(&result, R_STRING, ""); return; @@ -728,49 +784,11 @@ static void kvv_time_str(RESULT * result, RESULT * arg1) /* plugin initialization */ int plugin_init_kvv(void) { - int val; - char *p; - /* register all our cool functions */ AddFunction("kvv::line", 1, kvv_line); AddFunction("kvv::station", 1, kvv_station); AddFunction("kvv::time", 1, kvv_time); AddFunction("kvv::time_str", 1, kvv_time_str); - - /* parse parameter */ - if ((p = cfg_get(SECTION, "StationID", DEFAULT_STATION_ID)) != NULL) { - station_id = malloc(strlen(p) + 1); - strcpy(station_id, p); - } - info("[KVV] Using station %s", station_id); - - if ((p = cfg_get(SECTION, "Proxy", NULL)) != NULL) { - proxy_name = malloc(strlen(p) + 1); - strcpy(proxy_name, p); - info("[KVV] Using proxy \"%s\"", proxy_name); - } - - if (cfg_number(SECTION, "Port", 0, 0, 65535, &val) > 0) { - port = val; - info("[KVV] Using port %d", port); - } else { - info("[KVV] Using default port %d", port); - } - - if (cfg_number(SECTION, "Refresh", 0, 0, 65535, &val) > 0) { - refresh = val; - info("[KVV] Using %d seconds refresh interval", refresh); - } else { - info("[KVV] Using default refresh interval of %d seconds", refresh); - } - - if (cfg_number(SECTION, "Abbreviate", 0, 0, 65535, &val) > 0) { - abbreviate = val; - info("[KVV] Abbreviation enabled: %s", abbreviate ? "on" : "off"); - } else { - info("[KVV] Default abbreviation setting: %s", abbreviate ? "on" : "off"); - } - return 0; } diff --git a/plugin_loadavg.c b/plugin_loadavg.c index cfb5a66..4f366a8 100644 --- a/plugin_loadavg.c +++ b/plugin_loadavg.c @@ -1,9 +1,9 @@ -/* $Id: plugin_loadavg.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_loadavg.c $ +/* $Id: plugin_loadavg.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_loadavg.c $ * * plugin for load average * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_math.c b/plugin_math.c index 413ee4e..ee589fd 100644 --- a/plugin_math.c +++ b/plugin_math.c @@ -1,9 +1,9 @@ -/* $Id: plugin_math.c 755 2007-01-21 06:40:23Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_math.c $ +/* $Id: plugin_math.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_math.c $ * * math plugin * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_meminfo.c b/plugin_meminfo.c index e006918..b7af6dc 100644 --- a/plugin_meminfo.c +++ b/plugin_meminfo.c @@ -1,9 +1,9 @@ -/* $Id: plugin_meminfo.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_meminfo.c $ +/* $Id: plugin_meminfo.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_meminfo.c $ * * plugin for /proc/meminfo parsing * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_mpd.c b/plugin_mpd.c index 5d109fd..f54c477 100644 --- a/plugin_mpd.c +++ b/plugin_mpd.c @@ -1,9 +1,11 @@ -/* $Id: plugin_mpd.c 789 2007-04-30 04:48:10Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_mpd.c $ +/* $Id: plugin_mpd.c 1044 2009-09-23 04:34:38Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_mpd.c $ * - * mpd informations + * mpd informations v0.82 * * Copyright (C) 2006 Stefan Kuhne <sk-privat@gmx.net> + * Copyright (C) 2007 Robert Buchholz <rbu@gentoo.org> + * Copyright (C) 2008 Michael Vogt <michu@neophob.com> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -25,408 +27,728 @@ */ /* - * exported functions: + * changelog v0.5 (20.11.2007): + * changed: mpd::artist(), mpd::title(), mpd::album() + * init code, call only if a function is used. + * removed: "old style" functions, duplicate code + * fixed: strdup() mem leaks + * added: getstate, function which return player status: play/pause/stop + * getVolume, funtcion which returns the mpd volume + * getFilename, return current filename * - * int plugin_init_sample (void) - * adds various functions + * + * changelog v0.6 (05.12.2007): + * changed: -connection handling + * -verbose "NO TAG" messages + * -init code + * added: -added password support (MPD_PASSWORD env variable) + * -mpd::getSongsInDb - how many songs are in the mpd db? + * -mpd::getMpdUptime - uptime of mpd + * -mpd::getMpdPlayTime - playtime of mpd + * -mpd::getMpdDbPlayTime - playtime of all songs in mpd db + * -basic error handler.. + * -mpd configuration in lcd4linux.conf + * -formatTime* - use those functions to format time values + * removed: -reprand method + * + * + * changelog v0.7 (14.12.2007): + * changed: -connection handling improved, do not disconnect/reconnect for each query + * -> uses less ressources + * + * changelog v0.8 (30.01.2008): + * changed: -libmpd is not needed anymore, use libmpdclient.c instead + * fixed: -getMpdUptime() + * -getMpdPlaytime() + * -type definition + * added: -mpd::getSamplerateHz + * -getAudioChannels + * + * changelog v0.83 (26.07.2008): + * added: -mpd::cmd* commands * */ +/* + +TODO: + -what happens if the db is updating? + +*/ #include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> +#include <signal.h> #include "debug.h" #include "plugin.h" +#include "cfg.h" +/* struct timeval */ +#include <sys/time.h> -#include <libmpd/libmpd.h> +/* source: http://www.musicpd.org/libmpdclient.shtml */ +#include "libmpd/libmpdclient.h" #ifdef WITH_DMALLOC #include <dmalloc.h> #endif -/* Struct Pointer */ - -struct Pointer { - mpd_Connection *conn; - mpd_Status *status; - mpd_InfoEntity *entity; -}; - - - -static struct Pointer connect() +#define TIMEOUT_IN_S 10 +#define ERROR_DISPLAY 5 + +/* current song */ + +static int l_totalTimeSec; +static int l_elapsedTimeSec; +static int l_bitRate; +static int l_repeatEnabled; +static int l_randomEnabled; +static int l_state; +static int l_volume; +static int l_numberOfSongs; +static unsigned long l_uptime; +static unsigned long l_playTime; +static unsigned long l_dbPlayTime; +static int l_playlistLength; +/* pos in playlist */ +static int l_currentSongPos; +static unsigned int l_sampleRate; +static int l_channels; + +static mpd_Song *currentSong; + +/* connection information */ +static char host[255]; +static char pw[255]; +static int iport; +static int plugin_enabled; +static int waittime; +struct timeval timestamp; + +static mpd_Connection *conn; +static char Section[] = "Plugin:MPD"; +static int errorcnt = 0; + + +static int configure_mpd(void) { - char *host = "localhost"; - char *port = "6600"; - int iport; - char *test; - struct Pointer mpd; + static int configured = 0; - if ((test = getenv("MPD_HOST"))) { - host = test; - } + char *s; - if ((test = getenv("MPD_PORT"))) { - port = test; - } + if (configured != 0) + return configured; - iport = strtol(port, &test, 10); + /* read enabled */ + if (cfg_number(Section, "enabled", 0, 0, 1, &plugin_enabled) < 1) { + plugin_enabled = 0; + } - if (iport < 0 || *test != '\0') { - fprintf(stderr, "MPD_PORT \"%s\" is not a positive integer\n", port); - exit(EXIT_FAILURE); + if (plugin_enabled != 1) { + info("[MPD] WARNING: Plugin is not enabled! (set 'enabled 1' to enable this plugin)"); + configured = 1; + return configured; } - mpd.conn = mpd_newConnection(host, iport, 10); + /* read server */ + s = cfg_get(Section, "server", "localhost"); + if (*s == '\0') { + info("[MPD] empty '%s.server' entry from %s, assuming 'localhost'", Section, cfg_source()); + strcpy(host, "localhost"); + } else + strcpy(host, s); - mpd_sendCommandListOkBegin(mpd.conn); - mpd_sendStatusCommand(mpd.conn); - mpd_sendCurrentSongCommand(mpd.conn); - mpd_sendCommandListEnd(mpd.conn); + free(s); - if ((mpd.status = mpd_getStatus(mpd.conn)) == NULL) { - fprintf(stderr, "%s\n", mpd.conn->errorStr); - mpd_closeConnection(mpd.conn); + /* read port */ + if (cfg_number(Section, "port", 6600, 1, 65536, &iport) < 1) { + info("[MPD] no '%s.port' entry from %s using MPD's default", Section, cfg_source()); } - if (mpd.status->error) { - printf("error: %s\n", mpd.status->error); + /* read minUpdateTime in ms */ + if (cfg_number(Section, "minUpdateTime", 500, 1, 10000, &waittime) < 1) { + info("[MPD] no '%s.minUpdateTime' entry from %s using MPD's default", Section, cfg_source()); } - if (mpd.conn->error) { - fprintf(stderr, "%s\n", mpd.conn->errorStr); - mpd_closeConnection(mpd.conn); + + /* read password */ + s = cfg_get(Section, "password", ""); + if (*s == '\0') { + info("[MPD] empty '%s.password' entry in %s, assuming none", Section, cfg_source()); + memset(pw, 0, sizeof(pw)); + } else { + strcpy(pw, s); + free(s); } - return mpd; + debug("[MPD] connection detail: [%s:%d]", host, iport); + configured = 1; + return configured; } -static void disconnect(struct Pointer mpd) +static int mpd_update() { - if (mpd.conn->error) { - fprintf(stderr, "%s\n", mpd.conn->errorStr); - mpd_closeConnection(mpd.conn); + int ret = -1; + struct timeval now; + + /* reread every 1000 msec only */ + gettimeofday(&now, NULL); + int timedelta = (now.tv_sec - timestamp.tv_sec) * 1000 + (now.tv_usec - timestamp.tv_usec) / 1000; + + if (timedelta < waittime) { + /* debug("[MPD] waittime not reached...\n"); */ + return 1; } - mpd_finishCommand(mpd.conn); - if (mpd.conn->error) { - fprintf(stderr, "%s\n", mpd.conn->errorStr); - mpd_closeConnection(mpd.conn); + /* check if configured */ + if (configure_mpd() < 0) { + return -1; + } + /* check if connected */ + if (conn == NULL || conn->error) { + if (conn) { + if (errorcnt < ERROR_DISPLAY) + debug("[MPD] Error: [%s], try to reconnect to [%s]:[%i]\n", conn->errorStr, host, iport); + mpd_closeConnection(conn); + } else + debug("[MPD] initialize connect to [%s]:[%i]\n", host, iport); + + conn = mpd_newConnection(host, iport, TIMEOUT_IN_S); + if (conn->error) { + if (errorcnt < ERROR_DISPLAY) + error("[MPD] connection failed, give up..."); + if (errorcnt == ERROR_DISPLAY) + error("[MPD] stop logging, until connection is fixed!"); + errorcnt++; + gettimeofday(×tamp, NULL); + return -1; + } + errorcnt = 0; + debug("[MPD] connection fixed..."); } - mpd_freeStatus(mpd.status); - mpd_closeConnection(mpd.conn); -} + mpd_Status *status = NULL; + mpd_Stats *stats = NULL; + mpd_InfoEntity *entity; + + mpd_sendCommandListOkBegin(conn); + mpd_sendStatsCommand(conn); + if (conn->error) { + error("[MPD] error: %s", conn->errorStr); + return -1; + } + mpd_sendStatusCommand(conn); + mpd_sendCurrentSongCommand(conn); + mpd_sendCommandListEnd(conn); -static void artist(RESULT * result, RESULT * query) -{ - char *value = " "; - struct Pointer mpd = connect(); + stats = mpd_getStats(conn); + if (stats == NULL) { + error("[MPD] error mpd_getStats: %s", conn->errorStr); + goto cleanup; + } - mpd_nextListOkCommand(mpd.conn); + mpd_nextListOkCommand(conn); + if ((status = mpd_getStatus(conn)) == NULL) { + error("[MPD] error mpd_nextListOkCommand: %s", conn->errorStr); + goto cleanup; + } - while ((mpd.entity = mpd_getNextInfoEntity(mpd.conn))) { - mpd_Song *song = mpd.entity->info.song; + mpd_nextListOkCommand(conn); + while ((entity = mpd_getNextInfoEntity(conn))) { + mpd_Song *song = entity->info.song; - if (mpd.entity->type != MPD_INFO_ENTITY_TYPE_SONG) { - mpd_freeInfoEntity(mpd.entity); + if (entity->type != MPD_INFO_ENTITY_TYPE_SONG) { + mpd_freeInfoEntity(entity); continue; } + if (currentSong != NULL) + mpd_freeSong(currentSong); - if (song->artist) { - value = strdup(song->artist); - //add comment - if (query) { - char *myarg; - myarg = strdup(R2S(query)); - value = strcat(value, myarg); - free(myarg); - } - } - mpd_freeInfoEntity(mpd.entity); + currentSong = mpd_songDup(song); + mpd_freeInfoEntity(entity); } - disconnect(mpd); + l_elapsedTimeSec = status->elapsedTime; + l_totalTimeSec = status->totalTime; + l_repeatEnabled = status->repeat; + l_randomEnabled = status->random; + l_bitRate = status->bitRate; + l_state = status->state; + l_volume = status->volume; + l_playlistLength = status->playlistLength; + l_currentSongPos = status->song + 1; + l_sampleRate = status->sampleRate; + l_channels = status->channels; - /* store result */ - SetResult(&result, R_STRING, value); + l_numberOfSongs = stats->numberOfSongs; + l_uptime = stats->uptime; + l_playTime = stats->playTime; + l_dbPlayTime = stats->dbPlayTime; - free(value); -} + /* sanity checks */ + if (l_volume < 0 || l_volume > 100) + l_volume = 0; -static void title(RESULT * result) -{ - char *value = " "; - struct Pointer mpd = connect(); + if (l_bitRate < 0) + l_bitRate = 0; - mpd_nextListOkCommand(mpd.conn); + if (l_elapsedTimeSec > l_totalTimeSec || l_elapsedTimeSec < 0) + l_elapsedTimeSec = 0; + ret = 0; - while ((mpd.entity = mpd_getNextInfoEntity(mpd.conn))) { - mpd_Song *song = mpd.entity->info.song; + cleanup: + if (stats != NULL) + mpd_freeStats(stats); - if (mpd.entity->type != MPD_INFO_ENTITY_TYPE_SONG) { - mpd_freeInfoEntity(mpd.entity); - continue; - } + if (status != NULL) + mpd_freeStatus(status); - if (song->title) { - value = strdup(song->title); - } - mpd_freeInfoEntity(mpd.entity); + if (conn->error) { + error("[MPD] error: %s", conn->errorStr); + return -1; } - disconnect(mpd); - - /* store result */ - SetResult(&result, R_STRING, value); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + return -1; + } - free(value); + gettimeofday(×tamp, NULL); + return ret; } -static void album(RESULT * result) +static void elapsedTimeSec(RESULT * result) { - char *value = " "; - struct Pointer mpd = connect(); - - mpd_nextListOkCommand(mpd.conn); - - while ((mpd.entity = mpd_getNextInfoEntity(mpd.conn))) { - mpd_Song *song = mpd.entity->info.song; + double d; + mpd_update(); + d = (double) l_elapsedTimeSec; + SetResult(&result, R_NUMBER, &d); +} - if (mpd.entity->type != MPD_INFO_ENTITY_TYPE_SONG) { - mpd_freeInfoEntity(mpd.entity); - continue; - } - if (song->album) { - value = strdup(song->album); - } - mpd_freeInfoEntity(mpd.entity); - } +static void totalTimeSec(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_totalTimeSec; + SetResult(&result, R_NUMBER, &d); +} - disconnect(mpd); +static void bitRate(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_bitRate; + SetResult(&result, R_NUMBER, &d); +} - /* store result */ - SetResult(&result, R_STRING, value); - free(value); +static void getRepeatInt(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_repeatEnabled; + SetResult(&result, R_NUMBER, &d); } -#define _mpd_dummy 000 -#define _mpd_status_get_elapsed_song_time 001 -#define _mpd_status_get_bitrate 002 -#define _mpd_status_get_total_song_time 003 -#define _mpd_player_get_repeat 004 -#define _mpd_player_get_random 005 -void error_callback(MpdObj * mi, int errorid, char *msg, void *userdata) +static void getRandomInt(RESULT * result) { - printf("Error %i: '%s'\n", errorid, msg); + double d; + mpd_update(); + d = (double) l_randomEnabled; + SetResult(&result, R_NUMBER, &d); } -static int mpd_get(int function) +/* if no tag is availabe, use filename */ +static void getArtist(RESULT * result) { - int ret = -1; - MpdObj *mi = NULL; - - mi = mpd_new("localhost", 6600, NULL); - mpd_signal_connect_error(mi, (ErrorCallback) error_callback, NULL); - mpd_set_connection_timeout(mi, 5); - - if (!mpd_connect(mi)) { - switch (function) { - case _mpd_dummy: - ret = 1; - break; - case _mpd_status_get_elapsed_song_time: - ret = mpd_status_get_elapsed_song_time(mi); - break; - case _mpd_status_get_bitrate: - ret = mpd_status_get_bitrate(mi); - break; - case _mpd_status_get_total_song_time: - ret = mpd_status_get_total_song_time(mi); - break; - case _mpd_player_get_repeat: - ret = mpd_player_get_repeat(mi); - break; - case _mpd_player_get_random: - ret = mpd_player_get_random(mi); - break; + mpd_update(); + if (currentSong != NULL) { + if (currentSong->artist != NULL) { + SetResult(&result, R_STRING, currentSong->artist); + } else { + if (currentSong->file != NULL) + SetResult(&result, R_STRING, currentSong->file); + else + SetResult(&result, R_STRING, ""); } + } else + SetResult(&result, R_STRING, ""); - mpd_disconnect(mi); - mpd_free(mi); - } - return ret; } -static void elapsedTime(RESULT * result) +static void getTitle(RESULT * result) { - char *value = " "; + mpd_update(); + if (currentSong != NULL) { + if (currentSong->title != NULL) { + SetResult(&result, R_STRING, currentSong->title); + } else + SetResult(&result, R_STRING, ""); + } else + SetResult(&result, R_STRING, ""); + +} - int playTime = mpd_get(_mpd_status_get_elapsed_song_time); +static void getAlbum(RESULT * result) +{ + mpd_update(); + if (currentSong != NULL) { + if (currentSong->album != NULL) + SetResult(&result, R_STRING, currentSong->album); + else + SetResult(&result, R_STRING, ""); + } else + SetResult(&result, R_STRING, ""); +} - if (playTime != -1) { - char myTime[6]; - memset(myTime, 0, 6); - int minutes = (int) (playTime / 60); - int seconds = (int) (playTime % 60); - sprintf(myTime, "%02d:%02d", minutes, seconds); +static void getFilename(RESULT * result) +{ + mpd_update(); + if (currentSong != NULL) { + if (currentSong->file != NULL) + SetResult(&result, R_STRING, currentSong->file); + else + SetResult(&result, R_STRING, ""); + } else + SetResult(&result, R_STRING, ""); - value = strdup(myTime); - } - // store result - SetResult(&result, R_STRING, value); } -static void elapsedTimeSec(RESULT * result) +/* + return player state: + 0=unknown + 1=play + 2=pause + 3=stop +*/ +static void getStateInt(RESULT * result) { - int playTime = mpd_get(_mpd_status_get_elapsed_song_time); - double d = 0.0; + double ret; + + mpd_update(); + + switch (l_state) { + case MPD_STATUS_STATE_PLAY: + ret = 1; + break; + case MPD_STATUS_STATE_PAUSE: + ret = 2; + break; + case MPD_STATUS_STATE_STOP: + ret = 3; + break; + default: + ret = 0; + break; + } - if (playTime != -1) - d = playTime; + SetResult(&result, R_NUMBER, &ret); +} - // store result + +static void getVolume(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_volume; + /* return 0..100 or < 0 when failed */ SetResult(&result, R_NUMBER, &d); } -static void totalTime(RESULT * result) +/* return the # of songs in the mpd db .. */ +static void getSongsInDb(RESULT * result) { - char *value = " "; + double d; + mpd_update(); + d = (double) l_numberOfSongs; + SetResult(&result, R_NUMBER, &d); +} - int totTime = mpd_get(_mpd_status_get_total_song_time); - if (totTime != -1) { - char myTime[6]; - memset(myTime, 0, 6); - int minutes = (int) (totTime / 60); - int seconds = (int) (totTime % 60); - sprintf(myTime, "%02d:%02d", minutes, seconds); +static void getMpdUptime(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_uptime; + SetResult(&result, R_NUMBER, &d); +} - value = strdup(myTime); - } else - value = strdup("ERROR"); - // store result - SetResult(&result, R_STRING, value); +static void getMpdPlayTime(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_playTime; + SetResult(&result, R_NUMBER, &d); } -static void totalTimeSec(RESULT * result) +static void getMpdDbPlayTime(RESULT * result) { - int totTime = mpd_get(_mpd_status_get_total_song_time); - double d = 0.0; + double d; + mpd_update(); + d = (double) l_dbPlayTime; + SetResult(&result, R_NUMBER, &d); +} + +static void getMpdPlaylistLength(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_playlistLength; + SetResult(&result, R_NUMBER, &d); +} - if (totTime != -1) - d = totTime; +static void getCurrentSongPos(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_currentSongPos; + SetResult(&result, R_NUMBER, &d); +} - // store result +static void getAudioChannels(RESULT * result) +{ + double d; + mpd_update(); + d = (double) l_channels; SetResult(&result, R_NUMBER, &d); } -static void bitRate(RESULT * result) +static void getSamplerateHz(RESULT * result) { - char *value = ""; + double d; + mpd_update(); + d = (double) l_sampleRate; + SetResult(&result, R_NUMBER, &d); +} - int rate = mpd_get(_mpd_status_get_bitrate); - if (rate != -1) { - char rateStr[4]; - memset(rateStr, 0, 4); - sprintf(rateStr, "%03d", rate); +static void nextSong() +{ + mpd_update(); + if (currentSong != NULL) { + mpd_sendNextCommand(conn); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } + } +} + +static void prevSong() +{ + mpd_update(); + if (currentSong != NULL) { + mpd_sendPrevCommand(conn); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } + } +} - value = strdup(rateStr); +static void stopSong() +{ + mpd_update(); + if (currentSong != NULL) { + mpd_sendStopCommand(conn); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } } - // store result - SetResult(&result, R_STRING, value); } -static void getRepeat(RESULT * result) +static void pauseSong() { - char *value = " "; + mpd_update(); + if (currentSong != NULL) { + if (l_state == MPD_STATUS_STATE_PAUSE) { + mpd_sendPauseCommand(conn, 0); + } else { + mpd_sendPauseCommand(conn, 1); + } - int rep = mpd_get(_mpd_player_get_repeat); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } + } +} - if (rep != -1) { - if (rep) - value = strdup("REP"); - // else value = strdup(" "); +static void volUp() +{ + mpd_update(); + if (currentSong != NULL) { + l_volume += 5; + if (l_volume > 100) + l_volume = 100; + mpd_sendSetvolCommand(conn, l_volume); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } } - // store result - SetResult(&result, R_STRING, value); } +static void volDown() +{ + mpd_update(); + if (currentSong != NULL) { + if (l_volume > 5) + l_volume -= 5; + else + l_volume = 0; + mpd_sendSetvolCommand(conn, l_volume); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } + } +} -static void getRandom(RESULT * result) +static void toggleRepeat() { - char *value = " "; + mpd_update(); + if (currentSong != NULL) { - int ran = mpd_get(_mpd_player_get_random); + l_repeatEnabled = !l_repeatEnabled; + mpd_sendRepeatCommand(conn, l_repeatEnabled); - if (ran != -1) { - if (ran) - value = strdup("RND"); - // else value = strdup(" "); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } } - // store result - SetResult(&result, R_STRING, value); } -static void getRepRand(RESULT * result) + +static void toggleRandom() { - char *value = " "; + mpd_update(); + if (currentSong != NULL) { - int ran = mpd_get(_mpd_player_get_random); - int rep = mpd_get(_mpd_player_get_repeat); + l_randomEnabled = !l_randomEnabled; + mpd_sendRandomCommand(conn, l_randomEnabled); - if (ran != -1 && rep != -1) { - char str[9]; - if (rep) - sprintf(str, "REP/"); - else - sprintf(str, "---/"); - if (ran) - sprintf(str, "%sRND", str); - else - sprintf(str, "%s---", str); - value = strdup(str); + mpd_finishCommand(conn); + if (conn->error) { + error("[MPD] error mpd_finishCommand: %s", conn->errorStr); + } } - // store result - SetResult(&result, R_STRING, value); } -int plugin_init_mpd(void) + +static void formatTimeMMSS(RESULT * result, RESULT * param) { - /* Check for File */ - if (mpd_get(_mpd_dummy) != 1) { - error("Error: Cannot connect to MPD! Is MPD started?"); - return -1; - } + long sec; + char myTime[6] = " "; + + sec = R2N(param); - AddFunction("mpd::artist", 1, artist); - AddFunction("mpd::title", 0, title); - AddFunction("mpd::album", 0, album); - AddFunction("mpd::totalTime", 0, totalTime); + if ((sec >= 0) && (sec < 6000)) { + const int minutes = (int) (sec / 60); + const int seconds = (int) (sec % 60); + sprintf(myTime, "%02d:%02d", minutes, seconds); + } else if (sec >= 6000) { + strcpy(myTime, "LONG"); + } else + strcpy(myTime, "ERROR"); + + /* store result */ + SetResult(&result, R_STRING, myTime); +} + +static void formatTimeDDHHMM(RESULT * result, RESULT * param) +{ + long sec; + char myTime[16] = " "; + + sec = R2N(param); + + if (sec >= 0) { + int days = sec / 86400; + int hours = (sec % 86400) / 3600; + int minutes = (sec % 3600) / 60; + sprintf(myTime, "%dd%02dh%02dm", days, hours, minutes); /* 3d 12:33h */ + } else + strcpy(myTime, "ERROR"); + + /* store result */ + SetResult(&result, R_STRING, myTime); +} + + + +int plugin_init_mpd(void) +{ + int check; + debug("[MPD] v0.83, check lcd4linux configuration file..."); + + check = configure_mpd(); + if (plugin_enabled != 1) + return 0; + + if (check) + debug("[MPD] configured!"); + else + debug("[MPD] error, NOT configured!"); + + /* when mpd dies, do NOT exit application, ignore it! */ + signal(SIGPIPE, SIG_IGN); + gettimeofday(×tamp, NULL); + + AddFunction("mpd::artist", 0, getArtist); + AddFunction("mpd::title", 0, getTitle); + AddFunction("mpd::album", 0, getAlbum); + AddFunction("mpd::file", 0, getFilename); AddFunction("mpd::totalTimeSec", 0, totalTimeSec); - AddFunction("mpd::elapsedTime", 0, elapsedTime); AddFunction("mpd::elapsedTimeSec", 0, elapsedTimeSec); AddFunction("mpd::bitRate", 0, bitRate); - AddFunction("mpd::getRepeat", 0, getRepeat); - AddFunction("mpd::getRandom", 0, getRandom); - AddFunction("mpd::getRepRand", 0, getRepRand); + AddFunction("mpd::getSamplerateHz", 0, getSamplerateHz); + AddFunction("mpd::getAudioChannels", 0, getAudioChannels); + AddFunction("mpd::getRepeatInt", 0, getRepeatInt); + AddFunction("mpd::getRandomInt", 0, getRandomInt); + AddFunction("mpd::getStateInt", 0, getStateInt); + AddFunction("mpd::getVolume", 0, getVolume); + AddFunction("mpd::getSongsInDb", 0, getSongsInDb); + AddFunction("mpd::getMpdUptime", 0, getMpdUptime); + AddFunction("mpd::getMpdPlayTime", 0, getMpdPlayTime); + AddFunction("mpd::getMpdDbPlayTime", 0, getMpdDbPlayTime); + AddFunction("mpd::getMpdPlaylistLength", 0, getMpdPlaylistLength); + AddFunction("mpd::getMpdPlaylistGetCurrentId", 0, getCurrentSongPos); + + AddFunction("mpd::cmdNextSong", 0, nextSong); + AddFunction("mpd::cmdPrevSong", 0, prevSong); + AddFunction("mpd::cmdStopSong", 0, stopSong); + AddFunction("mpd::cmdTogglePauseSong", 0, pauseSong); + AddFunction("mpd::cmdVolUp", 0, volUp); + AddFunction("mpd::cmdVolDown", 0, volDown); + AddFunction("mpd::cmdToggleRandom", 0, toggleRandom); + AddFunction("mpd::cmdToggleRepeat", 0, toggleRepeat); + + AddFunction("mpd::formatTimeMMSS", 1, formatTimeMMSS); + AddFunction("mpd::formatTimeDDHHMM", 1, formatTimeDDHHMM); + return 0; } void plugin_exit_mpd(void) { - /* empty */ + if (plugin_enabled == 1) { + debug("[MPD] disconnect from mpd"); + if (currentSong != NULL) + mpd_freeSong(currentSong); + mpd_closeConnection(conn); + } } diff --git a/plugin_mpris_dbus.c b/plugin_mpris_dbus.c new file mode 100644 index 0000000..19f7594 --- /dev/null +++ b/plugin_mpris_dbus.c @@ -0,0 +1,325 @@ +/* $Id: plugin_mpris_dbus.c 870 2009-04-09 14:55:23Z abbaskosan $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_mpris_dbus.c $ + * + * plugin mpris dbus + * + * Copyright (C) 2009 Abbas Kosan <abbaskosan@gmail.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_mpris_dbus (void) + * adds various functions + * + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <ctype.h> + +#include <stdio.h> + +// TODO: dbus-1 folder should be added to include path +#include <dbus/dbus.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" +#include "hash.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +static HASH DBUS; + +// D-Bus variables +static DBusMessage *msg; +static DBusMessageIter args; +static DBusConnection *conn; +static DBusError err; +static DBusPendingCall *pending; + +static void read_MetaData() +{ + // put pairs to hash table + int current_type; + // TODO: check size of char arrays + char str_key[255]; + char str_value[2048]; + DBusMessageIter subiter1; + + dbus_message_iter_recurse(&args, &subiter1); + while ((current_type = dbus_message_iter_get_arg_type(&subiter1)) != DBUS_TYPE_INVALID) { + DBusMessageIter subiter2; + DBusMessageIter subiter3; + + strcpy(str_key, ""); + strcpy(str_value, ""); + dbus_message_iter_recurse(&subiter1, &subiter2); + current_type = dbus_message_iter_get_arg_type(&subiter2); + + if (current_type == DBUS_TYPE_INVALID) + break; + if (current_type == DBUS_TYPE_STRING) { + void *str_tmp1; + void *str_tmp2; + dbus_message_iter_get_basic(&subiter2, &str_tmp1); + strcpy(str_key, str_tmp1); + dbus_message_iter_next(&subiter2); + dbus_message_iter_recurse(&subiter2, &subiter3); + current_type = dbus_message_iter_get_arg_type(&subiter3); + switch (current_type) { + case DBUS_TYPE_STRING: + { + dbus_message_iter_get_basic(&subiter3, &str_tmp2); + strcpy(str_value, str_tmp2); + break; + } + case DBUS_TYPE_INT32: + { + dbus_int32_t val; + dbus_message_iter_get_basic(&subiter3, &val); + sprintf(str_value, "%d", val); + break; + } + case DBUS_TYPE_INT64: + { + dbus_int64_t val; + dbus_message_iter_get_basic(&subiter3, &val); + sprintf(str_value, "%jd", (intmax_t) val); + break; + } + default: + // unexpected type + //printf (" (2-dbus-monitor too dumb to decipher arg type '%c')\n", current_type); + break; + } + // add key-value pair to hash + hash_put(&DBUS, str_key, str_value); + //printf("Key: %s , Value: %s\t",str_key,str_value); + } + //else + // unexpected type + //printf (" (2-dbus-monitor too dumb to decipher arg type '%c')\n", current_type); + dbus_message_iter_next(&subiter1); + } +} + +static int listen_TrackChange(void) +{ + // non blocking read of the next available message + dbus_connection_read_write(conn, 0); + msg = dbus_connection_pop_message(conn); + + // nothing to do if we haven't read a message + if (NULL == msg) + return 0; + + // check if the message is a signal from the correct interface and with the correct name + if (dbus_message_is_signal(msg, "org.freedesktop.MediaPlayer", "TrackChange")) { + // read the parameters + // TrackChange signal returns an array of string-variant pairs + if (!dbus_message_iter_init(msg, &args)) { + // No parameter ! + //fprintf(stderr, "Message Has No Parameters\n"); + return 0; + } else if (DBUS_TYPE_ARRAY != dbus_message_iter_get_arg_type(&args)) { + // Argument is not array + //fprintf(stderr, "Argument is not array!\n"); + return 0; + } else + read_MetaData(); + //printf("Got Signal\n"); + } + // free message + dbus_message_unref(msg); + return 1; +} + +static unsigned long int call_PositionGet(char *target) +{ + unsigned long int value = 0; + + // create a new method call and check for errors + msg = dbus_message_new_method_call(target, //target for the method call e.g "org.kde.amarok" + "/Player", // object to call on + "org.freedesktop.MediaPlayer", // interface to call on + "PositionGet"); // method name + if (NULL == msg) { + //fprintf(stderr, "Message Null\n"); + return 0; + } + // send message and get a handle for a reply + if (!dbus_connection_send_with_reply(conn, msg, &pending, -1)) { // -1 is default timeout + //fprintf(stderr, "Out Of Memory!\n"); + return 0; + } + if (NULL == pending) { + //fprintf(stderr, "Pending Call Null\n"); + return 0; + } + dbus_connection_flush(conn); + + //printf("Request Sent\n"); + + // free message + dbus_message_unref(msg); + + // block until we recieve a reply + dbus_pending_call_block(pending); + + // get the reply message + msg = dbus_pending_call_steal_reply(pending); + if (NULL == msg) { + //fprintf(stderr, "Reply Null\n"); + return 0; + } + // free the pending message handle + dbus_pending_call_unref(pending); + + // read the parameters + if (!dbus_message_iter_init(msg, &args)) { + //fprintf(stderr, "Message has no arguments!\n"); + return 0; + } + if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&args)) { + //fprintf(stderr, "Argument is not INT32!\n"); + return 0; + } else + dbus_message_iter_get_basic(&args, &value); + //printf("\nGot Reply: %d", value); + + // free message + dbus_message_unref(msg); + + return value; +} + +static void signal_TrackChange(RESULT * result, RESULT * arg1) +{ + char *str_tmp; + /* + if (listen_TrackChange() < 0) { + SetResult(&result, R_STRING, ""); + return; + } + */ + listen_TrackChange(); + str_tmp = hash_get(&DBUS, R2S(arg1), NULL); + if (str_tmp == NULL) + str_tmp = ""; + + SetResult(&result, R_STRING, str_tmp); +} + +static void method_PositionGet(RESULT * result, RESULT * arg1) +{ + unsigned long int mtime = 0; + unsigned long int value = 0; + double ratio = 0; + char *str_tmp; + + value = call_PositionGet(R2S(arg1)); + //printf("\ncalled :call_PositionGet %d",value); + + + str_tmp = hash_get(&DBUS, "mtime", NULL); + if (str_tmp != NULL) + mtime = atoi(str_tmp); + if (mtime > 0) + ratio = (double) (((float) value / mtime) * 100); + + //printf("\nvalue:%d mtime:%d ratio:%f",value,mtime,ratio); + // return actual position as percentage of total length + SetResult(&result, R_NUMBER, &ratio); +} + +/* plugin initialization */ +/* MUST NOT be declared 'static'! */ +int plugin_init_mpris_dbus(void) +{ + hash_create(&DBUS); + + int ret; + + //printf("Listening for signals\n"); + + // initialise the errors + dbus_error_init(&err); + + // connect to the bus and check for errors + conn = dbus_bus_get(DBUS_BUS_SESSION, &err); + /* + if (dbus_error_is_set(&err)) { + fprintf(stderr, "Connection Error (%s)\n", err.message); + dbus_error_free(&err); + } + */ + if (NULL == conn) + return 0; + + // request our name on the bus and check for errors + ret = dbus_bus_request_name(conn, "org.lcd4linux.mpris_dbus", DBUS_NAME_FLAG_REPLACE_EXISTING, &err); + /* + if (dbus_error_is_set(&err)) { + fprintf(stderr, "Name Error (%s)\n", err.message); + dbus_error_free(&err); + } + */ + if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) + return 0; + + // add a rule for which messages we want to see + dbus_bus_add_match(conn, "type='signal',interface='org.freedesktop.MediaPlayer'", &err); // see signals from the given interface + dbus_connection_flush(conn); + /* + if (dbus_error_is_set(&err)) { + fprintf(stderr, "Match Error (%s)\n", err.message); + return 0; + } + */ + //printf("Match rule sent\n"); + + + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("mpris_dbus::signal_TrackChange", 1, signal_TrackChange); + AddFunction("mpris_dbus::method_PositionGet", 1, method_PositionGet); + + return 0; +} + +void plugin_exit_mpris_dbus(void) +{ + /* free any allocated memory */ + /* close filedescriptors */ + hash_destroy(&DBUS); + + if (NULL != msg) + dbus_message_unref(msg); + dbus_error_free(&err); +} diff --git a/plugin_mysql.c b/plugin_mysql.c index 04e88ee..ca7b2d4 100644 --- a/plugin_mysql.c +++ b/plugin_mysql.c @@ -1,5 +1,5 @@ -/* $Id: plugin_mysql.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_mysql.c $ +/* $Id: plugin_mysql.c 771 2007-02-25 12:27:26Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_mysql.c $ * * plugin for execute SQL queries into a MySQL DBSM. * diff --git a/plugin_netdev.c b/plugin_netdev.c index 7773818..2f7e13c 100644 --- a/plugin_netdev.c +++ b/plugin_netdev.c @@ -1,9 +1,9 @@ -/* $Id: plugin_netdev.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_netdev.c $ +/* $Id: plugin_netdev.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_netdev.c $ * * plugin for /proc/net/dev parsing * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_netinfo.c b/plugin_netinfo.c new file mode 100644 index 0000000..34f694d --- /dev/null +++ b/plugin_netinfo.c @@ -0,0 +1,325 @@ +/* $Id: $ + * $URL: $ + * + * plugin getting information about network devices (IPaddress, MACaddress, ...) + * + * Copyright (C) 2007 Volker Gering <v.gering@t-online.de> + * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * exported functions: + * + * int plugin_init_netinfo (void) + * adds functions to get information about network devices + * + */ + + +#include "config.h" + +#include <stdlib.h> +#include <unistd.h> +#include <string.h> /* memcpy() */ +#include <ctype.h> +#include <math.h> /* rint(), log2l() */ + +#include "debug.h" +#include "plugin.h" +#include "qprintf.h" + +#include <sys/types.h> /* socket() */ +#include <sys/socket.h> /* socket() */ +#include <sys/ioctl.h> /* SIOCGIFNAME */ +#include <net/if.h> /* ifreq{} */ +#include <errno.h> /* errno */ +#include <netinet/in.h> /* inet_ntoa() */ +#include <arpa/inet.h> /* inet_ntoa() */ + + +/* socket descriptor: + * -2 initial state + * -1 error: message not printed + * -3 error: message printed, deactivate plugin + */ +static int socknr = -2; + +static int open_net(void) +{ + + if (socknr == -3) + return -1; + if (socknr == -2) { + socknr = socket(PF_INET, SOCK_DGRAM, 0); + } + if (socknr == -1) { + error("%s: socket(PF_INET, SOCK_DGRAM, 0) failed: %s", "plugin_netinfo", strerror(errno)); + error(" deactivate plugin netinfo"); + socknr = -3; + return -1; + } + + return 0; +} + + +static void my_exists(RESULT * result, RESULT * arg1) +{ + char buf[10240]; + struct ifconf ifcnf; + struct ifreq *ifreq; + int len; + double value = 0.0; // netdev doesn't exists + char devname[80]; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_NUMBER, &value); + return; + } + + ifcnf.ifc_len = sizeof(buf); + ifcnf.ifc_buf = buf; + if (ioctl(socknr, SIOCGIFCONF, &ifcnf) < 0) { + /* error getting list of devices */ + error("%s: ioctl(IFCONF) for %s failed: %s", "plugin_netinfo", R2S(arg1), strerror(errno)); + SetResult(&result, R_NUMBER, &value); + return; + } + if (0 == ifcnf.ifc_len) { + /* no interfaces found */ + SetResult(&result, R_NUMBER, &value); + return; + } + + ifreq = (struct ifreq *) buf; + len = sizeof(struct ifreq); + strncpy(devname, R2S(arg1), sizeof(devname)); + + while (ifreq && *((char *) ifreq) && ((char *) ifreq) < buf + ifcnf.ifc_len) { + if (*((char *) ifreq) && strncmp(ifreq->ifr_name, devname, sizeof(devname)) == 0) { + /* found */ + value = 1.0; + SetResult(&result, R_NUMBER, &value); + return; + } + + (*(char **) &ifreq) += len; + } + + /* device doesn't exists */ + SetResult(&result, R_NUMBER, &value); +} + + +/* get MAC address (hardware address) of network device */ +static void my_hwaddr(RESULT * result, RESULT * arg1) +{ + static int errcount = 0; + struct ifreq ifreq; + unsigned char *hw; + char value[18]; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_STRING, ""); + return; + } + + strncpy(ifreq.ifr_name, R2S(arg1), sizeof(ifreq.ifr_name)); +#ifndef __MAC_OS_X_VERSION_10_3 + // Linux: get interface MAC address + if (ioctl(socknr, SIOCGIFHWADDR, &ifreq) < 0) { +#else + // MacOS: get interface MAC address + if (ioctl(socknr, SIOCGLIFPHYADDR, &ifreq) < 0) { +#endif + errcount++; + if (1 == errcount % 1000) { + error("%s: ioctl(IF_HARDW_ADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); + error(" (skip next 1000 errors)"); + } + SetResult(&result, R_STRING, ""); + return; + } +#ifndef __MAC_OS_X_VERSION_10_3 + hw = (unsigned char *) ifreq.ifr_hwaddr.sa_data; +#else + hw = (unsigned char *) ifreq.ifr_data; +#endif + qprintf(value, sizeof(value), "%02x:%02x:%02x:%02x:%02x:%02x", + *hw, *(hw + 1), *(hw + 2), *(hw + 3), *(hw + 4), *(hw + 5)); + + SetResult(&result, R_STRING, value); +} + + +/* get ip address of network device */ +static void my_ipaddr(RESULT * result, RESULT * arg1) +{ + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + char value[16]; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_STRING, ""); + return; + } + + strncpy(ifreq.ifr_name, R2S(arg1), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFADDR, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + error("%s: ioctl(IFADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); + error(" (skip next 1000 errors)"); + } + SetResult(&result, R_STRING, ""); + return; + } + sin = (struct sockaddr_in *) &ifreq.ifr_addr; + qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); + + SetResult(&result, R_STRING, value); +} + + +struct sockaddr_in *get_netmask(RESULT * arg1) +{ + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + static struct sockaddr_in sret; + + strncpy(ifreq.ifr_name, R2S(arg1), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFNETMASK, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + error("%s: ioctl(IFNETMASK %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); + error(" (skip next 1000 errors)"); + } + return NULL; + } +#ifndef __MAC_OS_X_VERSION_10_3 + sin = (struct sockaddr_in *) &ifreq.ifr_netmask; +#else + sin = (struct sockaddr_in *) &ifreq.ifr_data; +#endif + + memcpy(&sret, sin, sizeof(sret)); + return &sret; +} + +/* get ip netmask of network device */ +static void my_netmask(RESULT * result, RESULT * arg1) +{ + char value[16]; + struct sockaddr_in *sin; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_STRING, ""); + return; + } + + sin = get_netmask(arg1); + qprintf(value, sizeof(value), "%s", NULL != sin ? inet_ntoa(sin->sin_addr) : "?"); + + SetResult(&result, R_STRING, value); +} + + +/* get netmask in short CIDR notation */ +static void my_netmask_short(RESULT * result, RESULT * arg1) +{ + char value[16]; + struct sockaddr_in *sin; + int netlen = 0; + long double logval = 0.0; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_STRING, ""); + return; + } + + sin = get_netmask(arg1); + if (NULL != sin) { + logval = (long double) (get_netmask(arg1)->sin_addr.s_addr); + netlen = (int) rint(log2l(logval) / log2l(2.0)); + qprintf(value, sizeof(value), "/%d", netlen); + } else { + qprintf(value, sizeof(value), "/?"); + } + + SetResult(&result, R_STRING, value); +} + + +/* get ip broadcast address of network device */ +static void my_bcaddr(RESULT * result, RESULT * arg1) +{ + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + char value[16]; + + if (socknr < 0) { + /* no open socket */ + SetResult(&result, R_STRING, ""); + return; + } + + strncpy(ifreq.ifr_name, R2S(arg1), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFBRDADDR, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + error("%s: ioctl(IFBRDADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); + error(" (skip next 1000 errors)"); + } + SetResult(&result, R_STRING, ""); + return; + } + sin = (struct sockaddr_in *) &ifreq.ifr_broadaddr; + qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); + + SetResult(&result, R_STRING, value); +} + + +int plugin_init_netinfo(void) +{ + open_net(); + + AddFunction("netinfo::exists", 1, my_exists); + AddFunction("netinfo::hwaddr", 1, my_hwaddr); + AddFunction("netinfo::ipaddr", 1, my_ipaddr); + AddFunction("netinfo::netmask", 1, my_netmask); + AddFunction("netinfo::netmask_short", 1, my_netmask_short); + AddFunction("netinfo::bcaddr", 1, my_bcaddr); + + return 0; +} + +void plugin_exit_netinfo(void) +{ + close(socknr); +} diff --git a/plugin_pop3.c b/plugin_pop3.c index 973016c..cdd2db7 100644 --- a/plugin_pop3.c +++ b/plugin_pop3.c @@ -1,5 +1,5 @@ /* $Id: plugin_pop3.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_pop3.c $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_pop3.c $ * * Plugin to check POP3 mail accounts * diff --git a/plugin_ppp.c b/plugin_ppp.c index 46ff5c1..1d6c56b 100644 --- a/plugin_ppp.c +++ b/plugin_ppp.c @@ -1,9 +1,9 @@ -/* $Id: plugin_ppp.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_ppp.c $ +/* $Id: plugin_ppp.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_ppp.c $ * * plugin for ppp throughput * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_proc_stat.c b/plugin_proc_stat.c index 947045f..f90b02d 100644 --- a/plugin_proc_stat.c +++ b/plugin_proc_stat.c @@ -1,9 +1,9 @@ -/* $Id: plugin_proc_stat.c 789 2007-04-30 04:48:10Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_proc_stat.c $ +/* $Id: plugin_proc_stat.c 1079 2010-01-15 21:44:04Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_proc_stat.c $ * * plugin for /proc/stat parsing * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -41,6 +41,11 @@ #include <ctype.h> #include <errno.h> +#ifdef __MAC_OS_X_VERSION_10_3 +#include <mach/mach_host.h> +#include <mach/host_info.h> +#endif + #include "debug.h" #include "plugin.h" #include "qprintf.h" @@ -84,6 +89,10 @@ static int parse_proc_stat(void) if (age > 0 && age <= 10) return 0; +#ifndef __MAC_OS_X_VERSION_10_3 + + /* Linux Kernel, /proc-filesystem */ + if (stream == NULL) stream = fopen("/proc/stat", "r"); if (stream == NULL) { @@ -214,6 +223,35 @@ static int parse_proc_stat(void) hash_put1(buffer, beg); } } + +#else + + /* MACH Kernel, MacOS X */ + + kern_return_t err; + mach_msg_type_number_t count; + host_info_t r_load; + host_cpu_load_info_data_t cpu_load; + char s_val[8]; + + r_load = &cpu_load; + count = HOST_CPU_LOAD_INFO_COUNT; + err = host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, r_load, &count); + if (KERN_SUCCESS != err) { + error("Error getting cpu load"); + return -1; + } + snprintf(s_val, sizeof(s_val), "%d", cpu_load.cpu_ticks[CPU_STATE_USER]); + hash_put2("cpu", "user", s_val); + snprintf(s_val, sizeof(s_val), "%d", cpu_load.cpu_ticks[CPU_STATE_NICE]); + hash_put2("cpu", "nice", s_val); + snprintf(s_val, sizeof(s_val), "%d", cpu_load.cpu_ticks[CPU_STATE_SYSTEM]); + hash_put2("cpu", "system", s_val); + snprintf(s_val, sizeof(s_val), "%d", cpu_load.cpu_ticks[CPU_STATE_IDLE]); + hash_put2("cpu", "idle", s_val); + +#endif + return 0; } diff --git a/plugin_python.c b/plugin_python.c index 0a4a1fd..70ea9dc 100644 --- a/plugin_python.c +++ b/plugin_python.c @@ -1,5 +1,5 @@ -/* $Id: plugin_python.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_python.c $ +/* $Id: plugin_python.c 1086 2010-01-19 14:26:33Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_python.c $ * * Python plugin * @@ -32,6 +32,7 @@ * */ +#include "config.h" #include <Python.h> #include "debug.h" #include "plugin.h" @@ -92,6 +93,8 @@ static void pyt_exec_str(RESULT * result, const char *module, const char *functi } else { Py_DECREF(pModule); error("Python call failed (\"%s.%s\")", module, function); + /* print traceback on stderr */ + PyErr_PrintEx(0); SetResult(&result, R_STRING, ""); return; } @@ -102,6 +105,8 @@ static void pyt_exec_str(RESULT * result, const char *module, const char *functi Py_DECREF(pModule); } else { error("Failed to load python module \"%s\"", module); + /* print traceback on stderr */ + PyErr_PrintEx(0); } SetResult(&result, R_STRING, ""); return; diff --git a/plugin_qnaplog.c b/plugin_qnaplog.c new file mode 100644 index 0000000..ef7ad77 --- /dev/null +++ b/plugin_qnaplog.c @@ -0,0 +1,427 @@ +/* $Id: plugin_sample.c 733 2007-01-15 05:47:13Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_qnaplog.c $ + * + * plugin qnaplog + * + * Copyright (C) 2009 Ralf Tralow <qnaplog@ringwelt.de> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* DOC: + * To compile the plugin remember to add -lsqlite3 option into Makefile. I.E: CC = gcc -lsqlite3 + * or run: + * $ gcc -I/opt/include -L/opt/lib/sqlite3 plugin_qnaplog.c -lsqlite3 -o plugin_qnaplog.o + * + * + * exported functions: + * + * int plugin_init_qnaplog (void) + * void plugin_exit_qnaplog(void) + * static void my_status(RESULT * result, RESULT *arg1) + * static void my_conn(RESULT *result, RESULT *arg1) + * static void my_event(RESULT *result, RESULT *arg1) + * + * + * adds various functions + * + */ + +/* define the include files you need */ +#include "config.h" +#include "cfg.h" + +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#ifdef HAVE_SQLITE3_H +#include <sqlite3.h> +#else +#warning sqlite3.h not found: plugin deactivated +#endif +#include <unistd.h> +#include <sys/stat.h> +#include <time.h> + +/* these should always be included */ +#include "debug.h" +#include "plugin.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +#ifdef HAVE_SQLITE3_H + +#define SQLSTATEMENT_CONN "select * from NASLOG_CONN ORDER BY conn_id DESC LIMIT 1" +#define SQLSTATEMENT_EVENT "select * from NASLOG_EVENT ORDER BY event_id DESC LIMIT 1" + +time_t lastaccesstimeConn = 0; +time_t lastaccesstimeEvent = 0; +sqlite3 *connexConn; +sqlite3 *connexEvent; +char dbNameConn[256]; +char dbNameEvent[256]; + +char conn_id[10]; +char conn_type[12]; +char conn_date[12]; +char conn_time[12]; +char conn_user[30]; +char conn_ip[16]; +char conn_comp[30]; +char conn_res[255]; +char conn_serv[10]; +char conn_action[12]; + +char event_id[10]; +char event_comp[30]; +char event_date[12]; +char event_ip[16]; +char event_time[12]; +char event_type[12]; +char event_user[30]; +char event_desc[255]; + +#define MAX_IDS_TYPE 3 +char *IDS_TYPE[MAX_IDS_TYPE] = { "Information", "Warning", "Error" }; + +#define MAX_IDS_SERV 8 +char *IDS_SERV[MAX_IDS_SERV] = { "S0", "Samba", "S2", "HTTP", "S4", "S5", "S6", "SSH" }; + +#define MAX_IDS_ACTION 16 +char *IDS_ACTION[MAX_IDS_ACTION] = + { "C0", "Delete", "Read", "Write", "C4", "C5", "C6", "C7", "C8", "Login fail", "Login ok", "Logout", "C12", "C13", + "C14", "Add" +}; + +static char Section[] = "Plugin:QnapLog"; + + +/** test the connection to conn.log + * + */ +static int configureConn(void) +{ + static int configured = 0; + char *s; + int rc; + + if (configured != 0) + return configured; + + s = cfg_get(Section, "databaseConn", ""); + if (*s == '\0') { + info("[QnapLog] empty '%s.database' entry in %s, assuming none", Section, cfg_source()); + strcpy(dbNameConn, "/etc/logs/conn.log"); + } else { + snprintf(dbNameConn, sizeof(dbNameConn), "%s", s); + } + free(s); + + rc = sqlite3_open(dbNameConn, &connexConn); + if (rc) { + error("[QnapLog] connection error: %s", sqlite3_errmsg(connexConn)); + configured = -1; + sqlite3_close(connexConn); + return configured; + } + + configured = 1; + return configured; +} + + +/** test the connection to event.log + * + */ +static int configureEvent(void) +{ + static int configured = 0; + char *s; + int rc; + + if (configured != 0) + return configured; + + s = cfg_get(Section, "databaseEvent", ""); + if (*s == '\0') { + info("[QnapLog] empty '%s.database' entry in %s, assuming none", Section, cfg_source()); + strcpy(dbNameEvent, "/etc/logs/event.log"); + } else { + snprintf(dbNameEvent, sizeof(dbNameEvent), "%s", s); + } + free(s); + + rc = sqlite3_open(dbNameEvent, &connexEvent); + if (rc) { + error("[QnapLog] connection error: %s", sqlite3_errmsg(connexEvent)); + configured = -1; + sqlite3_close(connexEvent); + return configured; + } + + configured = 1; + return configured; +} + + +/** callback function for conn request + * + */ +static int callbackConn(void *NotUsed, int argc, char **argv, char **azColName) +{ + int i; + int c; + + for (i = 0; i < argc; i++) { + if (strcmp(azColName[i], "conn_id") == 0) { + snprintf(conn_id, sizeof(conn_id), "%s", argv[i] ? argv[i] : "NULL"); + } else if (strcmp(azColName[i], "conn_type") == 0) { + c = atoi(argv[i]); + if (c < MAX_IDS_TYPE) + snprintf(conn_type, sizeof(conn_type), "%s", IDS_TYPE[c]); + } else if (strcmp(azColName[i], "conn_date") == 0) { + snprintf(conn_date, sizeof(conn_date), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "conn_time") == 0) { + snprintf(conn_time, sizeof(conn_time), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "conn_user") == 0) { + snprintf(conn_user, sizeof(conn_user), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "conn_ip") == 0) { + snprintf(conn_ip, sizeof(conn_ip), "%s", argv[i] ? argv[i] : "NULL"); + } else if (strcmp(azColName[i], "conn_comp") == 0) { + snprintf(conn_comp, sizeof(conn_comp), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "conn_res") == 0) { + snprintf(conn_res, sizeof(conn_res), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "conn_serv") == 0) { + c = atoi(argv[i]); + if (c < MAX_IDS_SERV) + snprintf(conn_serv, sizeof(conn_serv), "%s", IDS_SERV[c]); + } else if (strcmp(azColName[i], "conn_action") == 0) { + c = atoi(argv[i]); + if (c < MAX_IDS_ACTION) + snprintf(conn_action, sizeof(conn_action), "%s", IDS_ACTION[c]); + } + } + + return 0; +} + + +/** callback function for event request + * + */ +static int callbackEvent(void *NotUsed, int argc, char **argv, char **azColName) +{ + int i; + int c; + + for (i = 0; i < argc; i++) { + if (strcmp(azColName[i], "event_id") == 0) { + snprintf(event_id, sizeof(event_id), "%s", argv[i] ? argv[i] : "NULL"); + } else if (strcmp(azColName[i], "event_type") == 0) { + c = *argv[i] & 0x0F; + if (c < MAX_IDS_TYPE) + snprintf(event_type, sizeof(event_type), "%s", IDS_TYPE[c]); + } else if (strcmp(azColName[i], "event_date") == 0) { + snprintf(event_date, sizeof(event_date), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "event_time") == 0) { + snprintf(event_time, sizeof(event_time), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "event_user") == 0) { + snprintf(event_user, sizeof(event_user), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "event_ip") == 0) { + snprintf(event_ip, sizeof(event_ip), "%s", argv[i] ? argv[i] : "NULL"); + } else if (strcmp(azColName[i], "event_comp") == 0) { + snprintf(event_comp, sizeof(event_comp), "%s", argv[i] ? argv[i] + : "NULL"); + } else if (strcmp(azColName[i], "event_desc") == 0) { + snprintf(event_desc, sizeof(event_desc), "%s", argv[i] ? argv[i] + : "NULL"); + } + } + + return 0; +} + + +/** request last of qnap connection + * + */ +static void my_conn(RESULT * result, RESULT * arg1) +{ + char *key; + char *value; + char *zErrMsg = 0; + int rc; + struct stat attrib; // create a file attribute structure + time_t accesstime; + + + value = -1; + key = R2S(arg1); + + if (configureConn() >= 0) { + stat(dbNameConn, &attrib); // get the attributes + accesstime = attrib.st_mtime; // Get the last modified time and put it into the time structure + + if (accesstime > lastaccesstimeConn) { + lastaccesstimeConn = accesstime; + rc = sqlite3_exec(connexConn, SQLSTATEMENT_CONN, callbackConn, 0, &zErrMsg); + if (rc != SQLITE_OK) { + fprintf(stderr, "SQL error: %s\n", zErrMsg); + sqlite3_free(zErrMsg); + } + } + + if (strcasecmp(key, "id") == 0) { + value = conn_id; + } else if (strcasecmp(key, "type") == 0) { + value = conn_type; + } else if (strcasecmp(key, "date") == 0) { + value = conn_date; + } else if (strcasecmp(key, "time") == 0) { + value = conn_time; + } else if (strcasecmp(key, "user") == 0) { + value = conn_user; + } else if (strcasecmp(key, "ip") == 0) { + value = conn_ip; + } else if (strncasecmp(key, "res", 3) == 0) { + value = conn_res; + } else if (strncasecmp(key, "serv", 4) == 0) { + value = conn_serv; + } else if (strncasecmp(key, "act", 3) == 0) { + value = conn_action; + } else if (strncasecmp(key, "comp", 4) == 0) { + value = conn_comp; + } + } + + /* store result */ + SetResult(&result, R_STRING, value); +} + +/** request last qnap event + * + */ +static void my_event(RESULT * result, RESULT * arg1) +{ + char *key; + char *value; + char *zErrMsg = 0; + int rc; + struct stat attrib; // create a file attribute structure + time_t accesstime; + + + value = -1; + key = R2S(arg1); + + if (configureEvent() >= 0) { + stat(dbNameEvent, &attrib); // get the attributes + accesstime = attrib.st_mtime; // Get the last modified time and put it into the time structure + + if (accesstime > lastaccesstimeEvent) { + lastaccesstimeEvent = accesstime; + rc = sqlite3_exec(connexEvent, SQLSTATEMENT_EVENT, callbackEvent, 0, &zErrMsg); + if (rc != SQLITE_OK) { + fprintf(stderr, "SQL error: %s\n", zErrMsg); + sqlite3_free(zErrMsg); + } + } + + if (strcasecmp(key, "id") == 0) { + value = event_id; + } else if (strncasecmp(key, "comp", 4) == 0) { + value = event_comp; + } else if (strcasecmp(key, "date") == 0) { + value = event_date; + } else if (strcasecmp(key, "ip") == 0) { + value = event_ip; + } else if (strcasecmp(key, "time") == 0) { + value = event_time; + } else if (strcasecmp(key, "type") == 0) { + value = event_type; + } else if (strcasecmp(key, "user") == 0) { + value = event_user; + } else if (strncasecmp(key, "desc", 4) == 0) { + value = event_desc; + } + } + + /* store result */ + SetResult(&result, R_STRING, value); +} + +/** status for conn or event connection + * + */ +static void my_status(RESULT * result, RESULT * arg1) +{ + const char *value = ""; + const char *status = "Ok"; + char *key; + + + key = R2S(arg1); + if (strcmp(key, "conn") == 0) { + if (configureConn() > 0) { + value = status; + } + } else if (strcmp(key, "event") == 0) { + if (configureEvent() > 0) { + value = status; + } + } + + SetResult(&result, R_STRING, value); +} + +#endif + +/* plugin initialization */ +int plugin_init_qnaplog(void) +{ +#ifdef HAVE_SQLITE3_H + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("qnaplog::status", 1, my_status); + AddFunction("qnaplog::conn", 1, my_conn); + AddFunction("qnaplog::event", 1, my_event); +#endif + return 0; +} + +void plugin_exit_qnaplog(void) +{ +#ifdef HAVE_SQLITE3_H + /* free any allocated memory */ + /* close filedescriptors */ + sqlite3_close(connexConn); + sqlite3_close(connexEvent); +#endif +} diff --git a/plugin_sample.c b/plugin_sample.c index 7377c9e0..ff0e5eb 100644 --- a/plugin_sample.c +++ b/plugin_sample.c @@ -1,10 +1,10 @@ -/* $Id: plugin_sample.c 733 2007-01-15 05:47:13Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_sample.c $ +/* $Id: plugin_sample.c 1091 2010-01-21 04:26:24Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_sample.c $ * * plugin template * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> - * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. * @@ -33,17 +33,17 @@ */ -/* define the include files you need */ #include "config.h" -#include <stdlib.h> -#include <string.h> -#include <ctype.h> - /* these should always be included */ #include "debug.h" #include "plugin.h" +/* define the include files you need */ +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + #ifdef WITH_DMALLOC #include <dmalloc.h> #endif diff --git a/plugin_seti.c b/plugin_seti.c index afb80ee..68b2f5b 100644 --- a/plugin_seti.c +++ b/plugin_seti.c @@ -1,9 +1,9 @@ -/* $Id: plugin_seti.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_seti.c $ +/* $Id: plugin_seti.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_seti.c $ * * plugin for seti@home status reporting * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * based on the old seti client which is @@ -63,7 +63,7 @@ static int parse_seti(void) FILE *stream; int age; - /* if a fatal error occured, do nothing */ + /* if a fatal error occurred, do nothing */ if (fatal != 0) return -1; diff --git a/plugin_statfs.c b/plugin_statfs.c index 7c6fa6b..c75b834 100644 --- a/plugin_statfs.c +++ b/plugin_statfs.c @@ -1,9 +1,9 @@ -/* $Id: plugin_statfs.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_statfs.c $ +/* $Id: plugin_statfs.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_statfs.c $ * * plugin for statfs() syscall * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_string.c b/plugin_string.c index f82f265..ba1c227 100644 --- a/plugin_string.c +++ b/plugin_string.c @@ -1,9 +1,9 @@ -/* $Id: plugin_string.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_string.c $ +/* $Id: plugin_string.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_string.c $ * * string plugin * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_test.c b/plugin_test.c index f496399..340854f 100644 --- a/plugin_test.c +++ b/plugin_test.c @@ -1,12 +1,12 @@ -/* $Id: plugin_test.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_test.c $ +/* $Id: plugin_test.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_test.c $ * * Handy functions for testing displays and debugging code. * * Copyright (C) 2004 Andy Baxter. * * Based on sample plugin which is -* Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> +* Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_time.c b/plugin_time.c index 7a56b3b..324f5b8 100644 --- a/plugin_time.c +++ b/plugin_time.c @@ -1,9 +1,9 @@ -/* $Id: plugin_time.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_time.c $ +/* $Id: plugin_time.c 897 2008-10-06 04:25:14Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_time.c $ * * time plugin * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -36,6 +36,8 @@ #include "config.h" #include <time.h> +#include <stdlib.h> +#include <string.h> #include "debug.h" #include "plugin.h" @@ -59,6 +61,40 @@ static void my_strftime(RESULT * result, RESULT * arg1, RESULT * arg2) SetResult(&result, R_STRING, value); } +static void my_stftime_tz(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT * arg3) +{ + char value[256] = ""; + time_t t = R2N(arg2); + char *tz = R2S(arg3); + char *old_tz; + + old_tz = getenv("TZ"); + + /* + * because the next setenv() call may overwrite that string, we + * duplicate it here + */ + if (old_tz) { + old_tz = strdup(old_tz); + } + + setenv("TZ", tz, 1); + tzset(); + + strftime(value, sizeof(value), R2S(arg1), localtime(&t)); + + if (old_tz) { + setenv("TZ", old_tz, 1); + } else { + unsetenv("TZ"); + } + tzset(); + + free(old_tz); + + SetResult(&result, R_STRING, value); +} + int plugin_init_time(void) { @@ -66,6 +102,7 @@ int plugin_init_time(void) /* register some basic time functions */ AddFunction("time", 0, my_time); AddFunction("strftime", 2, my_strftime); + AddFunction("strftime_tz", 3, my_stftime_tz); return 0; } diff --git a/plugin_uname.c b/plugin_uname.c index 596cca6..9f1c3b0 100644 --- a/plugin_uname.c +++ b/plugin_uname.c @@ -1,9 +1,9 @@ -/* $Id: plugin_uname.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_uname.c $ +/* $Id: plugin_uname.c 1002 2009-03-26 08:06:12Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_uname.c $ * * plugin for uname() syscall * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -68,7 +68,7 @@ static void my_uname(RESULT * result, RESULT * arg1) value = utsbuf.version; } else if (strcasecmp(key, "machine") == 0) { value = utsbuf.machine; -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) && ! defined(__APPLE__) && ! defined(__CYGWIN__) } else if (strcasecmp(key, "domainname") == 0) { value = utsbuf.domainname; #endif diff --git a/plugin_uptime.c b/plugin_uptime.c index 913497f..1d0e575 100644 --- a/plugin_uptime.c +++ b/plugin_uptime.c @@ -1,9 +1,9 @@ -/* $Id: plugin_uptime.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_uptime.c $ +/* $Id: plugin_uptime.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_uptime.c $ * * plugin for uptime * - * Copyright (C) 2003 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/plugin_w1retap.c b/plugin_w1retap.c new file mode 100644 index 0000000..10fc05e --- /dev/null +++ b/plugin_w1retap.c @@ -0,0 +1,264 @@ +/* $Id: plugin_w1retap.c + * + * plugin to perform simple file operations for w1retap + * + * Copyright (C) 2007 Jonathan Hudson <jh+w1retap@daria.co.uk> + * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * This module returns a specific value associated with a key from a + * file containing one or more lines formatted as KEY=VALUE. + * + * It is intended for use with the w1retap weather station logging + * software <http://www.daria.co.uk/wx/tech.html>, but is applicable + * to any similarly formatted file. + */ + +/* + * exported functions: + * + * int plugin_init_file (void) + * adds various functions + * + */ + + +#include "config.h" + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> + +#include "debug.h" +#include "plugin.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +/* function 'my_readkey' */ +/* takes two arguments, file name and key */ +/* returns value associated with key, trimmed to suitable dec places */ + +static void my_readkey(RESULT * result, RESULT * arg1, RESULT * arg2) +{ + char value[80], val2[80]; + FILE *fp; + char *reqkey, *pval; + size_t size; + + *value = 0; + pval = value; + + reqkey = R2S(arg2); + fp = fopen(R2S(arg1), "r"); + + if (!fp) { + error("w1retap couldn't open file '%s'", R2S(arg1)); + value[0] = '\0'; + } else { + size = strlen(reqkey); + while (!feof(fp) && pval == value) { + fgets(val2, sizeof(val2), fp); + if (*(val2 + size) == '=') { + if (strncmp(val2, reqkey, size) == 0) { + char *p; + p = index(val2, ' '); + if (p == NULL) { + p = index(val2, '\n'); + } + + if (p) { + *p = 0; + pval = val2 + size + 1; + { + double d; + char *ep; + d = strtod(pval, &ep); + if (ep != pval && (*ep == 0 || isspace(*ep))) { + if (d > 500) + sprintf(val2, "%.0f", d); + else + sprintf(val2, "%.1f", d); + pval = val2; + } + } + } + } + } + } + fclose(fp); + } + + /* store result */ + SetResult(&result, R_STRING, pval); +} + + +/* plugin initialization */ +/* MUST NOT be declared 'static'! */ +int plugin_init_w1retap(void) +{ + + /* register all our cool functions */ + /* the second parameter is the number of arguments */ + /* -1 stands for variable argument list */ + AddFunction("w1retap::readkey", 2, my_readkey); + + return 0; +} + +void plugin_exit_w1retap(void) +{ + /* free any allocated memory */ + /* close filedescriptors */ +} + + +/* + +#Sample configuration for w1retap +#================================ + +Display Weather { + Driver 'Pertelian' + Port '/dev/ttyUSB0' + Size '20x4' + Backlight 1 + Icons 0 +} + +Display XWindow { + Driver 'X11' + Size '120x32' + Font '6x8' + Pixel '4+1' + Gap '-1x-1' + Border 20 + Foreground '000000ff' + Background '00000033' + Basecolor '70c000' + Buttons 6 + Brightness 133 +} + +Widget LCDTimer { + class 'Timer' + active 1 + update 10000 + expression h=strftime('%H', time()); x=file::readline('/tmp/.lcd',1)+0; b=(h > 5 | h < 23) + x ; LCD::backlight(b) +} + + +Widget Temp { + class 'Text' + expression w1retap::readkey(file, 'OTMP0') + prefix 'Extr ' + width 10 + align 'L' + update tick +} + +Widget GHouse { + class 'Text' + expression w1retap::readkey(file, 'GHT') + prefix 'GHT ' + width 10 + align 'L' + update tick +} + +Widget House { + class 'Text' + expression w1retap::readkey(file, 'OTMP1') + prefix 'Intr ' + width 10 + align 'L' + update tick +} +Widget Garage { + class 'Text' + expression w1retap::readkey(file, 'OTMP2') + prefix 'Gge ' + width 10 + align 'L' + update tick +} +Widget Soil { + class 'Text' + expression w1retap::readkey(file, 'STMP1') + prefix 'Soil ' + width 10 + align 'L' + update tick +} +Widget Press { + class 'Text' + expression w1retap::readkey(file, 'OPRS') + prefix 'Pres ' + width 10 + align 'L' + update tick +} + +Widget Rain { + class 'Text' + expression w1retap::readkey(file1, 'RAIN') + prefix 'Rain ' + width 20 + align 'L' + update tick +} + +Layout Default { + Timer1 'LCDTimer' + Row1 { + Col1 'Temp' + Col11 'GHouse' + } + + Row2 { + Col1 'House' + Col11 'Garage' + } + + Row3 { + Col1 'Soil' + Col11 'Press' + } + + Row4 { + Col1 'Rain' + } +} + +Variables { + tick 120000 + file '/tmp/.w1retap.dat' + file1 '/tmp/.w1rain.txt' +} + +Layout 'Default' + +Display 'Weather' + +*/ diff --git a/plugin_wireless.c b/plugin_wireless.c index 7eec871..0ee38d1 100644 --- a/plugin_wireless.c +++ b/plugin_wireless.c @@ -1,5 +1,5 @@ -/* $Id: plugin_wireless.c 738 2007-01-16 08:30:24Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_wireless.c $ +/* $Id: plugin_wireless.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_wireless.c $ * * Wireless Extension plugin * @@ -54,12 +54,13 @@ #include <string.h> #include <stdio.h> #include <unistd.h> +#include <errno.h> +#include <math.h> #include <sys/ioctl.h> #include <net/if_arp.h> #include <linux/if.h> #include <linux/wireless.h> -#include <math.h> #include "debug.h" #include "plugin.h" @@ -119,11 +120,19 @@ int do_ioctl(const int sock, /* Socket to the kernel */ const int request, /* WE ID */ struct iwreq *pwrq) { /* Fixed part of the request */ + int ret; + /* Set device name */ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); /* Do the request */ - return (ioctl(sock, request, pwrq)); + ret = ioctl(sock, request, pwrq); + if (ret < 0) { + debug("ioctl(0x%04x) failed: %d '%s'", request, errno, strerror(errno)); + } + + return ret; + } int get_range_info(const int sock, const char *ifname, struct iw_range *range) @@ -455,7 +464,7 @@ static int get_stats(const char *dev, const char *key) } req.u.data.pointer = (caddr_t) & stats; - req.u.data.length = 0; + req.u.data.length = sizeof(stats); req.u.data.flags = 1; /* Clear updated flag */ if (do_ioctl(sock, dev, SIOCGIWSTATS, &req) < 0) { @@ -481,7 +490,7 @@ static int get_stats(const char *dev, const char *key) } else { qprintf(qprintf_buffer, sizeof(qprintf_buffer), "%d/%d", stats.qual.level, range.max_qual.level); - qprintf(key_buffer, sizeof(key_buffer), "%s.%s", dev, KEY_LEVEL);; + qprintf(key_buffer, sizeof(key_buffer), "%s.%s", dev, KEY_LEVEL); hash_put(&wireless, key_buffer, qprintf_buffer); qprintf(qprintf_buffer, sizeof(qprintf_buffer), "%d/%d", stats.qual.noise, range.max_qual.noise); diff --git a/plugin_xmms.c b/plugin_xmms.c index f8d1b90..cb8fedc 100644 --- a/plugin_xmms.c +++ b/plugin_xmms.c @@ -1,5 +1,5 @@ /* $Id: plugin_xmms.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugin_xmms.c $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_xmms.c $ * * XMMS-Plugin for LCD4Linux * Copyright (C) 2003 Markus Keil <markus_keil@t-online.de> @@ -1,10 +1,10 @@ -dnl $Id: plugins.m4 730 2007-01-14 13:50:28Z michael $ -dnl $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/plugins.m4 $ +dnl $Id: plugins.m4 1096 2010-01-28 17:19:58Z michael $ +dnl $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugins.m4 $ dnl LCD4Linux Plugins conf part dnl -dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <reinelt@eunet.at> +dnl Copyright (C) 1999, 2000, 2001, 2002, 2003 Michael Reinelt <michael@reinelt.co.at> dnl Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> dnl dnl This file is part of LCD4Linux. @@ -28,7 +28,9 @@ AC_ARG_WITH( plugins, [ --with-plugins=<list> choose which plugins to compile.] [ type --with-plugins=list for a list] - [ of avaible plugins], + [ of avaible plugins] + [ plugins may be excluded with 'all,!<plugin>',] + [ (try 'all,\!<plugin>' if your shell complains...)], plugins=$withval, plugins=all ) @@ -49,16 +51,30 @@ for plugin in $plugins; do case "$plugin" in list) - AC_MSG_RESULT([TO BE DONE...]) + AC_MSG_RESULT( + [available plugins:] + [ apm,asterisk,button_exec,cpuinfo,dbus,diskstats,dvb,exec,event,] + [ fifo,file,gps,hddtemp,huawei,i2c_sensors,iconv,imon,isdn,kvv,] + [ loadavg,meminfo,mpd,mpris_dbus,mysql,netdev,netinfo,pop3,ppp,] + [ proc_stat,python,qnaplog,sample,seti,statfs,uname,uptime,] + [ w1retap,wireless,xmms]) AC_MSG_ERROR([run ./configure --with-plugins=...]) ;; all) PLUGIN_APM="yes" + PLUGIN_ASTERISK="yes" + PLUGIN_BUTTON_EXEC="yes" PLUGIN_CPUINFO="yes" + PLUGIN_DBUS="yes" PLUGIN_DISKSTATS="yes" PLUGIN_DVB="yes" PLUGIN_EXEC="yes" + PLUGIN_EVENT="yes" + PLUGIN_FIFO="yes" PLUGIN_FILE="yes" + PLUGIN_GPS="yes" + PLUGIN_HDDTEMP="yes" + PLUGIN_HUAWEI="yes" PLUGIN_I2C_SENSORS="yes" PLUGIN_ICONV="yes" PLUGIN_IMON="yes" @@ -67,26 +83,39 @@ for plugin in $plugins; do PLUGIN_LOADAVG="yes" PLUGIN_MEMINFO="yes" PLUGIN_MPD="yes" + PLUGIN_MPRIS_DBUS="yes" PLUGIN_MYSQL="yes" PLUGIN_NETDEV="yes" + PLUGIN_NETINFO="yes" PLUGIN_POP3="yes" PLUGIN_PPP="yes" PLUGIN_PROC_STAT="yes" PLUGIN_PYTHON=$with_python + PLUGIN_QNAPLOG="yes" PLUGIN_SAMPLE="yes" PLUGIN_SETI="yes" PLUGIN_STATFS="yes" PLUGIN_UNAME="yes" PLUGIN_UPTIME="yes" + PLUGIN_W1RETAP="yes" PLUGIN_WIRELESS="yes" PLUGIN_XMMS="yes" ;; apm) PLUGIN_APM=$val ;; + button_exec) + PLUGIN_BUTTON_EXEC=$val + ;; + asterisk) + PLUGIN_ASTERISK=$val + ;; cpuinfo) PLUGIN_CPUINFO=$val ;; + dbus) + PLUGIN_DBUS=$val + ;; diskstats) PLUGIN_DISKSTATS=$val ;; @@ -96,9 +125,24 @@ for plugin in $plugins; do exec) PLUGIN_EXEC=$val ;; + event) + PLUGIN_EVENT=$val + ;; + fifo) + PLUGIN_FIFO=$val + ;; file) PLUGIN_FILE=$val ;; + gps) + PLUGIN_GPS=$val + ;; + hddtemp) + PLUGIN_HDDTEMP=$val + ;; + huawei) + PLUGIN_HUAWEI=$val + ;; i2c_sensors) PLUGIN_I2C_SENSORS=$val ;; @@ -123,12 +167,18 @@ for plugin in $plugins; do mpd) PLUGIN_MPD=$val ;; + mpris_dbus) + PLUGIN_MPRIS_DBUS=$val + ;; mysql) PLUGIN_MYSQL=$val ;; netdev) PLUGIN_NETDEV=$val ;; + netinfo) + PLUGIN_NETINFO=$val + ;; pop3) PLUGIN_POP3=$val ;; @@ -141,6 +191,9 @@ for plugin in $plugins; do python) PLUGIN_PYTHON=$val ;; + qnaplog) + PLUGIN_QNAPLOG=$val + ;; sample) PLUGIN_SAMPLE=$val ;; @@ -156,6 +209,9 @@ for plugin in $plugins; do uptime) PLUGIN_UPTIME=$val ;; + w1retap) + PLUGIN_W1RETAP=$val + ;; wireless) PLUGIN_WIRELESS=$val ;; @@ -169,40 +225,139 @@ for plugin in $plugins; do done AC_MSG_RESULT([done]) + +# Advanced Power Management if test "$PLUGIN_APM" = "yes"; then - PLUGINS="$PLUGINS plugin_apm.o" - AC_DEFINE(PLUGIN_APM,1,[apm plugin]) + AC_CHECK_HEADERS(asm/types.h, [has_asm_types="true"], [has_asm_types="false"]) + if test "$has_asm_types" = "true"; then + PLUGINS="$PLUGINS plugin_apm.o" + AC_DEFINE(PLUGIN_APM,1,[apm plugin]) + else + AC_MSG_WARN(asm/types.h header not found: apm plugin disabled) + fi +fi + +if test "$PLUGIN_BUTTON_EXEC" = "yes"; then + PLUGINS="$PLUGINS plugin_button_exec.o" + AC_DEFINE(PLUGIN_BUTTON_EXEC,1,[button_exec plugin]) +fi + +if test "$PLUGIN_ASTERISK" = "yes"; then + PLUGINS="$PLUGINS plugin_asterisk.o" + AC_DEFINE(PLUGIN_ASTERISK,1,[asterisk plugin]) fi + +# /proc/cpuinfo if test "$PLUGIN_CPUINFO" = "yes"; then PLUGINS="$PLUGINS plugin_cpuinfo.o" AC_DEFINE(PLUGIN_CPUINFO,1,[cpuinfo plugin]) fi + +#DBus +if test "$PLUGIN_DBUS" = "yes"; then + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0, HAVE_DBUS="yes", HAVE_DBUS="no") + if test "x$HAVE_DBUS" == "xyes"; then + PLUGINS="$PLUGINS plugin_dbus.o" + PLUGINLIBS="$PLUGINLIBS $DBUS_LIBS" + CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" + AC_DEFINE(PLUGIN_DBUS,1,[dbus plugin]) + + DBUS_VERSION=$($PKG_CONFIG --modversion dbus-1) + DBUS_VERSION_MAJOR=$(echo $DBUS_VERSION | cut -d . -f 1) + DBUS_VERSION_MINOR=$(echo $DBUS_VERSION | cut -d . -f 2) + DBUS_VERSION_MICRO=$(echo $DBUS_VERSION | cut -d . -f 3) + + AC_DEFINE_UNQUOTED(DBUS_VERSION_MAJOR, $DBUS_VERSION_MAJOR, [DBus Major Version]) + AC_DEFINE_UNQUOTED(DBUS_VERSION_MINOR, $DBUS_VERSION_MINOR, [DBus Minor Version]) + AC_DEFINE_UNQUOTED(DBUS_VERSION_MICRO, $DBUS_VERSION_MICRO, [DBus Micro Version]) + else + AC_MSG_WARN(dbus-1 not found check that PKG_CONFIG_PATH is set correctly: dbus plugin disabled) + fi +fi + +# /proc/diskstat if test "$PLUGIN_DISKSTATS" = "yes"; then PLUGINS="$PLUGINS plugin_diskstats.o" AC_DEFINE(PLUGIN_DISKSTATS,1,[diskstats plugin]) fi + +# Digital Video Broadcasting if test "$PLUGIN_DVB" = "yes"; then - AC_CHECK_HEADERS(linux/dvb/frontend.h, [has_dvb_header="true"], [has_dvb_header="false"]) - if test "$has_dvb_header" = "true"; then - PLUGINS="$PLUGINS plugin_dvb.o" - AC_DEFINE(PLUGIN_DVB,1,[dvb plugin]) + AC_CHECK_HEADERS(asm/types.h, [has_asm_types="true"], [has_asm_types="false"]) + if test "$has_asm_types" = "true"; then + AC_CHECK_HEADERS(linux/dvb/frontend.h, [has_dvb_header="true"], [has_dvb_header="false"]) + if test "$has_dvb_header" = "true"; then + PLUGINS="$PLUGINS plugin_dvb.o" + AC_DEFINE(PLUGIN_DVB,1,[dvb plugin]) + else + PLUGINS="$PLUGINS plugin_dvb.o" + AC_MSG_WARN(linux/dvb/frontend.h header not found: using ioctl) + fi else - PLUGINS="$PLUGINS plugin_dvb.o" - AC_MSG_WARN(linux/dvb/frontend.h header not found: using ioctl) - fi + AC_MSG_WARN(asm/types.h header not found: dvb plugin disabled) + fi fi + +# start external commands (exec) if test "$PLUGIN_EXEC" = "yes"; then PLUGINS="$PLUGINS plugin_exec.o" AC_DEFINE(PLUGIN_EXEC,1,[exec plugin]) fi + +# event +if test "$PLUGIN_EVENT" = "yes"; then + PLUGINS="$PLUGINS plugin_event.o" + AC_DEFINE(PLUGIN_EVENT,1,[event plugin]) +fi + +# file if test "$PLUGIN_FILE" = "yes"; then PLUGINS="$PLUGINS plugin_file.o" AC_DEFINE(PLUGIN_FILE,1,[file plugin]) fi + +# FIFO +if test "$PLUGIN_FIFO" = "yes"; then + PLUGINS="$PLUGINS plugin_fifo.o" + AC_DEFINE(PLUGIN_FIFO,1,[fifo plugin]) +fi + +# GPS +if test "$PLUGIN_GPS" = "yes"; then + AC_CHECK_HEADERS(nmeap.h, [has_nmeap_header="true"], [has_nmeap_header="false"]) + if test "$has_nmeap_header" = "true"; then + AC_CHECK_LIB(nmeap, nmeap_init, [has_libnmeap_lib="true"], [has_libnmeap_lib="false"]) + if test "$has_libnmeap_lib" = "true"; then + PLUGINS="$PLUGINS plugin_gps.o" + PLUGINLIBS="$PLUGINLIBS -lnmeap" + AC_DEFINE(PLUGIN_GPS,1,[gps plugin]) + else + AC_MSG_WARN(libnmeap lib not found: gps plugin disabled) + fi + else + AC_MSG_WARN(nmeap.h header not found: gps plugin disabled) + fi +fi + +# hddtemp +if test "$PLUGIN_HDDTEMP" = "yes"; then + PLUGINS="$PLUGINS plugin_hddtemp.o" + AC_DEFINE(PLUGIN_HDDTEMP,1,[hddtemp plugin]) +fi + +# Huawei +if test "$PLUGIN_HUAWEI" = "yes"; then + PLUGINS="$PLUGINS plugin_huawei.o" + AC_DEFINE(PLUGIN_HUAWEI,1,[huawei plugin]) +fi + +# I2C if test "$PLUGIN_I2C_SENSORS" = "yes"; then PLUGINS="$PLUGINS plugin_i2c_sensors.o" AC_DEFINE(PLUGIN_I2C_SENSORS,1,[i2c sensors plugin]) fi + +# IConv if test "$PLUGIN_ICONV" = "yes"; then AM_ICONV if test "$am_cv_func_iconv" = "yes"; then @@ -213,10 +368,19 @@ if test "$PLUGIN_ICONV" = "yes"; then AC_MSG_WARN(iconv not found: iconv plugin disabled) fi fi + +# ISDN monitor if test "$PLUGIN_IMON" = "yes"; then - PLUGINS="$PLUGINS plugin_imon.o" - AC_DEFINE(PLUGIN_IMON,1,[imon plugin]) + AC_CHECK_HEADERS(linux/errno.h, [has_linux_errno="true"], [has_linux_errno="false"]) + if test "$has_linux_errno" = "true"; then + PLUGINS="$PLUGINS plugin_imon.o" + AC_DEFINE(PLUGIN_IMON,1,[imon plugin]) + else + AC_MSG_WARN(linux/errno.h header not found: imon plugin disabled) + fi fi + +# ISDN if test "$PLUGIN_ISDN" = "yes"; then AC_CHECK_HEADERS(linux/isdn.h, [has_isdn_header="true"], [has_isdn_header="false"]) if test "$has_dvb_header" = "false"; then @@ -225,33 +389,59 @@ if test "$PLUGIN_ISDN" = "yes"; then PLUGINS="$PLUGINS plugin_isdn.o" AC_DEFINE(PLUGIN_ISDN,1,[ISDN plugin]) fi + +# Karlsruher Verkehrsverbund if test "$PLUGIN_KVV" = "yes"; then PLUGINS="$PLUGINS plugin_kvv.o" AC_DEFINE(PLUGIN_KVV,1,[kvv plugin]) fi + +# load average if test "$PLUGIN_LOADAVG" = "yes"; then PLUGINS="$PLUGINS plugin_loadavg.o" AC_DEFINE(PLUGIN_LOADAVG,1,[loadavg plugin]) fi + +# meminfo if test "$PLUGIN_MEMINFO" = "yes"; then PLUGINS="$PLUGINS plugin_meminfo.o" AC_DEFINE(PLUGIN_MEMINFO,1,[meminfo plugin]) fi + +# MPD if test "$PLUGIN_MPD" = "yes"; then - AC_CHECK_HEADERS(libmpd/libmpd.h, [has_libmpd_header="true"], [has_libmpd_header="false"]) - if test "$has_libmpd_header" = "true"; then - AC_CHECK_LIB(mpd, mpd_connect, [has_libmpd_lib="true"], [has_libmpd_lib="false"]) - if test "$has_libmpd_lib" = "true"; then - PLUGINS="$PLUGINS plugin_mpd.o" - PLUGINLIBS="$PLUGINLIBS -lmpd" - AC_DEFINE(PLUGIN_MPD,1,[mpd plugin]) + AC_CHECK_LIB(libmpd, [mpd_newConnection], [has_mpd_header="true"], [has_mpd_header="false"]) + if test "$has_mpd_header" = "true"; then + PLUGINS="$PLUGINS plugin_mpd.o" + PLUGINLIBS="$PLUGINLIBS `pkg-config libmpd --libs`" + CPPFLAGS="$CPPFLAGS `pkg-config libmpd --cflags`" + AC_DEFINE(PLUGIN_MPD,1,[mpd plugin]) + else + AC_MSG_WARN(libmpdclient.h header not found: mpd plugin disabled) + AC_MSG_WARN(get libmpdclient.h from http://www.musicpd.org/libmpdclient.shtml) + AC_MSG_WARN(and copy those 2 files in the lcd4linux directory.) + fi +fi + +# MPRIS D-Bus +if test "$PLUGIN_MPRIS_DBUS" = "yes"; then + AC_CHECK_HEADERS(dbus/dbus.h, [has_dbus_header="true"], [has_dbus_header="false"]) + if test "$has_dbus_header" = "true"; then + AC_CHECK_LIB(dbus-1, dbus_bus_get, [has_libdbus1_lib="true"], [has_libdbus1_lib="false"]) + if test "$has_libdbus1_lib" = "true"; then + PLUGINS="$PLUGINS plugin_mpris_dbus.o" + PLUGINLIBS="$PLUGINLIBS -ldbus-1" + AC_DEFINE(PLUGIN_MPRIS_DBUS,1,[mpris_dbus plugin]) else - AC_MSG_WARN(libmpd lib not found: mpd plugin disabled) + AC_MSG_WARN(libdbus-1 lib not found: mpris_dbus plugin disabled) fi else - AC_MSG_WARN(libmpd/libmpd.h header not found: mpd plugin disabled) - fi + AC_MSG_WARN(dbus/dbus.h header not found: mpris_dbus plugin disabled) + fi fi + + +# MySQL if test "$PLUGIN_MYSQL" = "yes"; then AC_CHECK_HEADERS(mysql/mysql.h, [has_mysql_header="true"], [has_mysql_header="false"]) if test "$has_mysql_header" = "true"; then @@ -267,14 +457,26 @@ if test "$PLUGIN_MYSQL" = "yes"; then AC_MSG_WARN(mysql/mysql.h header not found: mysql plugin disabled) fi fi + +# /proc/net/dev if test "$PLUGIN_NETDEV" = "yes"; then PLUGINS="$PLUGINS plugin_netdev.o" AC_DEFINE(PLUGIN_NETDEV,1,[netdev plugin]) fi + +# configuration of network devices +if test "$PLUGIN_NETINFO" = "yes"; then + PLUGINS="$PLUGINS plugin_netinfo.o" + AC_DEFINE(PLUGIN_NETINFO,1,[netinfo plugin]) +fi + +# POP3 if test "$PLUGIN_POP3" = "yes"; then PLUGINS="$PLUGINS plugin_pop3.o" AC_DEFINE(PLUGIN_POP3,1,[POP3 plugin]) fi + +# PPP if test "$PLUGIN_PPP" = "yes"; then AC_CHECK_HEADERS(net/if_ppp.h, [has_ppp_header="true"], [has_ppp_header="false"]) if test "$has_ppp_header" = "true"; then @@ -284,10 +486,14 @@ if test "$PLUGIN_PPP" = "yes"; then AC_MSG_WARN(net/if_ppp.h header not found: ppp plugin disabled) fi fi + +# /proc/stat if test "$PLUGIN_PROC_STAT" = "yes"; then PLUGINS="$PLUGINS plugin_proc_stat.o" AC_DEFINE(PLUGIN_PROC_STAT,1,[proc_stat plugin]) fi + +# python if test "$PLUGIN_PYTHON" = "yes"; then if test "$with_python" != "yes"; then AC_MSG_WARN(python support not enabled: python plugin disabled (use --with-python to enable)) @@ -302,44 +508,83 @@ if test "$PLUGIN_PYTHON" = "yes"; then fi fi fi + +# Qnaplog +if test "$PLUGIN_QNAPLOG" = "yes"; then + AC_CHECK_HEADERS(sqlite3.h, [has_sqlite3_header="true"], [has_sqlite3_header="false"]) + if test "$has_sqlite3_header" = "true"; then + AC_CHECK_LIB(sqlite3, sqlite3_initialize, [has_sqlite3_lib="true"], [has_sqlite3_lib="false"]) + if test "$has_sqlite3_lib" = "true"; then + PLUGINS="$PLUGINS plugin_qnaplog.o" + PLUGINLIBS="$PLUGINLIBS -lsqlite3" + AC_DEFINE(PLUGIN_QNAPLOG,1,[qnaplog plugin]) + else + AC_MSG_WARN(sqlite3 lib not found: qnaplog plugin disabled) + fi + else + AC_MSG_WARN(sqlite3.h header not found: qnaplog plugin disabled) + fi +fi + +# sample if test "$PLUGIN_SAMPLE" = "yes"; then PLUGINS="$PLUGINS plugin_sample.o" AC_DEFINE(PLUGIN_SAMPLE,1,[sample plugin]) fi + +# SETI if test "$PLUGIN_SETI" = "yes"; then PLUGINS="$PLUGINS plugin_seti.o" AC_DEFINE(PLUGIN_SETI,1,[seti plugin]) fi + +# statfs() if test "$PLUGIN_STATFS" = "yes"; then - PLUGINS="$PLUGINS plugin_statfs.o" - AC_DEFINE(PLUGIN_STATFS,1,[statfs plugin]) + AC_CHECK_HEADERS(sys/vfs.h, [has_vfs_header="true"], [has_vfs_header="false"]) + if test "$has_vfs_header" = "true"; then + PLUGINS="$PLUGINS plugin_statfs.o" + AC_DEFINE(PLUGIN_STATFS,1,[statfs plugin]) + else + AC_MSG_WARN(sys/vfs.h header not found: statfs plugin disabled) + fi fi + +# uname if test "$PLUGIN_UNAME" = "yes"; then PLUGINS="$PLUGINS plugin_uname.o" AC_DEFINE(PLUGIN_UNAME,1,[uname plugin]) fi + +# uptime if test "$PLUGIN_UPTIME" = "yes"; then PLUGINS="$PLUGINS plugin_uptime.o" AC_DEFINE(PLUGIN_UPTIME,1,[uptime plugin]) fi + +if test "$PLUGIN_W1RETAP" = "yes"; then + PLUGINS="$PLUGINS plugin_w1retap.o" + AC_DEFINE(PLUGIN_W1RETAP,1,[w1retap plugin]) +fi + +# WLAN if test "$PLUGIN_WIRELESS" = "yes"; then - PLUGINS="$PLUGINS plugin_wireless.o" - AC_DEFINE(PLUGIN_WIRELESS,1,[wireless plugin]) + AC_CHECK_HEADERS(linux/wireless.h, [has_wireless_header="true"], [has_wireless_header="false"]) + if test "$has_wireless_header" = "true"; then + PLUGINS="$PLUGINS plugin_wireless.o" + AC_DEFINE(PLUGIN_WIRELESS,1,[wireless plugin]) + else + AC_MSG_WARN(linux/wireless.h header not found: wireless plugin disabled) + fi fi + +# XMMS if test "$PLUGIN_XMMS" = "yes"; then PLUGINS="$PLUGINS plugin_xmms.o" AC_DEFINE(PLUGIN_XMMS,1,[xmms plugin]) fi -#if test "$PLUGIN_" = "yes"; then -# PLUGINS="$PLUGINS plugin_.o" -# AC_DEFINE(PLUGIN_,1,[plugin]) -#fi - if test "$PLUGINS" = ""; then AC_MSG_ERROR([You should include at least one plugin...]) -#else -# AC_MSG_ERROR($PLUGINS) fi AC_SUBST(PLUGINS) diff --git a/png.html b/png.html new file mode 100644 index 0000000..5cb914b --- /dev/null +++ b/png.html @@ -0,0 +1,8 @@ +<html><head> +<title>PNG Test</title> +</head> +<body> +<h1>PNG test</h1> +<img src=/cgi-bin/nph-png> +</body> +</html> @@ -1,9 +1,9 @@ -/* $Id: property.c 749 2007-01-20 06:37:35Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/property.c $ +/* $Id: property.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/property.c $ * * dynamic properties * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: property.h 749 2007-01-20 06:37:35Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/property.h $ +/* $Id: property.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/property.h $ * * dynamic properties * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: qprintf.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/qprintf.c $ +/* $Id: qprintf.c 918 2008-12-31 06:07:29Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/qprintf.c $ * * simple but quick snprintf() replacement * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * derived from a patch from Martin Hejl which is @@ -31,7 +31,9 @@ * exported functions: * * int qprintf(char *str, size_t size, const char *format, ...) - * works like snprintf(), but format only knows about %d and %s + * works like snprintf(), but format only knows about %d, %x, %u and %s + * and for the numbers an optional length like %<len>d. If <len> beginns + * with '0' the free space is filled with '0's, otherwise with ' ' */ @@ -42,7 +44,7 @@ #include <stdarg.h> #include <string.h> -static char *itoa(char *buffer, const size_t size, int value) +static char *itoa(char *buffer, const size_t size, int value, unsigned int fixedlen, unsigned int fill0) { char *p; int sign; @@ -55,6 +57,8 @@ static char *itoa(char *buffer, const size_t size, int value) sign = 0; if (value < 0) { sign = 1; + if (fill0) + fixedlen -= 1; value = -value; } @@ -69,14 +73,26 @@ static char *itoa(char *buffer, const size_t size, int value) value = value / 10; } while (value != 0 && p > buffer); - if (sign && p > buffer) + if (sign && !fill0 && p > buffer) + *--p = '-'; + + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; + } + } + + if (sign && fill0 && p > buffer) *--p = '-'; return p; } -static char *utoa(char *buffer, const size_t size, unsigned int value) +static char *utoa(char *buffer, const size_t size, unsigned int value, unsigned int fixedlen, unsigned int fill0) { char *p; @@ -95,11 +111,20 @@ static char *utoa(char *buffer, const size_t size, unsigned int value) value = value / 10; } while (value != 0 && p > buffer); + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; + } + } + return p; } -static char *utox(char *buffer, const size_t size, unsigned int value) +static char *utox(char *buffer, const size_t size, unsigned int value, unsigned int fixedlen, unsigned int fill0) { char *p; int digit; @@ -120,10 +145,29 @@ static char *utox(char *buffer, const size_t size, unsigned int value) *--p = (digit < 10 ? '0' : 'a' - 10) + digit; } while (value != 0 && p > buffer); + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; + } + } + return p; } +/*! + @function qprintf + @abstract quick print values into string + @discussion similar to snprintf(), but only support for "%s", "%d", "%u", "%x" with optional length for the numbers + like "%5d" (filled with ' ') or "%05x" (filled with '0') + @param str destination + @param size maximum length of destination string + @param format (like printf() with reduced number of formats) + @result length of produced string +*/ int qprintf(char *str, const size_t size, const char *format, ...) { @@ -145,7 +189,17 @@ int qprintf(char *str, const size_t size, const char *format, ...) char buf[12], *s; int d; unsigned int u; - switch (*++src) { + unsigned int fixedlen = 0; + unsigned int fill0 = 0; + + if (*++src == '0') + fill0 = 1; + while (*src >= '0' && *src <= '9') { + fixedlen = fixedlen * 10 + (*src - '0'); + src++; + } + + switch (*src) { case 's': src++; s = va_arg(ap, char *); @@ -157,7 +211,7 @@ int qprintf(char *str, const size_t size, const char *format, ...) case 'd': src++; d = va_arg(ap, int); - s = itoa(buf, sizeof(buf), d); + s = itoa(buf, sizeof(buf), d, fixedlen, fill0); while (len < size && *s != '\0') { len++; *dst++ = *s++; @@ -166,7 +220,7 @@ int qprintf(char *str, const size_t size, const char *format, ...) case 'u': src++; u = va_arg(ap, unsigned int); - s = utoa(buf, sizeof(buf), u); + s = utoa(buf, sizeof(buf), u, fixedlen, fill0); while (len < size - 1 && *s != '\0') { len++; *dst++ = *s++; @@ -175,7 +229,7 @@ int qprintf(char *str, const size_t size, const char *format, ...) case 'x': src++; u = va_arg(ap, unsigned int); - s = utox(buf, sizeof(buf), u); + s = utox(buf, sizeof(buf), u, fixedlen, fill0); while (len < size - 1 && *s != '\0') { len++; *dst++ = *s++; @@ -1,9 +1,9 @@ -/* $Id: qprintf.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/qprintf.h $ +/* $Id: qprintf.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/qprintf.h $ * * simple but quick snprintf() replacement * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * derived from a patch from Martin Hejl which is @@ -1,9 +1,9 @@ -/* $Id: rgb.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/rgb.c $ +/* $Id: rgb.c 1091 2010-01-21 04:26:24Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/rgb.c $ * * generic color handling * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -25,6 +25,8 @@ */ +#include "config.h" + #include <stdlib.h> #include <string.h> @@ -1,9 +1,9 @@ -/* $Id: rgb.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/rgb.h $ +/* $Id: rgb.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/rgb.h $ * * generic color handling * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/smoketest.sh b/smoketest.sh new file mode 100755 index 0000000..274cf78 --- /dev/null +++ b/smoketest.sh @@ -0,0 +1,41 @@ +#! /bin/bash + +# $Id: smoketest.sh 1137 2011-01-02 00:39:10Z michael $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/smoketest.sh $ + + +rm -f smoketest.log lcd4linux + +make distclean +./bootstrap + +for driver in ASTUSB BeckmannEgle BWCT CrystalFontz Curses Cwlinux D4D EA232graphic EFN G15 GLCD2USB HD44780 IRLCD LCD2USB LCDLinux LCDTerm LEDMatrix LPH7508 LUIse LW_ABP M50530 MatrixOrbital MatrixOrbitalGX MilfordInstruments Noritake NULL Pertelian PHAnderson picoLCD picoLCDGraphic PNG PPM RouterBoard Sample serdisplib SimpleLCD T6963 Trefon ULA200 USBHUB USBLCD WincorNixdorf X11; do + + make distclean + ./configure --with-drivers=$driver + make -s -j 2 + + if [ -x lcd4linux ]; then + echo "Success: drv_$driver" >>smoketest.log + else + echo "FAILED: drv_$driver" >>smoketest.log + fi + +done + +for plugin in apm asterisk button_exec cpuinfo dbus diskstats dvb exec event fifo file gps hddtemp huawei i2c_sensors iconv imon isdn kvv loadavg meminfo mpd mpris_dbus mysql netdev netinfo pop3 ppp proc_stat python qnaplog sample seti statfs uname uptime w1retap wireless xmms; do + + make distclean + ./configure --with-drivers=NULL --with-plugins=$plugin + make -s -j 2 + + if [ -x lcd4linux ]; then + echo "Success: plugin_$plugin" >>smoketest.log + else + echo "FAILED: plugin_$plugin" >>smoketest.log + fi + +done + +make distclean +./configure diff --git a/svn_version.h b/svn_version.h index d164be9..f08d602 100644 --- a/svn_version.h +++ b/svn_version.h @@ -1 +1 @@ -#define SVN_VERSION "796" +#define SVN_VERSION "1092" diff --git a/svn_version.sh b/svn_version.sh index 6ddbd63..776793e 100755 --- a/svn_version.sh +++ b/svn_version.sh @@ -1,7 +1,7 @@ #!/bin/sh # $Id: svn_version.sh 756 2007-01-23 04:38:43Z michael $ -# $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/svn_version.sh $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/svn_version.sh $ OLD_VERSION=`cat svn_version.h 2>/dev/null` @@ -1,9 +1,9 @@ -/* $Id: thread.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/thread.c $ +/* $Id: thread.c 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/thread.c $ * * thread handling (mutex, shmem, ...) * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * parts of this code are based on the old XWindow driver which is @@ -1,9 +1,9 @@ -/* $Id: thread.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/thread.h $ +/* $Id: thread.h 1010 2009-03-27 13:13:28Z michux $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/thread.h $ * * thread handling (mutex, shmem, ...) * - * Copyright (C) 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * parts of this code are based on the old XWindow driver which is @@ -30,6 +30,24 @@ #ifndef _THREAD_H_ #define _THREAD_H_ +#ifdef __CYGWIN__ + +#ifndef HAVE_UNION_SEMUN +union semun { + int val; + struct semid_ds *buf; + unsigned short *array; +}; +#endif + +#ifndef SHM_R +#define SHM_R 0400 +#endif +#ifndef SHM_W +#define SHM_W 0660 +#endif + +#endif extern int thread_argc; extern char **thread_argv; @@ -1,9 +1,9 @@ -/* $Id: timer.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/timer.c $ +/* $Id: timer.c 1143 2011-02-12 22:46:19Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/timer.c $ * - * generic timer handling + * Generic timer handling. * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,17 +22,36 @@ * */ -/* - * exported functions: +/* + * Exported functions: * - * int timer_add (void(*callback)(void *data), void *data, int interval, int one_shot); - * adds a timer to the queue + * int timer_add(void (*callback) (void *data), void *data, const int + * interval, const int one_shot) * - * int timer_process (struct timespec *delay); - * process timer queue + * Create a new timer and add it to the timer queue. * - * void timer_exit(); - * release all timers + * + * int timer_add_late(void (*callback) (void *data), void *data, const + * int interval, const int one_shot) + * + * This function creates a new timer and adds it to the timer queue + * just as timer_add() does, but the timer will NOT be triggered + * immediately (useful for scheduling things). + * + * + * int timer_process(struct timespec *delay) + * + * Process timer queue. + * + * + * int timer_remove(void (*callback) (void *data), void *data) + * + * Remove a new timer with given callback and data. + * + * + * void timer_exit(void) + * + * Release all timers and free the associated memory block. * */ @@ -53,143 +72,442 @@ #include <dmalloc.h> #endif +/* threshold in milliseconds that differentiates between clock skew + and clock jitter */ +#define CLOCK_SKEW_DETECT_TIME_IN_MS 1000 +/* structure for storing all relevant data of a single timer */ typedef struct TIMER { + /* pointer to function of type void func(void *data) that will be + called when the timer is processed; it will also be used to + identify a specific timer */ void (*callback) (void *data); + + /* pointer to data which will be passed to the callback function; + it will also be used to identify a specific timer */ void *data; + + /* struct to hold the time (in seconds and milliseconds since the + Epoch) when the timer will be processed for the next time */ struct timeval when; + + /* specifies the timer's triggering interval in milliseconds */ int interval; + + /* specifies whether the timer should trigger indefinitely until + it is deleted (value of 0) or only once (all other values) */ int one_shot; + + /* marks timer as being active (so it will get processed) or + inactive (which means the timer has been deleted and its + allocated memory may be re-used) */ int active; } TIMER; +/* number of allocated timer slots */ +int nTimers = 0; +/* pointer to memory allocated for storing the timer slots */ TIMER *Timers = NULL; -int nTimers = 0; -static void timer_inc(struct timeval *tv, const int msec) +static void timer_inc(const int timer, struct timeval *now) +/* Update the time a given timer updates next. + + timer (integer): internal ID of timer that is to be updated + + now (timeval pointer): struct holding the "current" time + + return value: void + */ +{ + /* calculate the time difference between the last time the given + timer has been processed and the current time */ + struct timeval diff; + timersub(now, &Timers[timer].when, &diff); + + /* convert this time difference to fractional seconds */ + float time_difference = diff.tv_sec + diff.tv_usec / 1000000.0f; + + /* convert time difference to fractional milliseconds */ + time_difference = time_difference * 1000.0f; + + /* calculate the number of timer intervals that have passed since + the last timer the given timer has been processed -- value is + truncated (rounded down) to an integer */ + int number_of_intervals = (int) (time_difference / Timers[timer].interval); + + /* notify the user in case one or more timer intervals have been + missed */ + if (number_of_intervals > 0) + info("Timer #%d skipped %d interval(s) or %d ms.", timer, number_of_intervals, + number_of_intervals * Timers[timer].interval); + + /* increment the number of passed intervals in order to skip all + missed intervals -- thereby avoiding that unprocessed timers + stack up, continuously update and are notoriously late (certain + railway companies might learn a lesson from us <g>) */ + number_of_intervals++; + + /* calculate time difference between the last time the timer has + been processed and the next time it will be processed */ + int interval = Timers[timer].interval * number_of_intervals; + + /* convert time difference (in milliseconds) to a "timeval" + struct (in seconds and microseconds) */ + struct timeval tv_interval = { + .tv_sec = interval / 1000, + .tv_usec = (interval % 1000) * 1000 + }; + + /* finally, add time difference to the timer's trigger */ + timeradd(&Timers[timer].when, &tv_interval, &Timers[timer].when); +} + + +int timer_remove(void (*callback) (void *data), void *data) +/* Remove a timer with given callback and data. + + callback (void pointer): function of type void func(void *data); + here, it will be used to identify the timer + + data (void pointer): data which will be passed to the callback + function; here, it will be used to identify the timer + + return value (integer): returns a value of 0 on successful timer + removal; otherwise returns a value of -1 +*/ { - tv->tv_sec += msec / 1000; - tv->tv_usec += (msec - 1000 * (msec / 1000)) * 1000; + int timer; /* current timer's ID */ + + /* loop through the timer slots and try to find the specified + timer slot by looking for its settings */ + for (timer = 0; timer < nTimers; timer++) { + /* skip inactive (i.e. deleted) timers */ + if (Timers[timer].active == 0) + continue; - if (tv->tv_usec >= 1000000) { - tv->tv_usec -= 1000000; - tv->tv_sec++; + if (Timers[timer].callback == callback && Timers[timer].data == data) { + /* we have found the timer slot, so mark it as being inactive; + we will not actually delete the slot, so its allocated + memory may be re-used */ + Timers[timer].active = 0; + + /* signal successful timer removal */ + return 0; + } } + + /* we have NOT found the timer slot, so signal failure by + returning a value of -1 */ + return -1; } int timer_add(void (*callback) (void *data), void *data, const int interval, const int one_shot) -{ - int i; - struct timeval now; +/* Create a new timer and add it to the timer queue. + + callback (void pointer): function of type void func(void *data) + which will be called whenever the timer triggers; this pointer + will also be used to identify a specific timer - /* find a free slot */ - for (i = 0; i < nTimers; i++) { - if (Timers[i].active == 0) + data (void pointer): data which will be passed to the callback + function; this pointer will also be used to identify a specific + timer + + interval (integer): specifies the timer's triggering interval in + milliseconds + + one_shot (integer): specifies whether the timer should trigger + indefinitely until it is deleted (value of 0) or only once (all + other values) + + return value (integer): returns a value of 0 on successful timer + creation; otherwise returns a value of -1 +*/ +{ + int timer; /* current timer's ID */ + struct timeval now; /* struct to hold current time */ + + /* try to minimize memory usage by looping through the timer slots + and looking for an inactive timer */ + for (timer = 0; timer < nTimers; timer++) { + if (Timers[timer].active == 0) { + /* we've just found one, so let's reuse it ("timer" holds its + ID) by breaking the loop */ break; + } } - /* none found, allocate a new slot */ - if (i >= nTimers) { + /* no inactive timers (or none at all) found, so we have to add a + new timer slot */ + if (timer >= nTimers) { + /* increment number of timers and (re-)allocate memory used for + storing the timer slots */ nTimers++; Timers = realloc(Timers, nTimers * sizeof(*Timers)); + + /* make sure "timer" points to valid memory */ + timer = nTimers - 1; + + /* realloc() has failed */ + if (Timers == NULL) { + /* restore old number of timers */ + nTimers--; + + /* signal unsuccessful timer creation */ + return -1; + } } + /* get current time so the timer triggers immediately */ gettimeofday(&now, NULL); - /* fill slot */ - Timers[i].callback = callback; - Timers[i].data = data; - Timers[i].when = now; - Timers[i].interval = interval; - Timers[i].one_shot = one_shot; - Timers[i].active = 1; + /* initialize timer data */ + Timers[timer].callback = callback; + Timers[timer].data = data; + Timers[timer].when = now; + Timers[timer].interval = interval; + Timers[timer].one_shot = one_shot; + + /* set timer to active so that it is processed and not overwritten + by the memory optimization routine above */ + Timers[timer].active = 1; - /* if one-shot timer, don't fire now */ + /* one-shot timers should NOT fire immediately, so delay them by a + single timer interval */ if (one_shot) { - timer_inc(&Timers[i].when, interval); + timer_inc(timer, &now); } + /* signal successful timer creation */ return 0; } +int timer_add_late(void (*callback) (void *data), void *data, const int interval, const int one_shot) +/* This function creates a new timer and adds it to the timer queue + just as timer_add() does, but the timer will NOT be triggered + immediately (useful for scheduling things). + + callback (void pointer): function of type void func(void *data) + which will be called whenever the timer triggers; this pointer + will also be used to identify a specific timer + + data (void pointer): data which will be passed to the callback + function; this pointer will also be used to identify a specific + timer + + interval (integer): specifies the timer's triggering interval in + milliseconds + + one_shot (integer): specifies whether the timer should trigger + indefinitely until it is deleted (value of 0) or only once (all + other values) + + return value (integer): returns a value of 0 on successful timer + creation; otherwise returns a value of -1 +*/ +{ + /* create new timer slot and add it to the timer queue; mask it as + one-shot timer for now, so the timer will be delayed by a + single timer interval */ + if (!timer_add(callback, data, interval, 1)) { + /* signal unsuccessful timer creation */ + return -1; + } + + int timer; /* current timer's ID */ + + /* loop through the timer slots and try to find the new timer slot + by looking for its settings */ + for (timer = 0; timer < nTimers; timer++) { + /* skip inactive (i.e. deleted) timers */ + if (Timers[timer].active == 0) + continue; + + if (Timers[timer].callback == callback && Timers[timer].data == data && Timers[timer].interval == interval) { + /* we have found the new timer slot, so unmask it by setting + its "one_shot" variable to the REAL value; then signal + successful timer creation */ + Timers[timer].one_shot = one_shot; + + /* signal successful timer creation */ + return 0; + } + } + + /* we have NOT found the new timer slot for some reason, so signal + failure by returning a value of -1 */ + return -1; +} + + int timer_process(struct timespec *delay) +/* Process timer queue. + + delay (timespec pointer): struct holding delay till the next + upcoming timer event + + return value (integer): returns a value of 0 when timers have been + processed successfully; otherwise returns a value of -1 +*/ { - int i, flag, min; - struct timeval now; + struct timeval now; /* struct to hold current time */ - /* the current moment */ + /* get current time to check which timers need processing */ gettimeofday(&now, NULL); - /* sanity check */ - if (nTimers == 0) { - error("huh? not one single timer to process? dazed and confused..."); + /* sanity check; by now, at least one timer should be + instantiated */ + if (nTimers <= 0) { + /* otherwise, print an error and return a value of -1 to + signal an error */ + error("Huh? Not even a single timer to process? Dazed and confused..."); return -1; } - /* process expired timers */ - flag = 0; - for (i = 0; i < nTimers; i++) { - if (Timers[i].active == 0) + int timer; /* current timer's ID */ + + /* process all expired timers */ + for (timer = 0; timer < nTimers; timer++) { + /* skip inactive (i.e. deleted) timers */ + if (Timers[timer].active == 0) continue; - if (timercmp(&Timers[i].when, &now, <=)) { - flag = 1; - /* callback */ - if (Timers[i].callback != NULL) { - Timers[i].callback(Timers[i].data); + + /* check whether current timer needs to be processed, i.e. the + timer's triggering time is less than or equal to the current + time; according to the man page of timercmp(), this avoids + using the operators ">=", "<=" and "==" which might be broken + on some systems */ + if (!timercmp(&Timers[timer].when, &now, >)) { + /* if the timer's callback function has been set, call it and + pass the corresponding data */ + if (Timers[timer].callback != NULL) { + Timers[timer].callback(Timers[timer].data); } - /* respawn or delete timer */ - if (Timers[i].one_shot) { - Timers[i].active = 0; + + /* check for one-shot timers */ + if (Timers[timer].one_shot) { + /* mark one-shot timer as inactive (which means the timer has + been deleted and its allocated memory may be re-used) */ + Timers[timer].active = 0; } else { - Timers[i].when = now; - timer_inc(&Timers[i].when, Timers[i].interval); + /* otherwise, re-spawn timer by adding one triggering interval + to its triggering time */ + timer_inc(timer, &now); } } } - /* find next timer */ - flag = 1; - min = -1; - for (i = 0; i < nTimers; i++) { - if (Timers[i].active == 0) + int next_timer = -1; /* ID of the next upcoming timer */ + + /* loop through the timer slots and try to find the next upcoming + timer */ + for (timer = 0; timer < nTimers; timer++) { + /* skip inactive (i.e. deleted) timers */ + if (Timers[timer].active == 0) continue; - if (flag || timercmp(&Timers[i].when, &Timers[min].when, <)) { - flag = 0; - min = i; + + /* if this is the first timer that we check, mark it as the next + upcoming timer; otherwise, we'll have nothing to compare + against in this loop */ + if (next_timer < 0) + next_timer = timer; + /* check whether current timer needs processing prior to the one + selected */ + else if (timercmp(&Timers[timer].when, &Timers[next_timer].when, <)) { + /* if so, mark it as the next upcoming timer */ + next_timer = timer; } } - if (min < 0) { - error("huh? not one single timer left? dazed and confused..."); + /* sanity check; we should by now have found the next upcoming + timer */ + if (next_timer < 0) { + /* otherwise, print an error and return a value of -1 to signal an + error */ + error("Huh? Not even a single timer left? Dazed and confused..."); return -1; } - /* delay until next timer event */ - delay->tv_sec = Timers[min].when.tv_sec - now.tv_sec; - delay->tv_nsec = Timers[min].when.tv_usec - now.tv_usec; - if (delay->tv_nsec < 0) { - delay->tv_sec--; - delay->tv_nsec += 1000000; + /* processing all the timers might have taken a while, so update + the current time to compensate for processing delay */ + gettimeofday(&now, NULL); + + struct timeval diff; /* struct holding the time difference + between current time and the triggering time of the + next upcoming timer event */ + + /* calculate delay to the next upcoming timer event and store it + in "diff" */ + timersub(&Timers[next_timer].when, &now, &diff); + + /* a negative delay has occurred (positive clock skew or some + timers are faster than the time needed for processing their + callbacks) */ + if (diff.tv_sec < 0) { + /* zero "diff" so the next update is triggered immediately */ + timerclear(&diff); + } else { + /* convert "diff" to milliseconds */ + int time_difference = diff.tv_sec * 1000 + diff.tv_usec / 1000; + + /* if there is a notable difference between "time_difference" and + the next upcoming timer's interval, assume clock skew */ + if (time_difference > (Timers[next_timer].interval + CLOCK_SKEW_DETECT_TIME_IN_MS)) { + /* extract clock skew from "time_difference" by eliminating + the timer's triggering interval */ + int skew = time_difference - Timers[next_timer].interval; + + /* display an info message to inform the user */ + info("Oops, clock skewed by %d ms, updating timestamps...", skew); + + /* convert clock skew from milliseconds to "timeval" + structure */ + struct timeval clock_skew = { + .tv_sec = skew / 1000, + .tv_usec = (skew % 1000) * 1000 + }; + + /* process all timers */ + for (timer = 0; timer < nTimers; timer++) { + /* skip inactive (i.e. deleted) timers */ + if (Timers[timer].active == 0) + continue; + + /* correct timer's time stamp by clock skew */ + timersub(&Timers[timer].when, &clock_skew, &Timers[timer].when); + } + + /* finally, zero "diff" so the next update is triggered + immediately */ + timerclear(&diff); + } } - /* nanoseconds!! */ - delay->tv_nsec *= 1000; - return 0; + /* set timespec "delay" passed by calling function to "diff" */ + delay->tv_sec = diff.tv_sec; + /* timespec uses nanoseconds instead of microseconds!!! */ + delay->tv_nsec = diff.tv_usec * 1000; + /* signal successful timer processing */ + return 0; } void timer_exit(void) -{ +/* Release all timers and free the associated memory block. + return value: void +*/ +{ + /* reset number of allocated timer slots */ nTimers = 0; + /* free memory used for storing the timer slots */ if (Timers != NULL) { - free(Timers);; + free(Timers); Timers = NULL; } } @@ -1,9 +1,9 @@ -/* $Id: timer.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/timer.h $ +/* $Id: timer.h 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/timer.h $ * * generic timer handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -28,8 +28,15 @@ #ifndef _TIMER_H_ #define _TIMER_H_ + int timer_add(void (*callback) (void *data), void *data, const int interval, const int one_shot); + +int timer_add_late(void (*callback) (void *data), void *data, const int interval, const int one_shot); + int timer_process(struct timespec *delay); -void timer_exit(); + +int timer_remove(void (*callback) (void *data), void *data); + +void timer_exit(void); #endif diff --git a/timer_group.c b/timer_group.c new file mode 100644 index 0000000..f6d7a5a --- /dev/null +++ b/timer_group.c @@ -0,0 +1,557 @@ +/* $Id: timer_group.c 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/timer_group.c $ + * + * Generic grouping of widgets that have been set to the same update + * interval, thus allowing synchronized updates. + * + * Copyright (C) 2010 Martin Zuther <code@mzuther.de> + * Copyright (C) 2010 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * Based on "timer.c" which is + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> + * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +/* + * Exported functions: + * + * void timer_process_group(void *data) + * + * Process all widgets of a timer group; if the timer group only + * contains one-shot timers, it will be deleted after processing. + * + * + * void timer_exit_group(void) + * + * Release all timer groups and widgets and free the associated + * memory blocks. + * + * + * int timer_add_widget(void (*callback) (void *data), void *data, + * const int interval, const int one_shot) + * + * Add widget to timer group of the specified update interval + * (also creates a new timer group if necessary). + * + * + * int timer_remove_widget(void (*callback) (void *data), void *data) + * + * Remove widget from the timer group with the specified update + * interval (also removes corresponding timer group if empty). + * + */ + + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "debug.h" +#include "cfg.h" +#include "timer.h" +#include "timer_group.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + +/* structure for storing all relevant data of a single timer group */ +typedef struct TIMER_GROUP { + /* pointer to the group's triggering interval in milliseconds; + this will be used to identify a specific timer group and also + as callback data for the underlying generic timer */ + int *interval; + + /* marks timer group as being active (so it will get processed) or + inactive (which means the timer group has been deleted and its + allocated memory may be re-used) */ + int active; +} TIMER_GROUP; + +/* number of allocated timer group slots */ +int nTimerGroups = 0; + +/* pointer to memory allocated for storing the timer group slots */ +TIMER_GROUP *TimerGroups = NULL; + + +/* structure for storing all relevant timer data of a single widget */ +typedef struct TIMER_GROUP_WIDGET { + /* pointer to function of type void func(void *data) that will be + called when the timer is processed; it will also be used to + identify a specific widget */ + void (*callback) (void *data); + + /* pointer to data which will be passed to the callback function; + it will also be used to identify a specific widget */ + void *data; + + /* specifies the timer's triggering interval in milliseconds; it + will also be used to identify a specific widget */ + int interval; + + /* specifies whether the timer should trigger indefinitely until + it is deleted (value of 0) or only once (all other values) */ + int one_shot; + + /* marks timer as being active (so it will get processed) or + inactive (which means the timer has been deleted and its + allocated memory may be re-used) */ + int active; +} TIMER_GROUP_WIDGET; + +/* number of allocated widget slots */ +int nTimerGroupWidgets = 0; + +/* pointer to memory allocated for storing the widget slots */ +TIMER_GROUP_WIDGET *TimerGroupWidgets = NULL; + + +int timer_group_exists(const int interval) +/* Check whether a timer group for the specified interval exists. + + interval (integer): the sought-after triggering interval in + milliseconds + + return value (integer): returns a value of 1 if timer group + exists; otherwise returns a value of 0 +*/ +{ + int group; /* current timer group's ID */ + + /* loop through the timer group slots to search for one that + matches the specified interval */ + for (group = 0; group < nTimerGroups; group++) { + /* skip inactive (i.e. deleted) timer groups */ + if (TimerGroups[group].active == 0) + continue; + + if (*TimerGroups[group].interval == interval) { + /* matching timer group found, so signal success by returning + a value of 1 */ + return 1; + } + } + + /* matching timer group not found, so signal failure by returning + a value of 0 */ + return 0; +} + + +int timer_add_group(const int interval) +/* Create a new timer group (unless it already exists) and link it to + the timer queue. + + interval (integer): the new timer group's triggering interval in + milliseconds + + return value (integer): returns a value of 0 on successful timer + group creation; otherwise returns a value of -1 +*/ +{ + /* if timer group for update interval already exists, signal + success by returning a value of 0 */ + if (timer_group_exists(interval)) + return 0; + + /* display an info message to inform the user that a new timer + group is being created */ + info("Creating new timer group (%d ms)", interval); + + int group; /* current timer group's ID */ + + /* try to minimize memory usage by looping through timer group + slots and looking for an inactive timer group */ + for (group = 0; group < nTimerGroups; group++) { + if (TimerGroups[group].active == 0) { + /* we've just found one, so let's reuse it ("group" holds its + ID) by breaking the loop */ + break; + } + } + + /* no inactive timer groups (or none at all) found, so we have to + add a new timer group slot */ + if (group >= nTimerGroups) { + /* increment number of timer groups and (re-)allocate memory used + for storing the timer group slots */ + nTimerGroups++; + TimerGroups = realloc(TimerGroups, nTimerGroups * sizeof(*TimerGroups)); + + /* make sure "group" points to valid memory */ + group = nTimerGroups - 1; + + /* realloc() has failed */ + if (TimerGroups == NULL) { + /* restore old number of timer groups */ + nTimerGroups--; + + /* signal unsuccessful timer group creation */ + return -1; + } + + /* allocate memory for the underlying generic timer's callback + data (i.e. the group's triggering interval in milliseconds) */ + TimerGroups[group].interval = malloc(sizeof(int)); + + /* malloc() has failed */ + if (TimerGroups[group].interval == NULL) { + /* signal unsuccessful timer group creation */ + return -1; + } + } + + /* initialize timer group's interval */ + *TimerGroups[group].interval = interval; + + /* set timer group to active so that it is processed and not + overwritten by the memory optimization routine above */ + TimerGroups[group].active = 1; + + /* finally, request a generic timer that calls this group and + signal success or failure */ + return timer_add(timer_process_group, TimerGroups[group].interval, interval, 0); +} + + +int timer_remove_group(const int interval) +/* Remove a timer group and unlink it from the timer queue (also + removes all remaining widget slots in this timer group). + + interval (integer): triggering interval in milliseconds; here, it + will be used to identify the timer group + + return value (integer): returns a value of 0 on successful timer + group removal; otherwise returns a value of -1 +*/ +{ + /* display an info message to inform the user that a timer group + is being removed */ + info("Removing timer group (%d ms)", interval); + + int group; /* current timer group's ID */ + int widget; /* current widget's ID */ + + /* loop through the widget slots to look for remaining widgets + with the specified update interval */ + for (widget = 0; widget < nTimerGroupWidgets; widget++) { + /* skip inactive (i.e. deleted) widget slots */ + if (TimerGroupWidgets[widget].active == 0) + continue; + + if (TimerGroupWidgets[widget].interval == interval) { + /* we have found a matching widget slot, so mark it as being + inactive; we will not actually delete the slot, so its + allocated memory may be re-used */ + TimerGroupWidgets[widget].active = 0; + } + } + + /* loop through timer group slots and try to find the specified + timer group slot by looking for its settings */ + for (group = 0; group < nTimerGroups; group++) { + /* skip inactive (i.e. deleted) timer groups */ + if (TimerGroups[group].active == 0) + continue; + + if (*TimerGroups[group].interval == interval) { + /* we have found the timer group slot, so mark it as being + inactive; we will not actually delete the slot, so its + allocated memory may be re-used */ + TimerGroups[group].active = 0; + + /* remove the generic timer that calls this group */ + if (timer_remove(timer_process_group, TimerGroups[group].interval)) { + /* signal successful removal of timer group */ + return 0; + } else { + /* an error occurred on generic timer removal, so signal + failure by returning a value of -1 */ + return -1; + } + } + } + + /* we have NOT found the timer group slot, so signal failure by + returning a value of -1 */ + return -1; +} + + +int timer_remove_empty_group(const int interval) +/* Remove timer group *only* if it contains no more widget slots. + + interval (integer): triggering interval in milliseconds; here, it + will be used to identify the timer group + + return value (integer): returns a value of 0 on successful + processing; otherwise returns a value of -1 +*/ +{ + int widget; /* current widget's ID */ + + /* loop through the widget slots to look for widgets with the + specified update interval */ + for (widget = 0; widget < nTimerGroupWidgets; widget++) { + /* skip inactive (i.e. deleted) widget slots */ + if (TimerGroupWidgets[widget].active == 0) + continue; + + /* at least one other widget with specified update interval + exists, so signal success by returning a value of 0 */ + if (TimerGroupWidgets[widget].interval == interval) + return 0; + } + + /* no other widgets with specified update interval exist, so + remove corresponding timer group and signal success or + failure */ + return timer_remove_group(interval); +} + + +void timer_process_group(void *data) +/* Process all widgets of a timer group; if the timer group only + contains one-shot timers, it will be deleted after processing. + + data (void pointer): points to an integer holding the triggering + interval in milliseconds; here, it will be used to identify the + timer group + + return value: void +*/ +{ + int widget; /* current widget's ID */ + + /* convert callback data to integer (triggering interval in + milliseconds) */ + int interval = *((int *) data); + + /* sanity check; by now, at least one timer group should be + instantiated */ + if (nTimerGroups <= 0) { + /* otherwise, print an error and return early */ + error("Huh? Not even a single timer group to process? Dazed and confused..."); + return; + } + + /* sanity check; by now, at least one widget slot should be + instantiated */ + if (nTimerGroupWidgets <= 0) { + /* otherwise, print an error and return early */ + error("Huh? Not even a single widget slot to process? Dazed and confused..."); + return; + } + + /* loop through widgets and search for those matching the timer + group's update interval */ + for (widget = 0; widget < nTimerGroupWidgets; widget++) { + /* skip inactive (i.e. deleted) widgets */ + if (TimerGroupWidgets[widget].active == 0) + continue; + + /* the current widget belongs to the specified timer group */ + if (TimerGroupWidgets[widget].interval == interval) { + /* if the widget's callback function has been set, call it and + pass the corresponding data */ + if (TimerGroupWidgets[widget].callback != NULL) + TimerGroupWidgets[widget].callback(TimerGroupWidgets[widget].data); + + /* mark one-shot widget as inactive (which means the it has + been deleted and its allocated memory may be re-used) */ + if (TimerGroupWidgets[widget].one_shot) { + TimerGroupWidgets[widget].active = 0; + + /* also remove the corresponding timer group if it is empty */ + timer_remove_empty_group(interval); + } + } + } +} + + +int timer_add_widget(void (*callback) (void *data), void *data, const int interval, const int one_shot) +/* Add widget to timer group of the specified update interval + (also creates a new timer group if necessary). + + callback (void pointer): function of type void func(void *data) + which will be called whenever the timer group triggers; this + pointer will also be used to identify a specific widget + + data (void pointer): data which will be passed to the callback + function; this pointer will also be used to identify a specific + widget + + interval (integer): specifies the timer's triggering interval in + milliseconds + + one_shot (integer): specifies whether the timer should trigger + indefinitely until it is deleted (value of 0) or only once (all + other values) + + return value (integer): returns a value of 0 on successful widget + addition; otherwise returns a value of -1 +*/ +{ + int widget; /* current widget's ID */ + + /* if no timer group for update interval exists, create one */ + if (!timer_group_exists(interval)) { + /* creation of new timer group failed, so signal failure by + returning a value of -1 */ + if (timer_add_group(interval) != 0) + return -1; + } + + /* try to minimize memory usage by looping through the widget + slots and looking for an inactive widget slot */ + for (widget = 0; widget < nTimerGroupWidgets; widget++) { + if (TimerGroupWidgets[widget].active == 0) { + /* we've just found one, so let's reuse it ("widget" holds its + ID) by breaking the loop */ + break; + } + } + + /* no inactive widget slots (or none at all) found, so we have to + add a new widget slot */ + if (widget >= nTimerGroupWidgets) { + /* increment number of widget slots and (re-)allocate memory used + for storing the widget slots */ + nTimerGroupWidgets++; + TimerGroupWidgets = realloc(TimerGroupWidgets, nTimerGroupWidgets * sizeof(*TimerGroupWidgets)); + + /* make sure "widget" points to valid memory */ + widget = nTimerGroupWidgets - 1; + + /* realloc() has failed */ + if (TimerGroupWidgets == NULL) { + /* restore old number of widget slots */ + nTimerGroupWidgets--; + + /* signal unsuccessful creation of widget slot */ + return -1; + } + } + + /* initialize widget slot */ + TimerGroupWidgets[widget].callback = callback; + TimerGroupWidgets[widget].data = data; + TimerGroupWidgets[widget].interval = interval; + TimerGroupWidgets[widget].one_shot = one_shot; + + /* set widget slot to active so that it is processed and not + overwritten by the memory optimization routine above */ + TimerGroupWidgets[widget].active = 1; + + /* signal successful addition of widget slot */ + return 0; +} + + +int timer_remove_widget(void (*callback) (void *data), void *data) +/* Remove widget from the timer group with the specified update + interval (also removes corresponding timer group if empty). + + callback (void pointer): function of type void func(void *data); + here, it will be used to identify a specific widget + + data (void pointer): data which will be passed to the callback + function; here, it will be used to identify a specific widget + + return value (integer): returns a value of 0 on successful widget + removal; otherwise returns a value of -1 +*/ +{ + int widget; /* current widget's ID */ + int interval = -1; /* specified widget's triggering interval in + milliseconds */ + + /* loop through the widget slots and try to find the specified + widget slot by looking for its settings */ + for (widget = 0; widget < nTimerGroupWidgets; widget++) { + /* skip inactive (i.e. deleted) widget slots */ + if (TimerGroupWidgets[widget].active == 0) + continue; + + if (TimerGroupWidgets[widget].callback == callback && TimerGroupWidgets[widget].data == data) { + /* we have found the widget slot, so mark it as being + inactive; we will not actually delete the slot, so its + allocated memory may be re-used */ + TimerGroupWidgets[widget].active = 0; + + /* store the widget's triggering interval for later use and + break the loop */ + interval = TimerGroupWidgets[widget].interval; + break; + } + } + + /* if no matching widget was found, signal an error by returning + a value of -1 */ + if (interval < 0) + return -1; + + /* if no other widgets with specified update interval exist, + remove corresponding timer group and signal success or + failure */ + return timer_remove_empty_group(interval); +} + + +void timer_exit_group(void) +/* Release all timer groups and widgets and free the associated + memory blocks. + + return value: void +*/ +{ + int group; /* current timer group's ID */ + + /* loop through all timer groups and remove them one by one */ + for (group = 0; group < nTimerGroups; group++) { + /* remove generic timer */ + timer_remove(timer_process_group, TimerGroups[group].interval); + + /* free memory allocated for callback data (i.e. the group's + triggering interval in milliseconds) */ + free(TimerGroups[group].interval); + } + + /* reset number of allocated timer groups */ + nTimerGroups = 0; + + /* free allocated memory containing the timer group slots */ + if (TimerGroups != NULL) { + free(TimerGroups); + TimerGroups = NULL; + } + + /* reset number of allocated widget slots */ + nTimerGroupWidgets = 0; + + /* free allocated memory containing the widget slots */ + if (TimerGroupWidgets != NULL) { + free(TimerGroupWidgets); + TimerGroupWidgets = NULL; + } +} diff --git a/timer_group.h b/timer_group.h new file mode 100644 index 0000000..af50125 --- /dev/null +++ b/timer_group.h @@ -0,0 +1,41 @@ +/* $Id: timer_group.h 1136 2010-11-28 16:07:16Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/timer_group.h $ + * + * generic grouping of widget timers that have been set to the same + * update interval, thus allowing synchronized updates + * + * Copyright (C) 2010 Martin Zuther <code@mzuther.de> + * Copyright (C) 2010 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * + * This file is part of LCD4Linux. + * + * LCD4Linux is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * LCD4Linux is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +#ifndef _TIMER_GROUP_H_ +#define _TIMER_GROUP_H_ + + +void timer_process_group(void *data); + +void timer_exit_group(void); + +int timer_add_widget(void (*callback) (void *data), void *data, const int interval, const int one_shot); + +int timer_remove_widget(void (*callback) (void *data), void *data); + +#endif Binary files differ@@ -1,9 +1,9 @@ -/* $Id: udelay.c 789 2007-04-30 04:48:10Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/udelay.c $ +/* $Id: udelay.c 844 2007-10-01 15:49:21Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/udelay.c $ * * short delays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -1,9 +1,9 @@ -/* $Id: udelay.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/udelay.h $ +/* $Id: udelay.h 1126 2010-07-13 03:25:44Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/udelay.h $ * * short delays * - * Copyright (C) 1999, 2000 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -31,14 +31,14 @@ /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ static inline void rep_nop(void) { -# if defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) +#if defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) /* intel or amd64 arch, the "rep" and "nop" opcodes are available */ __asm__ __volatile__("rep; nop"); -# else +#else /* other Arch, maybe add core cooldown code here, too. */ do { } while (0); -# endif +#endif } void udelay_init(void); diff --git a/usbhub.conf b/usbhub.conf new file mode 100644 index 0000000..0886953 --- /dev/null +++ b/usbhub.conf @@ -0,0 +1,94 @@ +# $Id: usbhub.conf 730 2007-01-14 13:50:28Z michael $ +# $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/usbhub.conf $ + +Variables { + tick 50 + netstep 0.5 + diskstep 1.5 +} + +Display SitecomHUB { + Driver 'USBHUB' + Vendor '0x04b4' + Product '0x6560' +} + +Display TyphoonHUB { + Driver 'USBHUB' + Vendor '0x0409' + Product '0x0058' +} + + +Widget GPO_Test300 { + class 'GPO' + expression 2+(1+test::onoff(1))/2 + update 300 +} +Widget GPO_Test400 { + class 'GPO' + expression 2+(1+test::onoff(2))/2 + update 400 +} +Widget GPO_Test500 { + class 'GPO' + expression 2+(1+test::onoff(3))/2 + update 500 +} +Widget GPO_Test600 { + class 'GPO' + expression 2+(1+test::onoff(4))/2 + update 600 +} + + +# Display network activity as pulse duration on the hub leds. +# currently configured to +# +# 0 % pulse width : traffic < exp(10) == 22kbyte/sec +# 50 % pulse width : traffic about exp(13.5) == 730kbyte/sec +# 100 % pulse width : traffic > exp(16) == 8886kbyte/sec +# +# Which is quite suitable for a 100mbit network. + +Widget Net_RX { + class 'GPO' + expression (exp(10+test::bar(1,6,0,0.5)) < netdev('eth0', 'Rx_bytes', (6/netstep)*2*tick))?2:3 + update tick +} +Widget Net_TX { + class 'GPO' + expression (exp(10+test::bar(2,6,0,0.5)) < netdev('eth0', 'Tx_bytes', (6/netstep)*2*tick))?2:3 + update tick +} + +# As above, but for disk read/writes, pwm for 0bytes/sec .. 33MB/sec (e^9 * 4096) +Widget SDA_read { + class 'GPO' + expression (exp(test::bar(3,9,0,diskstep)) < diskstats('sda', 'read_sectors', (9/diskstep)*2*tick))?2:3 + update tick +} +Widget SDA_write{ + class 'GPO' + expression (exp(test::bar(4,9,0,diskstep)) < diskstats('sda', 'write_sectors', (9/diskstep)*2*tick))?2:3 + update tick +} + +Layout TestHUB { + GPO1 'GPO_Test300' + GPO2 'GPO_Test400' + GPO3 'GPO_Test500' + GPO4 'GPO_Test600' +} + +Layout NetAndHDD { + GPO1 'Net_RX' + GPO2 'Net_TX' + GPO3 'SDA_read' + GPO4 'SDA_write' +} + +#Display 'SitecomHUB' +Display 'TyphoonHUB' +#Layout 'TestHUB' +Layout 'NetAndHDD' @@ -1,9 +1,9 @@ -/* $Id: widget.c 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget.c $ +/* $Id: widget.c 996 2009-03-23 17:22:24Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget.c $ * * generic widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * int widget_junk(void) @@ -128,6 +128,32 @@ int widget_color(const char *section, const char *name, const char *key, RGBA * return 1; } +int intersect(WIDGET * w1, WIDGET * w2) +{ + int x1w1, y1w1, x2w1, y2w1; /* 1st rectangle */ + int x1w2, y1w2, x2w2, y2w2; /* 2nd rectangle */ + + if (w1->x2 == NOCOORD || w1->y2 == NOCOORD || w2->x2 == NOCOORD || w2->y2 == NOCOORD) { + /* w1 or w2 is no display widget: no intersection */ + return 0; + } + x1w1 = MIN(w1->col, w1->x2); + x2w1 = MAX(w1->col, w1->x2); + y1w1 = MIN(w1->row, w1->y2); + y2w1 = MAX(w1->row, w1->y2); + x1w2 = MIN(w2->col, w2->x2); + x2w2 = MAX(w2->col, w2->x2); + y1w2 = MIN(w2->row, w2->y2); + y2w2 = MAX(w2->row, w2->y2); + + if (x1w2 < x2w1 && x2w2 > x1w1 && y1w2 < y2w1 && y2w2 > y1w1) { + /* true: Intersection */ + return 1; + } else { + return 0; + } +} + int widget_add(const char *name, const int type, const int layer, const int row, const int col) { int i; @@ -180,6 +206,19 @@ int widget_add(const char *name, const int type, const int layer, const int row, /* check if widget type matches */ if (Class->type != type) { error("widget '%s': class '%s' not applicable", name, class); + switch (Class->type) { + case WIDGET_TYPE_RC: + error(" Widgetclass %s is placed by Row/Column", class); + break; + case WIDGET_TYPE_XY: + error(" Widgetclass %s is placed by X/Y", class); + break; + case WIDGET_TYPE_GPO: + case WIDGET_TYPE_TIMER: + case WIDGET_TYPE_KEYPAD: + default: + error(" Widgetclass %s has unknown type %d", class, Class->type); + } free(class); return -1; } @@ -200,7 +239,7 @@ int widget_add(const char *name, const int type, const int layer, const int row, /* another sanity check */ if (nWidgets >= MAX_WIDGETS) { - error("internal error: widget buffer full!"); + error("internal error: widget buffer full! Tried to allocate %d widgets (max: %d)", nWidgets, MAX_WIDGETS); return -1; } @@ -231,6 +270,22 @@ int widget_add(const char *name, const int type, const int layer, const int row, Class->init(Widget); } + info(" widget '%s': Class '%s', Parent '%s', Layer %d, %s %d, %s %d (to %d,%d)", + name, (NULL == Class) ? "<none>" : Class->name, + (NULL == Parent) ? "<root>" : Parent->name, + layer, (WIDGET_TYPE_XY == Class->type) ? "Y" : "Row", row, (WIDGET_TYPE_XY == Class->type) ? "X" : "Col", col, + Widget->y2, Widget->x2); + + /* sanity check: look for overlapping widgets */ + for (i = 0; i < nWidgets - 1; i++) { + if (Widgets[i].layer == layer) { + if (intersect(&(Widgets[i]), Widget)) { + info("WARNING widget %s(%i,%i) intersects with %s(%i,%i) on layer %d", + Widgets[i].name, Widgets[i].row, Widgets[i].col, name, row, col, layer); + } + } + } + return 0; } @@ -1,9 +1,9 @@ -/* $Id: widget.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget.h $ +/* $Id: widget.h 996 2009-03-23 17:22:24Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget.h $ * * generic widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -56,6 +56,8 @@ typedef struct WIDGET { int row; int col; void *data; + int x2; /* x of opposite corner, -1 for no display widget */ + int y2; /* y of opposite corner, -1 for no display widget */ } WIDGET; @@ -68,8 +70,15 @@ typedef struct WIDGET { int widget_register(WIDGET_CLASS * widget); void widget_unregister(void); +int intersect(WIDGET * w1, WIDGET * w2); int widget_add(const char *name, const int type, const int layer, const int row, const int col); WIDGET *widget_find(int type, void *needle); int widget_color(const char *section, const char *name, const char *key, RGBA * C); +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#undef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#define NOCOORD (-1) + #endif diff --git a/widget_bar.c b/widget_bar.c index 7421205..3399a04 100644 --- a/widget_bar.c +++ b/widget_bar.c @@ -1,9 +1,9 @@ -/* $Id: widget_bar.c 789 2007-04-30 04:48:10Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_bar.c $ +/* $Id: widget_bar.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_bar.c $ * * bar widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Bar @@ -41,7 +41,7 @@ #include "debug.h" #include "cfg.h" #include "property.h" -#include "timer.h" +#include "timer_group.h" #include "widget.h" #include "widget_bar.h" @@ -75,10 +75,12 @@ void widget_bar_update(void *Self) min = P2N(&Bar->expr_min); } else { min = Bar->min; - if (val1 < min) + if (val1 < min) { min = val1; - if (val2 < min) + } + if (val2 < min) { min = val2; + } } /* maximum: if expression is empty, do auto-scaling */ @@ -87,10 +89,17 @@ void widget_bar_update(void *Self) max = P2N(&Bar->expr_max); } else { max = Bar->max; - if (val1 > max) + if (val1 > max) { max = val1; - if (val2 > max) + } + if (val2 > max) { max = val2; + } + } + + /* debugging */ + if (Bar->min != min || Bar->max != max) { + debug("Bar '%s': new scale %G - %G", W->name, min, max); } /* calculate bar values */ @@ -145,18 +154,27 @@ int widget_bar_init(WIDGET * Self) switch (toupper(*c)) { case 'E': Bar->direction = DIR_EAST; + Self->x2 = Self->col + Bar->length - 1; + Self->y2 = Self->row; break; case 'W': Bar->direction = DIR_WEST; + Self->x2 = Self->col + Bar->length - 1; + Self->y2 = Self->row; break; case 'N': Bar->direction = DIR_NORTH; + Self->x2 = Self->col; + Self->y2 = Self->row + Bar->length - 1; break; case 'S': Bar->direction = DIR_SOUTH; + Self->x2 = Self->col; + Self->y2 = Self->row + Bar->length - 1; break; default: - error("widget %s has unknown direction '%s', using 'East'", Self->name, c); + error("widget %s has unknown direction '%s'; known directions: 'E', 'W', 'N', 'S'; using 'E(ast)'", Self->name, + c); Bar->direction = DIR_EAST; } free(c); @@ -166,12 +184,12 @@ int widget_bar_init(WIDGET * Self) switch (toupper(*c)) { case 'H': Bar->style = STYLE_HOLLOW; - if (!(Bar->direction & (DIR_EAST | DIR_WEST))) { - error("widget %s with style \"hollow\" not implemented", Self->name); - Bar->style = 0; - } + break; + case '0': + Bar->style = 0; break; default: + error("widget %s has unknown style '%s'; known styles: '0' or 'H'; using '0'", Self->name, c); Bar->style = 0; } free(c); @@ -186,7 +204,7 @@ int widget_bar_init(WIDGET * Self) free(section); Self->data = Bar; - timer_add(widget_bar_update, Self, Bar->update, 0); + timer_add_widget(widget_bar_update, Self, Bar->update, 0); return 0; } diff --git a/widget_bar.h b/widget_bar.h index 40e5d99..c50cb6d 100644 --- a/widget_bar.h +++ b/widget_bar.h @@ -1,9 +1,9 @@ -/* $Id: widget_bar.h 749 2007-01-20 06:37:35Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_bar.h $ +/* $Id: widget_bar.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_bar.h $ * * bar widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/widget_gpo.c b/widget_gpo.c index e6dbaca..2b56f32 100644 --- a/widget_gpo.c +++ b/widget_gpo.c @@ -1,9 +1,9 @@ -/* $Id: widget_gpo.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_gpo.c $ +/* $Id: widget_gpo.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_gpo.c $ * * GPO widget handling * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_GPO @@ -41,7 +41,7 @@ #include "debug.h" #include "cfg.h" #include "property.h" -#include "timer.h" +#include "timer_group.h" #include "widget.h" #include "widget_gpo.h" @@ -65,7 +65,7 @@ void widget_gpo_update(void *Self) /* add a new one-shot timer */ if (P2N(&GPO->update) > 0) { - timer_add(widget_gpo_update, Self, P2N(&GPO->update), 1); + timer_add_widget(widget_gpo_update, Self, P2N(&GPO->update), 1); } } @@ -96,6 +96,9 @@ int widget_gpo_init(WIDGET * Self) free(section); Self->data = GPO; + /* no display dimension */ + Self->x2 = NOCOORD; + Self->y2 = NOCOORD; /* fire it the first time */ widget_gpo_update(Self); diff --git a/widget_gpo.h b/widget_gpo.h index ca4c068..d67fdfa 100644 --- a/widget_gpo.h +++ b/widget_gpo.h @@ -1,9 +1,9 @@ -/* $Id: widget_gpo.h 751 2007-01-20 13:52:43Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_gpo.h $ +/* $Id: widget_gpo.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_gpo.h $ * * GPO widget handling * - * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2005, 2006, 2007 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/widget_icon.c b/widget_icon.c index b1a811d..152343b 100644 --- a/widget_icon.c +++ b/widget_icon.c @@ -1,9 +1,9 @@ -/* $Id: widget_icon.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_icon.c $ +/* $Id: widget_icon.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_icon.c $ * * icon widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Icon @@ -42,7 +42,7 @@ #include "cfg.h" #include "qprintf.h" #include "property.h" -#include "timer.h" +#include "timer_group.h" #include "widget.h" #include "widget_icon.h" @@ -101,11 +101,18 @@ void widget_icon_update(void *Self) /* evaluate properties */ property_eval(&Icon->speed); property_eval(&Icon->visible); - - /* rotate icon bitmap */ - Icon->curmap++; - if (Icon->curmap >= Icon->maxmap) - Icon->curmap = 0; + property_eval(&Icon->frame); + + int frame = P2N(&Icon->frame); + if ((frame >= 0) && (frame <= Icon->maxmap)) { + /* select icon bitmap by evaluated frame number */ + Icon->curmap = frame; + } else { + /* rotate icon bitmap */ + Icon->curmap++; + if (Icon->curmap >= Icon->maxmap) + Icon->curmap = 0; + } } /* finally, draw it! */ @@ -114,7 +121,7 @@ void widget_icon_update(void *Self) /* add a new one-shot timer */ if (P2N(&Icon->speed) > 0) { - timer_add(widget_icon_update, Self, P2N(&Icon->speed), 1); + timer_add_widget(widget_icon_update, Self, P2N(&Icon->speed), 1); } } @@ -140,12 +147,15 @@ int widget_icon_init(WIDGET * Self) /* load properties */ property_load(section, "speed", "100", &Icon->speed); property_load(section, "visible", "1", &Icon->visible); + property_load(section, "frame", "-1", &Icon->frame); /* read bitmap */ widget_icon_read_bitmap(section, Icon); free(section); Self->data = Icon; + Self->x2 = Self->col + 1; + Self->y2 = Self->row + 1; /* as the speed is evaluatod on every call, we use 'one-shot'-timers. */ /* The timer will be reactivated on every call to widget_icon_update(). */ @@ -178,6 +188,7 @@ int widget_icon_quit(WIDGET * Self) WIDGET_ICON *Icon = Self->data; property_free(&Icon->speed); property_free(&Icon->visible); + property_free(&Icon->frame); if (Icon->bitmap) free(Icon->bitmap); free(Self->data); diff --git a/widget_icon.h b/widget_icon.h index 9f993d1..2d61699 100644 --- a/widget_icon.h +++ b/widget_icon.h @@ -1,9 +1,9 @@ -/* $Id: widget_icon.h 748 2007-01-20 05:00:06Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_icon.h $ +/* $Id: widget_icon.h 1035 2009-05-19 10:42:01Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_icon.h $ * * icon widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -33,6 +33,7 @@ typedef struct WIDGET_ICON { PROPERTY speed; /* update interval (msec) */ PROPERTY visible; /* icon visible? */ + PROPERTY frame; /* evaluated expression of frame number (optional) */ int ascii; /* ascii code of icon (depends on the driver) */ int curmap; /* current bitmap sequence */ int prvmap; /* previous bitmap sequence */ diff --git a/widget_image.c b/widget_image.c index d4c78d1..ef095c6 100644 --- a/widget_image.c +++ b/widget_image.c @@ -1,9 +1,9 @@ -/* $Id: widget_image.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_image.c $ +/* $Id: widget_image.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_image.c $ * * image widget handling * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Image @@ -59,7 +59,7 @@ #include "cfg.h" #include "qprintf.h" #include "property.h" -#include "timer.h" +#include "timer_group.h" #include "widget.h" #include "widget_image.h" #include "rgb.h" @@ -195,7 +195,7 @@ static void widget_image_update(void *Self) /* add a new one-shot timer */ if (P2N(&Image->update) > 0) { - timer_add(widget_image_update, Self, P2N(&Image->update), 1); + timer_add_widget(widget_image_update, Self, P2N(&Image->update), 1); } } @@ -237,6 +237,8 @@ int widget_image_init(WIDGET * Self) free(section); Self->data = Image; + Self->x2 = Self->col + Image->width; + Self->y2 = Self->row + Image->height; } else { diff --git a/widget_image.h b/widget_image.h index 07121ee..c8a79f4 100644 --- a/widget_image.h +++ b/widget_image.h @@ -1,9 +1,9 @@ -/* $Id: widget_image.h 728 2007-01-14 11:14:38Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_image.h $ +/* $Id: widget_image.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_image.h $ * * image widget handling * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. diff --git a/widget_keypad.c b/widget_keypad.c index ba81fc7..35df70a 100644 --- a/widget_keypad.c +++ b/widget_keypad.c @@ -1,5 +1,5 @@ -/* $Id: widget_keypad.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_keypad.c $ +/* $Id: widget_keypad.c 996 2009-03-23 17:22:24Z volker $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_keypad.c $ * * keypad widget handling * @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Keypad @@ -103,6 +103,8 @@ int widget_keypad_init(WIDGET * Self) free(section); Self->data = keypad; + Self->x2 = NOCOORD; + Self->y2 = NOCOORD; return 0; } diff --git a/widget_keypad.h b/widget_keypad.h index 839e594..f825c7f 100644 --- a/widget_keypad.h +++ b/widget_keypad.h @@ -1,5 +1,5 @@ /* $Id: widget_keypad.h 748 2007-01-20 05:00:06Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_keypad.h $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_keypad.h $ * * keypad widget handling * diff --git a/widget_text.c b/widget_text.c index ffe1863..1199e40 100644 --- a/widget_text.c +++ b/widget_text.c @@ -1,10 +1,11 @@ -/* $Id: widget_text.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_text.c $ +/* $Id: widget_text.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_text.c $ * * simple text widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> + * Copyright (C) 2008 Michael Vogt <michu@neophob.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,11 +23,11 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Text - * a simple text widget which + * a simple text widget which * must be supported by all displays * */ @@ -44,9 +45,11 @@ #include "evaluator.h" #include "property.h" #include "timer.h" +#include "timer_group.h" +#include "event.h" #include "widget.h" #include "widget_text.h" -# + #ifdef WITH_DMALLOC #include <dmalloc.h> #endif @@ -85,12 +88,66 @@ void widget_text_scroll(void *Self) if (pad < 0) pad = 0; break; + case ALIGN_AUTOMATIC: + if (len <= width) { + pad = 0; + break; + } case ALIGN_MARQUEE: pad = width - T->scroll; T->scroll++; if (T->scroll >= width + len) T->scroll = 0; break; + case ALIGN_PINGPONG_LEFT: + case ALIGN_PINGPONG_CENTER: + case ALIGN_PINGPONG_RIGHT: +#define PINGPONGWAIT 2 + + /* scrolling is not necessary - align the string */ + if (len <= width) { + switch (T->align) { + case ALIGN_PINGPONG_LEFT: + pad = 0; + break; + case ALIGN_PINGPONG_RIGHT: + pad = width - len; + if (pad < 0) + pad = 0; + break; + default: + pad = (width - len) / 2; + if (pad < 0) + pad = 0; + break; + } + } else { + if (T->direction == 1) + T->scroll++; /* scroll right */ + else + T->scroll--; /* scroll left */ + + /*pad = if positive, add leading space characters, else offset of string begin */ + pad = 0 - T->scroll; + + if (pad < 0 - (len - width)) { + if (T->delay-- < 1) { /* wait before switch direction */ + T->direction = 0; /* change scroll direction */ + T->delay = PINGPONGWAIT; + T->scroll -= PINGPONGWAIT; + } /* else debug("wait1"); */ + pad = 0 - (len - width); + } else if (pad > 0) { + if (T->delay-- < 1) { + T->direction = 1; + T->delay = PINGPONGWAIT; + T->scroll += PINGPONGWAIT; + } /* else debug("wait2"); */ + pad = 0; + } + + } + break; default: /* not reached */ pad = 0; } @@ -216,10 +273,17 @@ void widget_text_update(void *Self) if (update) { /* reset marquee counter if content has changed */ T->scroll = 0; + + /* Init pingpong scroller. start scrolling left (wrong way) to get a delay */ + if (T->align == ALIGN_PINGPONG_LEFT || T->align == ALIGN_PINGPONG_CENTER || T->align == ALIGN_PINGPONG_RIGHT) { + T->direction = 0; + T->delay = PINGPONGWAIT; + } /* if there's a marquee scroller active, it has its own */ /* update callback timer, so we do nothing here; otherwise */ /* we simply call this scroll callback directly */ - if (T->align != ALIGN_MARQUEE) { + if (T->align != ALIGN_MARQUEE || T->align != ALIGN_AUTOMATIC || T->align != ALIGN_PINGPONG_LEFT + || T->align != ALIGN_PINGPONG_CENTER || T->align != ALIGN_PINGPONG_RIGHT) { widget_text_scroll(Self); } } @@ -266,7 +330,7 @@ int widget_text_init(WIDGET * Self) /* field alignment: Left (default), Center, Right or Marquee */ c = cfg_get(section, "align", "L"); - switch (toupper(*c)) { + switch (toupper(c[0])) { case 'L': Text->align = ALIGN_LEFT; break; @@ -279,6 +343,25 @@ int widget_text_init(WIDGET * Self) case 'M': Text->align = ALIGN_MARQUEE; break; + case 'A': + Text->align = ALIGN_AUTOMATIC; + break; + case 'P': + switch (toupper(c[1])) { + case 'C': + Text->align = ALIGN_PINGPONG_CENTER; + break; + case 'L': + Text->align = ALIGN_PINGPONG_LEFT; + break; + case 'R': + Text->align = ALIGN_PINGPONG_RIGHT; + break; + default: + Text->align = ALIGN_PINGPONG_CENTER; + error("widget %s has unknown alignment '%s', using 'Centered Pingpong'", section, c); + } + break; default: error("widget %s has unknown alignment '%s', using 'Left'", section, c); Text->align = ALIGN_LEFT; @@ -292,21 +375,35 @@ int widget_text_init(WIDGET * Self) Text->update = 10; /* marquee scroller speed: interval (msec), default 500msec */ - if (Text->align == ALIGN_MARQUEE) { + if (Text->align == ALIGN_MARQUEE || Text->align == ALIGN_AUTOMATIC || Text->align == ALIGN_PINGPONG_LEFT + || Text->align == ALIGN_PINGPONG_CENTER || Text->align == ALIGN_PINGPONG_RIGHT) { cfg_number(section, "speed", 500, 10, -1, &(Text->speed)); } + //update on this event + char *event_name = cfg_get(section, "event", ""); + if (*event_name != '\0') { + named_event_add(event_name, widget_text_update, Self); + if (Text->update == 1000) { + Text->update = 0; + } + } + free(event_name); + /* buffer */ Text->buffer = malloc(Text->width + 1); free(section); Self->data = Text; + Self->x2 = Self->col + Text->width; + Self->y2 = Self->row; /* add update timer, use one-shot if 'update' is zero */ - timer_add(widget_text_update, Self, Text->update, Text->update == 0); + timer_add_widget(widget_text_update, Self, Text->update, Text->update == 0); /* a marquee scroller has its own timer and callback */ - if (Text->align == ALIGN_MARQUEE) { + if (Text->align == ALIGN_MARQUEE || Text->align == ALIGN_AUTOMATIC || Text->align == ALIGN_PINGPONG_LEFT + || Text->align == ALIGN_PINGPONG_CENTER || Text->align == ALIGN_PINGPONG_RIGHT) { timer_add(widget_text_scroll, Self, Text->speed, 0); } diff --git a/widget_text.h b/widget_text.h index 1a09faf..858635a 100644 --- a/widget_text.h +++ b/widget_text.h @@ -1,9 +1,9 @@ -/* $Id: widget_text.h 748 2007-01-20 05:00:06Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_text.h $ +/* $Id: widget_text.h 1083 2010-01-18 13:12:25Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_text.h $ * * simple text widget handling * - * Copyright (C) 2003, 2004 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2003, 2004 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. @@ -30,7 +30,9 @@ #include "property.h" -typedef enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_MARQUEE } TEXT_ALIGN; +typedef enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_MARQUEE, ALIGN_AUTOMATIC, ALIGN_PINGPONG_LEFT, + ALIGN_PINGPONG_CENTER, ALIGN_PINGPONG_RIGHT +} TEXT_ALIGN; typedef struct WIDGET_TEXT { PROPERTY prefix; /* label on the left side */ @@ -41,10 +43,12 @@ typedef struct WIDGET_TEXT { char *buffer; /* string with 'width+1' bytes allocated */ int width; /* field width */ int precision; /* number of digits after the decimal point */ - TEXT_ALIGN align; /* alignment: L(eft), C(enter), R(ight), M(arquee) */ + TEXT_ALIGN align; /* alignment: L(eft), C(enter), R(ight), M(arquee), A(utomatic) */ int update; /* update interval */ int scroll; /* marquee starting point */ int speed; /* marquee scrolling speed */ + int direction; /* pingpong direction, 0=right, 1=left */ + int delay; /* pingpong scrolling, wait before switch direction */ } WIDGET_TEXT; diff --git a/widget_timer.c b/widget_timer.c index 23f8c02..4ba243e 100644 --- a/widget_timer.c +++ b/widget_timer.c @@ -1,9 +1,9 @@ -/* $Id: widget_timer.c 773 2007-02-25 12:39:09Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_timer.c $ +/* $Id: widget_timer.c 1106 2010-02-07 14:03:46Z mzuther $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_timer.c $ * * timer widget handling * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * */ -/* +/* * exported functions: * * WIDGET_CLASS Widget_Timer @@ -42,7 +42,7 @@ #include "cfg.h" #include "qprintf.h" #include "property.h" -#include "timer.h" +#include "timer_group.h" #include "widget.h" #include "widget_timer.h" @@ -72,7 +72,7 @@ void widget_timer_update(void *Self) } /* add a new one-shot timer */ - timer_add(widget_timer_update, Self, update, 1); + timer_add_widget(widget_timer_update, Self, update, 1); } @@ -98,6 +98,8 @@ int widget_timer_init(WIDGET * Self) free(section); Self->data = Timer; + Self->x2 = NOCOORD; + Self->y2 = NOCOORD; /* just do it! */ widget_timer_update(Self); diff --git a/widget_timer.h b/widget_timer.h index 4decab3..dece0b8 100644 --- a/widget_timer.h +++ b/widget_timer.h @@ -1,9 +1,9 @@ -/* $Id: widget_timer.h 748 2007-01-20 05:00:06Z michael $ - * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/widget_timer.h $ +/* $Id: widget_timer.h 840 2007-09-09 12:17:42Z michael $ + * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/widget_timer.h $ * * timer widget handling * - * Copyright (C) 2006 Michael Reinelt <reinelt@eunet.at> + * Copyright (C) 2006 Michael Reinelt <michael@reinelt.co.at> * Copyright (C) 2006 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net> * * This file is part of LCD4Linux. |