Compare commits

...
Author SHA1 Message Date
Alexander Ponyatykh 9b57b2e29c Compliant to policy 4.4.1 2019-11-19 00:51:09 +03:00
Alexander Ponyatykh 107f0d8a79 Remove unused variables
Global variable keyhandler is declared as pointer to incomplete struct
type. Upon closer inspection, it turned out that this variable and
client_handles_keys are unused.
2019-11-18 23:58:12 +03:00
Alexander Ponyatykh 7d071c32b7 Reinitialize on any error code, not just a negative one.
Upstream libg15 propagates any error code from libusb to the caller,
and legacy libusb-0.1 uses standard codes from errno.h with minus sign
resulting in negative integers. Previous version of reinit-on-any-error
patch uses this fact and calls re_initLibG15() on any negative return
value of getPressedKeys().

The new libusb-1.0 uses its own error codes, not compatible with the
old ones. While rewriting libg15 to use the new library, I decided
to translate LIBUSB_ERROR_* codes to G15_ERROR_*, which are positive
integers. This change requires us to modify reinit-on-any-error patch
to call re_initLibG15() on any error code, not just a negative one.
2019-11-17 15:24:38 +03:00
Andrej Shadura 96591e26fa Rebuild (no source changes) 2019-11-16 19:25:25 +01:00
Andrej Shadura 9907e0062b Finalise the changelog 2019-10-19 21:17:49 +02:00
Andrej Shadura a3bbbca557 Add myself as an uploader 2019-10-19 21:17:47 +02:00
Andrej Shadura 351c169ea5 d/watch: Use https protocol 2019-10-19 21:17:46 +02:00
Andrej Shadura 5fb544492b d/control: Add Vcs-* field 2019-10-19 21:17:45 +02:00
Andrej Shadura 617a6ef06c d/changelog: Remove trailing whitespaces 2019-10-19 21:17:44 +02:00
Andrej Shadura 503d5138ca Use debhelper-compat instead of debian/compat 2019-10-19 21:17:42 +02:00
Andrej Shadura 7aab0cc87f Wrap and sort 2019-10-19 21:17:35 +02:00
ranma dda0192482 Fix typo in postinst script. 2019-10-19 21:08:35 +02:00
ranma 6c79eaa189 Add dependency on libg15-1 (>= 1.2.7-3) 2019-10-19 21:07:40 +02:00
Alexander Ponyatykh b4412b7c70 * Reintroduce package. (Closes: bug#928158)
* Convert source to 3.0 (quilt) format.
  * Migrate from cdbs to debhelper.
  * Merge from Ubuntu:
    - libg15daemon_client/g15daemon_net.c: Fix a potential buffer overflow.
  * debian/patches/07-reinit-on-any-error.diff: reinitialize on any error
    returned by libusb to correctly recover after suspend/resume. (LP: #1357556)
  * /etc/init.d/g15daemon: overhaul.
    - Replace /dev/input/uinput with /dev/uinput. (Closes: bug#687663).
    - Use "udevadm settle" instead of polling /dev/uinput.
    - Use log_*_msg functions instead of echo.
    - Add dependency on $remote_fs.
    - Remove bashism. (Closes: bug#772244)
    - Return 0 exit code if the daemon fails to start.
      (LP: #617101, LP: #1103275)
    - Don't stop or restart on udev events, because g15daemon now properly
      handles replugging.
  * Remove build dependency on libusb.
  * Remove dependency on libg15daemon-client1 for g15daemon.
  * Add dependency on udev for g15daemon.
  * Change priority of packages to optional.
  * Add native systemd service. (LP: #1441365)
  * /etc/default/g15daemon: remove SWITCH_KEY option to keep systemd service
    file simple.
  * Add subsystem check to udev matching rules.
  * Multiarchify the library packages. (Closes: bug#812952)
  * Do not install *.la files.
  * Change package description. (Closes: bug#802652)
2019-05-02 18:15:52 +03:00
Eric Dorland 59793e4434 Import Debian changes 1.9.5.3-8.3
g15daemon (1.9.5.3-8.3) unstable; urgency=medium

  * Non-maintainer upload.
  * debian/control: Drop unnecessary automake1.9 build deps. (Closes:
    #724371)
2014-03-04 23:50:12 -05:00
Luk Claes 1363e7ede4 Import Debian changes 1.9.5.3-8.2
g15daemon (1.9.5.3-8.2) unstable; urgency=low

  * Non-maintainer upload.
  * Use ATTR instead of SYSFS in udev rules (closes: #573434).
  * Remove references to other libraries from dependency_libs field
    (closes: #629592).
2011-05-31 07:33:52 +02:00
Julien Cristau 9be03a7841 Import Debian changes 1.9.5.3-8.1
g15daemon (1.9.5.3-8.1) unstable; urgency=low

  * Non-maintainer upload.
  * Send a sync event after key up/down (closes: #567213).
2010-07-25 11:39:22 +02:00
Giacomo Catenazzi 1525a75133 Import Debian changes 1.9.5.3-8
g15daemon (1.9.5.3-8) unstable; urgency=low

  * Put the third argument (modes) on open with O_CREAT (Closes: #559649)
  * remove rpath
2009-12-18 07:52:26 +01:00
Giacomo Catenazzi e34c9fcf1c Import Debian changes 1.9.5.3-7
g15daemon (1.9.5.3-7) unstable; urgency=low

  * Don't distribute .la file
2009-10-08 07:22:15 +02:00
Giacomo Catenazzi c9a200ca8e Import Debian changes 1.9.5.3-6
g15daemon (1.9.5.3-6) unstable; urgency=low

  * Shared devices (lcd dispaly + audio) are not good handled
    by udev script. Adding workaround until improving
    programs to handle disconnections (Closes: #541780)
  * Add debugging flag (and code) for init.d and udev scripts
  * Change syslog facility: from user to daemon
  * better (and more secure) screenshort creation in /tmp
2009-08-19 07:33:22 +02:00
Giacomo Catenazzi b6a96a4dd3 Import Debian changes 1.9.5.3-5
g15daemon (1.9.5.3-5) unstable; urgency=low

  * Handle keyboard device with udev, so detecting detachement
    and attachment of keyboarda (Closes: #489978).
  * init.d LSB header: try to start before xorg, to be able
    to have full access to all extra keys.
  * Recent libg15 corrected strange behaviour in new G15 keyboard
    (Closes: #494180)
2009-08-13 08:20:02 +02:00
Giacomo Catenazzi c8d7f9138e Import Debian changes 1.9.5.3-4
g15daemon (1.9.5.3-4) unstable; urgency=low

  * Try to load uinput module, in order to have Gx key working
    (Closes: #475000).
  * Usual updates
2009-08-06 08:32:33 +02:00
Giacomo Catenazzi be8ef5acb3 Import Debian changes 1.9.5.3-3
g15daemon (1.9.5.3-3) unstable; urgency=low

  * Changing default in /etc/default/g15daemon: Use L1 key instead of MR
    as actual upstream default and allowing to use g15macro
    (Closes: #478069)
  * Removed the X11 setup on man page, because it is not relevant
    to recent distributions and could confuse our users (Closes: #463078)
2008-04-28 08:47:07 +02:00
Giacomo Catenazzi c1e37ff1ff Import Debian changes 1.9.5.3-2
g15daemon (1.9.5.3-2) unstable; urgency=low

  * Recommend xkb-data instead of keyboard-config. Adapted patch from
    Amaya, thanks! (Closes: #474451).
2008-04-07 19:56:34 +02:00
Giacomo Catenazzi b0d19d1e70 Import Debian changes 1.9.5.3-1
g15daemon (1.9.5.3-1) unstable; urgency=low

  * New upstream version
2008-02-14 08:08:03 +01:00
Giacomo Catenazzi c7666acd5c Import Upstream version 1.9.5.3 2019-04-29 15:43:03 +02:00
Giacomo Catenazzi 18176a4efe Import Upstream version 1.9.5.2 2019-04-29 15:43:03 +02:00
Giacomo Catenazzi 9602397440 Import Upstream version 1.9.1.0.svn346 2019-04-29 15:43:02 +02:00
Giacomo Catenazzi 1610f485ef Import Debian changes 1.9.5.2-2
g15daemon (1.9.5.2-2) unstable; urgency=low

  * Handle better errors in the init.d script (Closes: #463073)
2008-01-29 20:15:35 +01:00
Giacomo Catenazzi 1577a9b44e Import Debian changes 1.9.5.2-1
g15daemon (1.9.5.2-1) unstable; urgency=low

  * New upstream version
  * Change default behaviour: to switch client use MR (as already documented
    in /etc/default/g15daemon, but wrongly implemented)
2008-01-28 09:12:16 +01:00
Giacomo Catenazzi a5486422e2 Import Debian changes 1.9.1.0.svn346-1
g15daemon (1.9.1.0.svn346-1) unstable; urgency=low

  * New upstream version (from svn)
2007-12-18 09:15:42 +01:00
71 changed files with 46557 additions and 498 deletions

No files matched your search

+3
View File
@@ -17,3 +17,6 @@ Lars Sanders
Fabrizio Sestito Fabrizio Sestito
- changes required to compile on OS-X - changes required to compile on OS-X
- OS-X kext file - OS-X kext file
Matthew McGee
- Solaris Documentation
+90 -12
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 295 $ - $Date: 2007-09-09 06:37:50 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $ $Revision: 458 $ - $Date: 2008-01-31 15:48:40 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -84,14 +84,92 @@ allow clients use of all 'L' keys.
1.2.5svn -> current 1.2.5svn -> current
- Add compiletime check for uinput version, should resolve compilation problems on some distro's - Add compiletime check for uinput version, should resolve compilation problems on some distro's
- Security improved - the daemon now sets its effective uid to nobody as soon as possible. - Security improved - the daemon now sets its effective uid to nobody as soon as possible.
1.9.0SVN 1.9.0
- Add plugin API - Feature: Add plugin API
- partially rewritten event core - Feature: partially rewritten event core
- updated g15daemon_xmms_spectrum plugin with new features, available in trunk/g15daemon_audio_plugins (SVN) - Feature: updated g15daemon_xmms_spectrum plugin with new features, available in trunk/g15daemon_audio_plugins (SVN)
- Clock is now a plugin - Feature: Clock is now a plugin
- dependency on libdaemon is now removed - Feature: dependency on libdaemon is now removed
- g15daemon is now dependant on libg15render. - Feature: g15daemon is now dependant on libg15render.
- Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr> - Feature: Clock now includes analog clock thanks to Rasta Freak <igor.jusic@zg.t-com.hr>
- Moved g15daemon_xmms_spectrum plugin to separate package - Moved g15daemon_xmms_spectrum plugin to separate package
- Plugins are now installed in ${PREFIX}/lib/g15daemon/${VERSION}/plugins 1.9.1
- OS-X support thanks to Fabrizio Sestito. - BugFix: Plugins are now installed in ${PREFIX}/{${LIBDIR}/g15daemon/${VERSION}/plugins
- Feature: OS-X support thanks to Fabrizio Sestito.
- Bugfix: libg15daemon_client: keypresses were being corrupted.
- Bugfix: libg15daemon_client: use g15_recv rather than recv.
- Bugfix: use default scheduling for all threads.
- Optimisation: minor optimisation of lcd_cycle() code.
- Security: repair some potential security holes.
- Bugfix: Backlight status was being mis-applied when cycling screens.
- Bugfix: Language bindings were not being distributed.
1.9.2
- BugFix: Add exitfunc to net plugin for exit notification.
- BugFix: Use pause() instead of sleeping
- BugFix: create leaving var as volatile.
- BugFix: Add NAME section to g15daemon_client manpages
- Tweak delay between successive keyboard reads. This reduces cpu load by
50% on my system.
- Bugfix: Ensure that all plugin exit functions are called on leaving.
- Bugfix: if keypress event is received (very early in the startup process,
the daemon would crash. Check that expected pointers are valid.
- Bugfix: Dont attempt compilation of uinput plugin if headers are
unavailable.
- Bugfix: Write a blank buffer to the LCD before exiting.
- Feature: Add --lcdlevel cmdline option to allow setting default LCD brightness level
1.9.3:
- BugFix: The documentation for --switch was inverted. Fix.
- Debug: Print list of commandline args when in debug mode
- BugFix: The decreased delay caused keypresses to be misread on some
machines. REVERT.
1.9.4
- Debug: Log warning if keyboard disappears.
- Bugfix: Fix autoconf autodetect bugs re uinput plugin.
- Feature: If autodetection of uinput fails, configure now has a
--disable-uinput override.
- Feature: WIP should now compile and run on Linux, MacOSX, and Solaris (v10+).
Only Linux and Solaris have been tested.
- Debug: Add more debugging to plugin loader.
- Debug: Log build date,OS and GCC version.
- Feature: Plugin loader will now use DEEP_BIND if available, hopefully
resolving conflicts on OS's that support it.
- Feature: Solaris support. Requires some end-user changes to the usb
stack at the moment. Documentation coming soon.
- BugFix: Plugin loader is now much more robust.
- Feature: Add OS specific documentation for Linux and FreeBSD.
Compilation and use on FreeBSD is completely untested.
- Feature: Debug verbosity of g15daemon_log is now variable.
- Feature: Plugin filenames are now cached in g15daemon.conf to allow
(manual, at this stage) changing of load-order.
- Portability: Add our own daemon() function if platform doesn't have native
support.
- TidyUp: Wrap keyboard read function.
- TidyUp: Make all plugin-internal functions static.
- Portability: Remove mutexes on Solaris, as libusb (and therefore libg15)
blocks on read.
- Optimisation: Use pthread conditional variable to signal LCD state change.
Further reduces unnecessary wakeups.
1.9.5
- Add example udev helper scripts to contrib directory.
- API: Add NEVER_SELECT cmd to client API to enforce non-display on
client-switch. Used by G15Macro if available.
- Debug: Add segfault handler to libg15daemon_client to aid debugging
clients.
- Feature: Add screendump ability. Pressing M1+M3 simultaneously will write
a pbm format image of the currently displayed screen to
/tmp/g15daemon-sc-?.pbm, where ? is an incremental number.
- BugFix: Only wakeup display thread if LCD buffer is visible.
- Packaging: Fix debian packaging to include plugins.
1.9.5.1:
- BugFix: If lcd refresh is requested whilst processing, refreshes were missed.
- Optimisation: The delay between screen updates is no longer required. remove.
1.9.5.2:
- BugFix: IS_USER_SELECTED client command was broken. fix it.
- BugFix: restore client ability to change backlight state.
1.9.5.3:
- BugFix: plugins/g15daemon_net.c: ensure that OOB traffic is not mixed with
normal image buffers.
- Feature: Add --set-backlight to allow clients (and the backlight button)
to set the backlight level for the currently shown screen only. Default is
now to disallow clients changing backlight, and to set backlight globally
via the button.
+3 -2
View File
@@ -13,7 +13,8 @@ The current version of G15Daemon understands the following options:
\-v Show version info. \-v Show version info.
.P .P
.HP .HP
\-s By default, g15daemon uses the MR key to switch between client screens. Using this switch on the cmdline alters this, making L1 (the small, round, black button below the LCD) the button to achieve this function. \-s By default, g15daemon uses the L1 key to switch between client screens. Using this switch on the cmdline alters this, making
MR (Macro Record) the button to achieve this function.
.P .P
.HP .HP
\-k Stop a previously running copy of G15Daemon. For the keys and LCD to work, you'll have to restart the daemon manually. \-k Stop a previously running copy of G15Daemon. For the keys and LCD to work, you'll have to restart the daemon manually.
@@ -31,7 +32,7 @@ To run the daemon with default options, run:
or or
g15daemon \-s g15daemon \-s
to have the L1 key as the client screen switch. to have the MR key as the client screen switch.
If all required libraries are installed and in locations known to your operating system, the daemon will slip quietly into the background and a clock will appear on the LCD. If all required libraries are installed and in locations known to your operating system, the daemon will slip quietly into the background and a clock will appear on the LCD.
Congratulations! The linux kernel will now output keycodes for all your extra keys. Congratulations! The linux kernel will now output keycodes for all your extra keys.
+63 -8
View File
@@ -1,16 +1,20 @@
This file contains some frequently asked questions and answers This file contains some frequently asked questions and answers
regarding G15Daemon and it's installation. regarding G15Daemon and it's installation.
Q1. G15daemon complains that it cant find libg15.so.1 !! Q1. G15daemon complains that it can't find libg15.so.1 !!
Q1a. G15daemon complains that it can't find libg15render.so.1 !!
Answer: Answer:
By default, libg15 is installed in /usr/local/lib. Some distros Some of the g15 libraries are installed in /usr/local/lib.
don't look there for libraries by default. There are two ways Some distros don't look there for libraries by default. There
around this - 1. add /usr/local/lib to /etc/ld.so.conf (you'll are two ways around this -
need to be root to do this) and run ldconfig or 2. rerun the
libg15 configure script with --prefix=/usr, then make && make in- 1. add /usr/local/lib to /etc/ld.so.conf (you'll need to be root)
stall. This will install libg15 into the /usr/lib directory. and run ldconfig or
2.rerun the library configure script with --prefix=/usr,then make
&& make install. This will install libg15 into the /usr/lib
directory.
Q2. G15daemon complains about not receiving a return value Q2. G15daemon complains about not receiving a return value
@@ -33,3 +37,54 @@ you'll find an xmodmaprc script and a bash script in the contrib
directory. Copy the xmodmaprc file to $HOME/.Xmodmap and set the directory. Copy the xmodmaprc file to $HOME/.Xmodmap and set the
bash script to run every time X11 starts. KDE has an AutoStart bash script to run every time X11 starts. KDE has an AutoStart
folder you can put it in, Gnome probably has something similar. folder you can put it in, Gnome probably has something similar.
Q4. What devices are currently supported with G15Daemon?
Answer:
G15Daemon is designed to support whatever devices libg15 supports.
Currently,this means the G15 Keyboard(s), the G11 Keyboard and Z10
Speakers.
Q5. Are there any forums supporting the G15Tools?
Answer:
Yes. There are several. G15Tools now has it's own site, including
forums, at www.g15tools.com.There are also forums on the g15daemon
project site: http://sourceforge.net/projects/g15daemon, and a few
Linux distributions have threads setup for G15Tools users.
Q6. Why doesn't G15Daemon use DBUS or DCOP?
Answer:
DBUS is a nice thing, however it's very new and is not available
everywhere. We try to keep dependancies to the minimum, and using
DBUS would mean we have to ensure that G15Daemon is loaded after
the DBUS server, which is something we can't guarantee. Down the
track we will look at providing a DBUS G15Daemon proxy.
Q7. Is G15Daemon able to run on my operating system?
Answer:
G15Daemon currently has support for Linux, MacOSX and Solaris.
Some Linux distributions include the G15Tools in their package
managers, however those may not be up-to-date.
FreeBSD support is possible, see README.FreeBSD for details on
how you can try it out. FreeBSD support is completely untested,
however it may work. Please let us know if it works for you.
Q8. Will G15Daemon ever run on Windows?
Answer:
It might, but not by design. There is commercial support from
Logitech for that operating system.
+4 -3
View File
@@ -2,10 +2,11 @@ LLIBDIR=@LIBDIR@
SUBDIRS = libg15daemon_client g15daemon plugins SUBDIRS = libg15daemon_client g15daemon plugins
INCLUDES = -I$(top_srcdir)/libg15daemon_client -I$(top_srcdir)/g15daemon INCLUDES = -I$(top_srcdir)/libg15daemon_client -I$(top_srcdir)/g15daemon
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images README.Linux README.FreeBSD README.Solaris
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION) docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE README.Linux README.FreeBSD README.Solaris
man1_MANS = $(top_srcdir)/Documentation/g15daemon.1 man1_MANS = $(top_srcdir)/Documentation/g15daemon.1
man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3 man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3
@@ -23,7 +24,7 @@ dist-hook:
rm -rf `find $(distdir)/debian -name .svn` rm -rf `find $(distdir)/debian -name .svn`
rm -rf `find $(distdir)/contrib -name .svn` rm -rf `find $(distdir)/contrib -name .svn`
rm -rf `find $(distdir)/Documentation -name .svn` rm -rf `find $(distdir)/Documentation -name .svn`
rm -rf `find $(distdir)/lang_bindings -name .svn` rm -rf `find $(distdir)/lang-bindings -name .svn`
rm -rf `find $(distdir)/patches -name .svn` rm -rf `find $(distdir)/patches -name .svn`
rm -rf `find $(distdir)/rpm -name .svn` rm -rf `find $(distdir)/rpm -name .svn`
rm -rf `find $(distdir)/plugins -name .svn` rm -rf `find $(distdir)/plugins -name .svn`
+820
View File
@@ -0,0 +1,820 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
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/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
"$(DESTDIR)$(docdir)" "$(DESTDIR)$(imagedir)"
man3dir = $(mandir)/man3
NROFF = nroff
MANS = $(man1_MANS) $(man3_MANS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
docDATA_INSTALL = $(INSTALL_DATA)
imageDATA_INSTALL = $(INSTALL_DATA)
DATA = $(doc_DATA) $(image_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
LLIBDIR = @LIBDIR@
SUBDIRS = libg15daemon_client g15daemon plugins
INCLUDES = -I$(top_srcdir)/libg15daemon_client -I$(top_srcdir)/g15daemon
EXTRA_DIST = debian contrib Documentation lang-bindings patches rpm README.usage FAQ LICENSE images README.Linux README.FreeBSD README.Solaris
doc_DATA = FAQ README.usage README ChangeLog TODO AUTHORS NEWS LICENSE README.Linux README.FreeBSD README.Solaris
man1_MANS = $(top_srcdir)/Documentation/g15daemon.1
man3_MANS = $(top_srcdir)/Documentation/g15daemon_client_devel.3
imagedir = $(prefix)/share/g15daemon/splash
image_DATA = images/g15logo2.wbmp
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
install-man3: $(man3_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
3*) ;; \
*) ext='3' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
done
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
3*) ;; \
*) ext='3' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man3dir)/$$inst"; \
done
install-docDATA: $(doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
@list='$(doc_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
$(docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
done
uninstall-docDATA:
@$(NORMAL_UNINSTALL)
@list='$(doc_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
rm -f "$(DESTDIR)$(docdir)/$$f"; \
done
install-imageDATA: $(image_DATA)
@$(NORMAL_INSTALL)
test -z "$(imagedir)" || $(MKDIR_P) "$(DESTDIR)$(imagedir)"
@list='$(image_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(imageDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(imagedir)/$$f'"; \
$(imageDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(imagedir)/$$f"; \
done
uninstall-imageDATA:
@$(NORMAL_UNINSTALL)
@list='$(image_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(imagedir)/$$f'"; \
rm -f "$(DESTDIR)$(imagedir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
am__remove_distdir=: \
am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(MANS) $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(imagedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-docDATA install-imageDATA install-man
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-dvi: install-dvi-recursive
install-exec-am:
install-html: install-html-recursive
install-info: install-info-recursive
install-man: install-man1 install-man3
install-pdf: install-pdf-recursive
install-ps: install-ps-recursive
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-docDATA uninstall-imageDATA uninstall-man
uninstall-man: uninstall-man1 uninstall-man3
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-data-am install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
install-data-hook install-docDATA install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-imageDATA install-info install-info-am install-man \
install-man1 install-man3 install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-docDATA uninstall-imageDATA \
uninstall-man uninstall-man1 uninstall-man3
install-data-hook:
@KEXT_INSTALL_TRUE@ cp -Rf $(top_srcdir)/contrib/libusbshield.kext @KEXT_LOCATION@
@KEXT_INSTALL_TRUE@ chown -R root:wheel @KEXT_LOCATION@/libusbshield.kext
dist-hook:
rm -rf `find $(distdir)/debian -name .svn`
rm -rf `find $(distdir)/contrib -name .svn`
rm -rf `find $(distdir)/Documentation -name .svn`
rm -rf `find $(distdir)/lang-bindings -name .svn`
rm -rf `find $(distdir)/patches -name .svn`
rm -rf `find $(distdir)/rpm -name .svn`
rm -rf `find $(distdir)/plugins -name .svn`
rm -rf `find $(distdir)/images -name .svn`
dist-rpm: dist-bzip2
rpmbuild -ts $(distdir).tar.bz2
dist-archives:
$(MAKE) dist-bzip2
$(MAKE) dist-rpm
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+5 -4
View File
@@ -1,8 +1,8 @@
** README G15Daemon 1.2 ** ** README G15Daemon 1.2 **
$Revision: 214 $ $Revision: 357 $
$Date: 2006-12-25 03:38:09 +0100 (Mon, 25 Dec 2006) $ $Date: 2007-12-26 19:36:11 +1030 (Wed, 26 Dec 2007) $
$Author: aneurysm9 $ $Author: mlampard $
G15daemon takes control of the G15 keyboard, allowing the use of G15daemon takes control of the G15 keyboard, allowing the use of
@@ -45,7 +45,8 @@ LCD clients, and cannot be used for other purposes if the
LCD is being used. LCD is being used.
[EDIT] As of 30/10/06 svn, the client switch key can be altered [EDIT] As of 30/10/06 svn, the client switch key can be altered
from MR to L1 by specifying -s on the g15daemon commandline. from L1 to MR by specifying -s on the g15daemon commandline. This
is not recommended.
*** ***
+30
View File
@@ -0,0 +1,30 @@
$Revision: 377 $
$Date: 2008-01-01 21:56:13 +1030 (Tue, 01 Jan 2008) $
$Author: mlampard $
**** IMPORTANT NOTICE *******************************************************
*** Please Note: G15Daemon is completely untested on FreeBSD.
*** Please report success or failure, any additional steps taken
*** and Operating System version to mlampard@users.sf.net
******************************************************************************
In order for G15Daemon to be able to claim the usb device needed for the LCD and extra keys,
the following _kernel_ configuration changes may be necessary:
First test if ugen is already enabled:
- Plug in the keyboard or other supported USB device.
- dmesg |grep "ugen"
- you should see a line similar to "ugen0: Logitech G15 Keyboard"
If not already enabled:
For FreeBSD versions 5.4 and below, and version 6.0:
Disable uhid
Enable ugen
For FreeBSD versions 5.5, 6.1 and higher:
Enable ugen
Recompile the kernel and reboot.
NetBSD and OpenBSD are not supported at this time due to libusb deficiencies on those platforms.
+7
View File
@@ -0,0 +1,7 @@
$Revision: 377 $
$Date: 2008-01-01 21:56:13 +1030 (Tue, 01 Jan 2008) $
$Author: mlampard $
G15Daemon should compile and run just fine with no intervention.
Please read the README and manpages for further info.
+124
View File
@@ -0,0 +1,124 @@
*************************************************************************************************
Solaris 10+ support is here as of Jan-1-2008
G15 Daemon 1.9.4
LibG15Render-1.2
LibG15-1.2.5
Fully tested on Solaris 10 and and OpenSolaris 11 (Nevada) with G15 Version 1 and G15 Version 2.
The other keyboards should function but I have not tested them.
I will be trying to keep up with new versions and providing packages as needed.
All packages are in SV datastream format.
You can install them using 'pkgadd -d http://URL to package all'
*************************************************************************************************
G15 Daemon requires Solaris 10 and later with libusb installed.
SUNWlibusb Sun wrapper library for libusb
SUNWlibusbS libusb (source)
SUNWlibusbugen SUN libusb ugen plugin
SUNWlibusbugenS libusbugen plugin (source)
*************************************************************************************************
Compiling from source :
Note : Compiling code on Opensolaris 11 (Nevada) does not guarantee
the binaries will be functional on Solaris 10.
*************************************************************************************************
If installing from SVN you must have the following packages from http://sunfreeware.com
installed into /usr/local/bin :
autoconf-2.60-sol10-x86-local
automake-1.10-sol10-x86-local
libiconv-1.11-sol10-x86-local
make-3.81-sol10-x86-local
perl-5.8.8-sol10-x86-local
gcc-3.4.6-sol10-x86-local
libtool-1.5.24-sol10-x86-local
m4-1.4.7-sol10-x86-local
When compiling LibG15 from SVN you may need to set
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/sfw/lib:/opt/g15/lib
export LD_LIBRARY_PATH
If installing from a release source package you must fist compile and install
at least LibG15 1.2.5 and LibG15Render-1.2.
No other packages are required.
Successfully configure options are as follows :
./configure --prefix=/opt/g15 'LDFLAGS='-L/usr/sfw/lib -L/opt/g15/lib' \
'CPPFLAGS=-I/usr/sfw/include -I/opt/g15/include' && gmake && gmake install
*************************************************************************************************
* The following script can be used to configure the device support to Solaris and Opensolaris.
* G15Daemon runs as user nobody so we must provide read/write permissions for user nobody
* or you must run g15daemon with the option : --user root
*************************************************************************************************
#!/bin/ksh
exec 2>/dev/null
echo "Verifying the ugen driver"
add_drv -m '* 0666 root sys' -i 'ugen' ugen
echo "Adding driver support for Logitech G15 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c222"' ugen
echo "Adding driver support for Logitech G15 V2"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c227"' ugen
echo "Adding driver support for Logitech G11 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,c225"' ugen
echo "Adding driver support for Logitech Z-10 V1"
/usr/sbin/update_drv -a -m '* 0660 nobody sys' -i '"usb46d,0a07"' ugen
echo "Finished installing device support."
touch /reconfigure
echo "You must reboot to enable ugen in your device tree"
*************************************************************************************************
The following XML document can be used to integrate G15Daemon into SMF.
1. Save it to a file (Suggested location is /var/svc/manifest/site/g15daemon.xml)
2. verify using 'svccfg validate /path_to_file'
3. import using 'svccfg import /path_to_file'
4. enable using 'svcadm enable g15daemon'
*************************************************************************************************
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='SCIG15daemon:default'>
<service name='site/g15daemon' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />
<dependency name='localfs' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency name='loopback' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/network/loopback' />
</dependency>
<dependency name='device_files' grouping='require_any' restart_on='restart' type='path'>
<service_fmri value='file://localhost/dev/usb/46d.c222' />
<service_fmri value='file://localhost/dev/usb/46d.c225' />
<service_fmri value='file://localhost/dev/usb/46d.c227' />
<service_fmri value='file://localhost/dev/usb/46d.0a07' />
</dependency>
<exec_method type='method' name='start' exec='/opt/g15/sbin/g15daemon' timeout_seconds='60'/>
<exec_method type='method' name='stop' exec='/opt/g15/sbin/g15daemon -k' timeout_seconds='60' />
<stability value='Unstable' />
<template>
<common_name><loctext xml:lang='C'>G15daemon</loctext></common_name>
<documentation>
<manpage title='g15daemon' section='1' manpath='/opt/g15/share/man' />
<manpage title='g15daemon_client_devl' section='3' manpath='/opt/g15/share/man' />
</documentation>
</template>
</service>
</service_bundle>
*************************************************************************************************
Please read the README and manpages for further info.
*************************************************************************************************
+4 -3
View File
@@ -5,12 +5,11 @@ TODO list for G15daemon. Not in any particular order.
PARTIALLY DONE - Add manpage and other documentation for the client library and it's PARTIALLY DONE - Add manpage and other documentation for the client library and it's
bindings. bindings.
- Add client to record & playback macros (being worked on) DONE (G15Macro) - Add client to record & playback macros.
- add a few simple template client examples in various languages - add a few simple template client examples in various languages
- Read a configuration file. Currently there are no real user-configurable DONE - Read a configuration file.
options, but ....
DONE - Allow for clients to change LCD backlight. DONE - Allow for clients to change LCD backlight.
@@ -32,3 +31,5 @@ will allow the client app to exit without taking the screen with them.
use the 'screen' they previously created, as long as they return within the use the 'screen' they previously created, as long as they return within the
'time-to-live' period they set before exiting. This will allow for scripts 'time-to-live' period they set before exiting. This will allow for scripts
etc to periodically update. etc to periodically update.
- Add DBUS proxy.
-26
View File
@@ -1,26 +0,0 @@
This is the starting point of g15daemon 2.0. It's a work in progress,
partially functional (it already does most of the stuff the previous version
did), and incredibly untidy...
This is simply here to test and stabilise the API of what will become 2.0
FEATURES:
- True Plugins
- Synchronous Event-based architecture.
- Mostly backward-compatible with versions 1.0 & 1.2.* via the LCDServer plugin.
-
If you want to write a plugin, please see some examples in the plugin
folder. If the current plugin API doesn't do something you think it should,
let us know, it's never too late to change.
TODO:
- re-write most of it, currently it's simply the old code modified to suit
the new architecture, and the new stuff is not much better...
- tidy up the code
- write some updated documentation
- write some plugins!
- write some more documentation and plugins...
- add config options to a configuration file..
- add menu functionality to the clock for plugin/g15daemon configuration
- ???
Vendored
+7454
View File
File diff suppressed because it is too large. Load diff
-9
View File
@@ -1,9 +0,0 @@
#! /bin/sh
set -x
aclocal -I config
libtoolize --force --copy
autoheader
automake --add-missing --copy
autoconf
./configure $*
+163
View File
@@ -0,0 +1,163 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Date of compilation */
#undef BUILD_DATE
/* Build OS Particulars */
#undef BUILD_OS_NAME
/* Compiler Version */
#undef COMPILER_VERSION
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `backtrace' function. */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the `backtrace_symbols' function. */
#undef HAVE_BACKTRACE_SYMBOLS
/* Define if daemon() is available */
#undef HAVE_DAEMON
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `g15' library (-lg15). */
#undef HAVE_LIBG15
/* Define to 1 if you have the `g15render' library (-lg15render). */
#undef HAVE_LIBG15RENDER
/* Define to 1 if you have the <libg15.h> header file. */
#undef HAVE_LIBG15_H
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define to 1 if you have the <linux/input.h> header file. */
#undef HAVE_LINUX_INPUT_H
/* Define to 1 if you have the <linux/uinput.h> header file. */
#undef HAVE_LINUX_UINPUT_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if struct uinput_user_dev has id member. */
#undef HAVE_UINPUT_USER_DEV_ID
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if libusb implementation blocks on read or write */
#undef LIBUSB_BLOCKS
/* Target OS is Darwin */
#undef OSTYPE_DARWIN
/* Target OS is Linux */
#undef OSTYPE_LINUX
/* Target OS is unknown */
#undef OSTYPE_OTHER
/* Target OS is Solaris */
#undef OSTYPE_SOLARIS
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1
/* Define to the type of args 2, 3 and 4 for `select'. */
#undef SELECT_TYPE_ARG234
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
Vendored Executable
+1516
View File
File diff suppressed because it is too large. Load diff
Vendored Executable
+1626
View File
File diff suppressed because it is too large. Load diff
Executable
+584
View File
@@ -0,0 +1,584 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2006-10-15.18
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, 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.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
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.
## 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
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# 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"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -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"
exit $stat
fi
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"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
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'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
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
# With Tru64 cc, shared objects can also be used to make a
# 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 $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
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
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
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# 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:
+507
View File
@@ -0,0 +1,507 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
# 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.
#
# 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.
#
#
# 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.
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-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment 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}"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-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.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; 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 "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
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
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
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 "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# 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: $dstarg: 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
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
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"; } &&
# Now 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.
{
if test -f "$dst"; then
$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
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
trap '' 0
fi
done
# 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:
+6941
View File
File diff suppressed because it is too large. Load diff
Executable
+367
View File
@@ -0,0 +1,367 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# 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.
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, 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.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
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.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
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
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
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
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
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
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
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 test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
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
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
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 "$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`
# ... 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
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
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:
Vendored Executable
+23392
View File
File diff suppressed because it is too large. Load diff
+99 -46
View File
@@ -1,21 +1,23 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# $Revision: 295 $ - $Date: 2007-09-09 06:37:50 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $ # $Revision: 458 $ - $Date: 2008-01-31 15:48:40 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT(g15daemon, [1.9pre], [mlampard@users.sf.net]) AC_INIT(g15daemon, [1.9.5.3], [mlampard@users.sf.net])
AC_PREFIX_DEFAULT(/usr) AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST()
AC_CANONICAL_TARGET() AC_CANONICAL_TARGET()
AM_INIT_AUTOMAKE() AM_INIT_AUTOMAKE()
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
AC_LIBTOOL_DLOPEN
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_PROG_RANLIB
# Checks for libraries. # Checks for libraries.
AC_CHECK_LIB([g15], [initLibG15],,AC_MSG_ERROR(["libg15 (or its devel package) not found. please install it"])) AC_CHECK_LIB([g15], [initLibG15],,AC_MSG_ERROR(["libg15 (or its devel package) not found. please install it"]))
@@ -23,48 +25,7 @@ AC_CHECK_LIB([g15render], [g15r_loadWbmpSplash],,AC_MSG_ERROR([">=libg15render-1
AC_CHECK_LIB([m], [sin]) AC_CHECK_LIB([m], [sin])
AC_CHECK_LIB([pthread], [pthread_mutex_init]) AC_CHECK_LIB([pthread], [pthread_mutex_init])
# Checks for header files. AC_CHECK_FUNC(daemon,AC_DEFINE(HAVE_DAEMON,1,[Define if daemon() is available]),[])
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ linux/input.h ])
AC_CHECK_HEADERS([ linux/uinput.h arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h libg15.h], [], [],
[#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif
])
#if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id],
[AC_DEFINE(HAVE_UINPUT_USER_DEV_ID, 1,
[Define if struct uinput_user_dev has id member.])],,
[
#include <linux/input.h>
#include <linux/uinput.h>
]
)
dnl end of uinput version checks
#endif
case $host_os in
*linux*)
AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux])
;;
*darwin*)
AC_DEFINE([OSTYPE_DARWIN], [1],[Target OS is Darwin])
AC_SUBST(KEXT_LOCATION,["/System/Library/Extensions/"])
install_kext=true
;;
*)
AC_DEFINE([OSTYPE_OTHER], [1],[Target OS is unknown])
;;
esac
AM_CONDITIONAL([KEXT_INSTALL], [test x$install_kext = xtrue])
CPPFLAGS=$CPPFLAGS_save
CPPFLAGS="$CPPFLAGS "'-DDATADIR="\"$(datadir)\""'
AC_SUBST(G15DAEMON_PLUGIN_DIR,["$libdir/g15daemon/$PACKAGE_VERSION/plugins"])
CPPFLAGS="$CPPFLAGS "'-DPLUGINDIR=\"$(G15DAEMON_PLUGIN_DIR)\"'
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
@@ -75,7 +36,99 @@ AC_TYPE_SIZE_T
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME AC_FUNC_STRFTIME
AC_CHECK_FUNCS([memset select socket strerror]) AC_CHECK_FUNCS([memset select socket strerror backtrace backtrace_symbols])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ linux/input.h ])
AC_CHECK_HEADERS([ execinfo.h ])
AC_CHECK_HEADERS([ linux/uinput.h ], [have_linux_uinput_h=yes],[have_linux_uinput_h=],[])
AC_CHECK_HEADERS([ arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h libg15.h],,,
[#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif
],,[])
AC_ARG_ENABLE([--disable-uinput],[ --disable-uinput do not build linux uinput plugin (default: autodetect)])
if test "x$enable_uinput" != "xno"; then
if test "x$have_linux_uinput_h" == "xyes"; then
#if HAVE_LINUX_UINPUT_H
dnl check for uinput.h version 2.4 or 2.6 ?
AC_CHECK_MEMBER([struct uinput_user_dev.id],
[AC_DEFINE(HAVE_UINPUT_USER_DEV_ID, 1,
[Define if struct uinput_user_dev has id member.])],,
[
#include <linux/input.h>
#include <linux/uinput.h>
]
)
uinput=true
dnl end of uinput version checks
AC_MSG_NOTICE([Necessary includes exist: Compiling Uinput Plugin])
#endif
else
AC_MSG_NOTICE([Linux Specific Includes Not Found. NOT COMPILING UINPUT PLUGIN.])
fi
else
AC_MSG_NOTICE([Linux UINPUT plugin disabled by request.])
uinput=false
fi
case $host_os in
*linux*)
AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux])
AC_MSG_NOTICE([OS is Linux, using uinput if available])
;;
*darwin*)
AC_DEFINE([OSTYPE_DARWIN], [1],[Target OS is Darwin])
AC_SUBST(KEXT_LOCATION,["/System/Library/Extensions/"])
AC_MSG_NOTICE([OS is Darwin, using OS specific workarounds])
install_kext=true
uinput=false
;;
*solaris*)
AC_DEFINE([OSTYPE_SOLARIS], [1],[Target OS is Solaris])
AC_SEARCH_LIBS([connect],socket,[],[],[])
AC_SEARCH_LIBS([gethostent],nsl,[],[],[])
AC_SEARCH_LIBS([inet_aton],resolv,[],[],[])
AC_SEARCH_LIBS([nanosleep],rt,[],[],[])
AC_MSG_NOTICE([OS is Solaris, using OS specific workarounds])
uinput=false
libusb_blocks=true
;;
*)
AC_DEFINE([OSTYPE_OTHER], [1],[Target OS is unknown])
AC_MSG_NOTICE([Unknown OS type, your milage may vary....])
uinput=false
;;
esac
AM_CONDITIONAL([KEXT_INSTALL], [test x$install_kext = xtrue])
AM_CONDITIONAL(UINPUT_INTERFACE_PLUGIN, [test x$uinput = xtrue])
dnl Some versions of libusb do not honour timeout and block. Suns' version is one of them.
if test "x$libusb_blocks" == "xtrue"; then
AC_DEFINE([LIBUSB_BLOCKS], [1],[Define if libusb implementation blocks on read or write])
fi
G15D_BUILD_CC="`$CC -v 2>&1 | tail -n 1`"
G15D_BUILD_OS="`uname -s -r -m`"
G15D_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
AC_DEFINE_UNQUOTED([BUILD_OS_NAME],"${G15D_BUILD_OS}",[Build OS Particulars])
AC_DEFINE_UNQUOTED([BUILD_DATE],"${G15D_BUILD_DATE}",[Date of compilation])
AC_DEFINE_UNQUOTED([COMPILER_VERSION],"${G15D_BUILD_CC}",[Compiler Version])
CPPFLAGS=$CPPFLAGS_save
CPPFLAGS="$CPPFLAGS "'-DDATADIR="\"$(datadir)\""'
AC_SUBST(G15DAEMON_PLUGIN_DIR,["$libdir/g15daemon/$PACKAGE_VERSION/plugins"])
CPPFLAGS="$CPPFLAGS "'-DPLUGINDIR=\"$(G15DAEMON_PLUGIN_DIR)\"'
CPPFLAGS="$CPPFLAGS "'-I$(includedir)'
AC_CONFIG_FILES([Makefile g15daemon/Makefile libg15daemon_client/Makefile plugins/Makefile]) AC_CONFIG_FILES([Makefile g15daemon/Makefile libg15daemon_client/Makefile plugins/Makefile])
+6
View File
@@ -0,0 +1,6 @@
# G15daemon udev rule to autostart g15daemon on connect
# belongs in udev rules directory such as /etc/udev/rules.d/
# and the script g15daemon-hotplug should be in /usr/bin and made
# executable with chmod +x /usr/bin/g15daemon-hotplug
SYSFS{../name}=="Logitech Logitech Gaming Keyboard", RUN+="/usr/bin/g15daemon-hotplug"
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# G15Daemon udev script to start/stop the daemon
# when device is connected.
# requires a udev script in the udev rules directory
# see 99-g15daemon.rules as an example.
case $ACTION in
"add")
# start g15daemon on keyboard connect
sudo g15daemon
;;
"remove")
# kill g15daemon on keyboard disconnect
sudo g15daemon -k
;;
*)
exit 0
;;
esac
+8
View File
@@ -0,0 +1,8 @@
g15daemon (1.9.5.3-3) unstable; urgency=low
* The default key to switch application is changes:
now we use L1 (round small key near the display, instead of MR key.
This will allow other application to use MR (i.e. g15macro).
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Apr 2008 08:36:27 +0200
+1 -1
View File
@@ -4,7 +4,7 @@ g15daemon for Debian
Debian 'xkeyboard-config' package already have support for g15 Debian 'xkeyboard-config' package already have support for g15
keyboards, so you don't need to exec 'xmodmap' as described on keyboards, so you don't need to exec 'xmodmap' as described on
original documentations. Anywaym you should configure your original documentations. Anyway you should configure your
xorg.conf file, so that xorg will understand the extra keys. xorg.conf file, so that xorg will understand the extra keys.
To have the full support of the extra keys, you should edit the To have the full support of the extra keys, you should edit the
+166
View File
@@ -1,3 +1,169 @@
g15daemon (1.9.5.3-11) unstable; urgency=medium
* Reinitialize on eny error code, not only on a negative one.
* Remove unused variables. (Closes: bug#688465)
* Compliant to policy 4.4.1
-- Alexander Ponyatykh <lazyranma@gmail.com> Tue, 19 Nov 2019 00:50:44 +0300
g15daemon (1.9.5.3-10) unstable; urgency=medium
* Rebuild (no source changes).
-- Andrej Shadura <andrewsh@debian.org> Sat, 16 Nov 2019 19:25:13 +0100
g15daemon (1.9.5.3-9) unstable; urgency=medium
[ Alexander Ponyatykh ]
* Reintroduce package. (Closes: bug#928158)
* Convert source to 3.0 (quilt) format.
* Migrate from cdbs to debhelper.
* Merge from Ubuntu:
- libg15daemon_client/g15daemon_net.c: Fix a potential buffer overflow.
* debian/patches/07-reinit-on-any-error.diff: reinitialize on any error
returned by libusb to correctly recover after suspend/resume. (LP: #1357556)
* /etc/init.d/g15daemon: overhaul.
- Replace /dev/input/uinput with /dev/uinput. (Closes: bug#687663).
- Use "udevadm settle" instead of polling /dev/uinput.
- Use log_*_msg functions instead of echo.
- Add dependency on $remote_fs.
- Remove bashism. (Closes: bug#772244)
- Return 0 exit code if the daemon fails to start.
(LP: #617101, LP: #1103275)
- Don't stop or restart on udev events, because g15daemon now properly
handles replugging.
* Remove build dependency on libusb.
* Remove dependency on libg15daemon-client1 for g15daemon.
* Add dependency on udev for g15daemon.
* Change priority of packages to optional.
* Add native systemd service. (LP: #1441365)
* /etc/default/g15daemon: remove SWITCH_KEY option to keep systemd service
file simple.
* Add subsystem check to udev matching rules.
* Multiarchify the library packages. (Closes: bug#812952)
* Do not install *.la files.
* Change package description. (Closes: bug#802652)
[ Andrej Shadura ]
* Wrap and sort.
* Use debhelper-compat instead of debian/compat.
* d/changelog: Remove trailing whitespaces.
* d/control: Add Vcs-* field.
* d/watch: Use https protocol.
-- Andrej Shadura <andrewsh@debian.org> Sat, 19 Oct 2019 21:15:39 +0200
g15daemon (1.9.5.3-8.3) unstable; urgency=medium
* Non-maintainer upload.
* debian/control: Drop unnecessary automake1.9 build deps. (Closes:
#724371)
-- Eric Dorland <eric@debian.org> Tue, 04 Mar 2014 23:50:12 -0500
g15daemon (1.9.5.3-8.2) unstable; urgency=low
* Non-maintainer upload.
* Use ATTR instead of SYSFS in udev rules (closes: #573434).
* Remove references to other libraries from dependency_libs field
(closes: #629592).
-- Luk Claes <luk@debian.org> Tue, 31 May 2011 07:33:52 +0200
g15daemon (1.9.5.3-8.1) unstable; urgency=low
* Non-maintainer upload.
* Send a sync event after key up/down (closes: #567213).
-- Julien Cristau <jcristau@debian.org> Sun, 25 Jul 2010 11:39:22 +0200
g15daemon (1.9.5.3-8) unstable; urgency=low
* Put the third argument (modes) on open with O_CREAT (Closes: #559649)
* remove rpath
-- Giacomo Catenazzi <cate@debian.org> Fri, 18 Dec 2009 07:52:26 +0100
g15daemon (1.9.5.3-7) unstable; urgency=low
* Change priority of libg15daemon-client1 from extra to optional
(mumble package needs it)
-- Giacomo Catenazzi <cate@debian.org> Tue, 01 Sep 2009 19:50:38 +0200
g15daemon (1.9.5.3-6) unstable; urgency=low
* Shared devices (lcd dispaly + audio) are not good handled
by udev script. Adding workaround until improving
programs to handle disconnections (Closes: #541780)
* Add debugging flag (and code) for init.d and udev scripts
* Change syslog facility: from user to daemon
* better (and more secure) screenshort creation in /tmp
-- Giacomo Catenazzi <cate@debian.org> Wed, 19 Aug 2009 07:33:22 +0200
g15daemon (1.9.5.3-5) unstable; urgency=low
* Handle keyboard device with udev, so detecting detachement
and attachment of keyboarda (Closes: #489978).
* init.d LSB header: try to start before xorg, to be able
to have full access to all extra keys.
* Recent libg15 corrected strange behaviour in new G15 keyboard
(Closes: #494180)
-- Giacomo Catenazzi <cate@debian.org> Thu, 13 Aug 2009 08:20:02 +0200
g15daemon (1.9.5.3-4) unstable; urgency=low
* Try to load uinput module, in order to have Gx key working
(Closes: #475000).
* Usual updates
-- Giacomo Catenazzi <cate@debian.org> Thu, 06 Aug 2009 08:32:33 +0200
g15daemon (1.9.5.3-3) unstable; urgency=low
* Changing default in /etc/default/g15daemon: Use L1 key instead of MR
as actual upstream default and allowing to use g15macro
(Closes: #478069)
* Removed the X11 setup on man page, because it is not relevant
to recent distributions and could confuse our users (Closes: #463078)
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Apr 2008 08:47:07 +0200
g15daemon (1.9.5.3-2) unstable; urgency=low
* Recommend xkb-data instead of keyboard-config. Adapted patch from
Amaya, thanks! (Closes: #474451).
-- Giacomo Catenazzi <cate@debian.org> Mon, 07 Apr 2008 19:56:34 +0200
g15daemon (1.9.5.3-1) unstable; urgency=low
* New upstream version
-- Giacomo Catenazzi <cate@debian.org> Thu, 14 Feb 2008 08:08:03 +0100
g15daemon (1.9.5.2-2) unstable; urgency=low
* Handle better errors in the init.d script (Closes: #463073)
-- Giacomo Catenazzi <cate@debian.org> Tue, 29 Jan 2008 20:15:35 +0100
g15daemon (1.9.5.2-1) unstable; urgency=low
* New upstream version
* Change default behaviour: to switch client use MR (as already documented
in /etc/default/g15daemon, but wrongly implemented)
-- Giacomo Catenazzi <cate@debian.org> Mon, 28 Jan 2008 09:12:16 +0100
g15daemon (1.9.1.0.svn346-1) unstable; urgency=low
* New upstream version (from svn)
-- Giacomo Catenazzi <cate@debian.org> Tue, 18 Dec 2007 09:15:42 +0100
g15daemon (1.9.0-wip.20070910-5) unstable; urgency=low g15daemon (1.9.0-wip.20070910-5) unstable; urgency=low
* change priority to "extra" * change priority to "extra"
-1
View File
@@ -1 +0,0 @@
5
+50 -22
View File
@@ -1,34 +1,62 @@
Source: g15daemon Source: g15daemon
Section: utils Section: utils
Priority: extra Priority: optional
Maintainer: Giacomo Catenazzi <cate@debian.org> Maintainer: Alexander Ponyatykh <lazyranma@gmail.com>
Build-Depends: cdbs, debhelper (>= 5), autotools-dev, automake1.9, libtool, Uploaders:
libg15-dev, libg15render-dev (>=1.2.0.svn250-2), libusb-dev, libfreetype6-dev Andrej Shadura <andrewsh@debian.org>
Standards-Version: 3.7.2 Build-Depends:
debhelper-compat (= 12),
libfreetype6-dev,
libg15-dev (>= 1.2.7-3),
libg15render-dev (>= 1.2.0.svn250-2),
libtool
Standards-Version: 4.4.1
Homepage: https://sourceforge.net/projects/g15daemon/
Vcs-Browser: https://salsa.debian.org/debian/g15daemon
Vcs-Git: https://salsa.debian.org/debian/g15daemon.git
Package: g15daemon Package: g15daemon
Section: utils Section: utils
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, libg15daemon-client1 (=${binary:Version}) Pre-Depends:
Recommends: xkeyboard-config ( >= 0.9+cvs.20070428-1) ${misc:Pre-Depends}
Description: Screen multiplexer for Logitech G15 Keyboard Depends:
libg15-1 (>= 1.2.7-3),
lsb-base (>= 4.1+Debian3),
udev,
${misc:Depends},
${shlibs:Depends}
Recommends:
xkb-data (>=0.9+cvs.20070428-1)
Description: LCD multiplexer for Logitech G15 Keyboard
G15daemon provides multiple virtual screens for the LCD on the Logitech G15daemon provides multiple virtual screens for the LCD on the Logitech
G11 and G15 keyboards. G15 keyboard and Z10 speakers. It also allows the use of all additional
. keys of G11 and G15 keyboards, even if the kernel does not support them.
This package contain the daemon and a generic client to talk to the
daemon.
Package: libg15daemon-client1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Description: Development packages for libg15daemon-client
Includes the files needed for developing g15daemon clients
Package: libg15daemon-client-dev Package: libg15daemon-client-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: libg15daemon-client1 (= ${binary:Version}) Multi-Arch: same
Description: Development packages for libg15daemon-client Depends:
Includes the files needed for developing g15daemon clients libg15daemon-client1 (= ${binary:Version}),
${misc:Depends}
Description: Development files for libg15daemon-client
The g15daemon client library allows applications to use LCD of the Logitech G15
keyboard or Z10 speakers under control of g15daemon.
.
This package provides the development files and static libraries.
Package: libg15daemon-client1
Section: libs
Architecture: any
Multi-Arch: same
Pre-Depends:
${misc:Pre-Depends}
Depends:
${misc:Depends},
${shlibs:Depends}
Description: Client library for communicating with g15daemon
The g15daemon client library allows applications to use LCD of the Logitech G15
keyboard or Z10 speakers under control of g15daemon.
.
This package provides the runtime files.
+3 -3
View File
@@ -23,6 +23,6 @@ License:
License can be found in the file `/usr/share/common-licenses/GPL-2'. License can be found in the file `/usr/share/common-licenses/GPL-2'.
The Debian packaging is (C) 2007, Giacomo Catenazzi <cate@debian.org> and The Debian packaging is (C) 2007, Giacomo Catenazzi <cate@debian.org>,
is licensed under the GPL v2 (or later), see `/usr/share/common-licenses/GPL-2'. (C) 2019 Alexander Ponyatykh <lazyranma@gmail.com> and is licensed under
the GPL v2 (or later), see `/usr/share/common-licenses/GPL-2'.
Vendored
-2
View File
@@ -1,2 +0,0 @@
usr/bin
usr/sbin
+3 -6
View File
@@ -1,12 +1,9 @@
# Defaults for g15daemon initscript # Defaults for g15daemon initscript
# SWITCH_KEY selects the key used to switch between client screens # SWITCH_KEY option was removed. Use DAEMON_OPTS="-s" instead.
#
# SWITCH_KEY="MR" to use the MR key (on top left) (default)
# SWITCH_KEY="L1 to use the L1 key: the small round key below the LCD
# Turn on debugging of g15 init.d and udev scripts
SWITCH_KEY="MR" #G15DEBUG="on"
# Additional options that are passed to the Daemon. # Additional options that are passed to the Daemon.
DAEMON_OPTS="" DAEMON_OPTS=""
View File
File renamed without changes.
+82 -46
View File
@@ -2,10 +2,11 @@
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: g15daemon # Provides: g15daemon
# Required-Start: $local_fs # Required-Start: $syslog $local_fs $remote_fs
# Required-Stop: $local_fs # Required-Stop: $syslog $local_fs $remote_fs
# Should-Start: $remote_fs # Should-Start: $remote_fs
# Should-Stop: $remote_fs # Should-Stop: $remote_fs
# X-Start-Before: xdm kdm gdm ldm sdm
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: load deamon for Logitech G15 keyboard lcd display # Short-Description: load deamon for Logitech G15 keyboard lcd display
@@ -16,72 +17,107 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/g15daemon DAEMON=/usr/sbin/g15daemon
NAME=g15daemon NAME=g15daemon
DESC=g15daemon DESC="Logitech G15 keyboard LCD multiplexer"
test -x $DAEMON || exit 0 [ -x "$DAEMON" ] || exit 0
. /lib/lsb/init-functions
# Include g15daemon defaults if available # Include g15daemon defaults if available
if [ -f /etc/default/g15daemon ] ; then if [ -f /etc/default/g15daemon ] ; then
. /etc/default/g15daemon . /etc/default/g15daemon
fi fi
if [ "$SWITCH_KEY" = "L1" ]; then if [ "$G15DEBUG" = "on" ]; then
DAEMON_OPTS="-s $DAEMON_OPTS"
log() {
logger -p daemon.debug -t g15 -- "$*"
}
else
log() {
true
}
fi fi
set -e check_new_init() {
if [ -d /run/systemd/system ] ; then
exit $1
fi
}
load_uinput() {
if [ ! -e /dev/uinput ] ; then
modprobe -q uinput
udevadm settle -t 5 -E /dev/uinput
[ -e /dev/uinput 3 ] || return 1
fi
}
is_running() {
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
}
do_start() {
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
}
do_stop() {
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--oknodo --retry 5 --exec $DAEMON
}
case "$1" in case "$1" in
start) start)
echo -n "Starting $DESC: " log_daemon_msg "Starting $DESC" $NAME
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ load_uinput || log_warning_msg "/dev/uinput not found"
--exec $DAEMON -- $DAEMON_OPTS do_start
echo "$NAME." log_end_msg $?
;; ;;
stop) stop)
echo -n "Stopping $DESC: " log_daemon_msg "Stopping $DESC" $NAME
$DAEMON -k if do_stop ; then
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ log_end_msg 0
--exec $DAEMON else
echo "$NAME." log_end_msg 1
exit 1
fi
;; ;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
force-reload) force-reload)
# is_running && $0 restart || exit 0
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart" except that it does nothing if the
# daemon isn't already running.
# check wether $DAEMON is running. If so, restart
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON \
&& $0 restart \
|| exit 0
;; ;;
restart) restart)
echo -n "Restarting $DESC: " log_daemon_msg "Restarting $DESC" $NAME
start-stop-daemon --stop --quiet --pidfile \ if ! do_stop ; then
/var/run/$NAME.pid --exec $DAEMON log_end_msg 1
exit 1
fi
# the device is slow to shut-down
sleep 1 sleep 1
start-stop-daemon --start --quiet --pidfile \ load_uinput || log_warning_msg "/dev/uinput not found"
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS do_start
echo "$NAME." log_end_msg $?
;;
status)
is_running
exit $?
;;
udev)
check_new_init 0
log "calling g15 udev; action: $ACTION, product $PRODUCT"
if [ "x$ACTION" = "xadd" ] ; then
# If g15daemon is running, it will handle replugging.
is_running && exit 0
load_uinput
do_start
fi
;; ;;
*) *)
N=/etc/init.d/$NAME N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 log_action_msg "Usage: $N {start|stop|restart|force-reload|status}"
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1 exit 1
;; ;;
esac esac
+3 -6
View File
@@ -1,6 +1,3 @@
debian/tmp/usr/sbin/g15daemon usr/sbin debian/tmp/usr/lib/*/g15daemon/*/plugins/*.so
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_uinput.so usr/lib/g15daemon/1.9pre/plugins/ debian/tmp/usr/sbin/g15daemon
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_tcpserver.so usr/lib/g15daemon/1.9pre/plugins/ debian/tmp/usr/share/g15daemon/splash/g15logo2.wbmp
debian/tmp/usr/lib/g15daemon/1.9pre/plugins/g15plugin_clock.so usr/lib/g15daemon/1.9pre/plugins/
debian/tmp/usr/share/g15daemon/splash/g15logo2.wbmp usr/share/g15daemon/splash/
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=Logitech G15 keyboard LCD multiplexer
Documentation=man:g15daemon(1)
Wants=remote-fs.target
After=remote-fs.target
[Service]
Type=forking
EnvironmentFile=-/etc/default/g15daemon
ExecStartPre=-/sbin/modprobe -q uinput
ExecStartPre=-/sbin/udevadm settle -t 5 -E /dev/uinput
ExecStart=/usr/sbin/g15daemon $DAEMON_OPTS
+19
View File
@@ -0,0 +1,19 @@
# udev rule to start g15daemon when logitech g15 keyboards are attached
#
# Recognized devices from libg15-1.2.7/libg15.c
#
# Logitech g11 -- extra keys, no LCD
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c225", RUN+="/etc/init.d/g15daemon udev", TAG+="systemd",ENV{SYSTEMD_WANTS}+="g15daemon.service"
# Logitech G15 (blue) -- extra keys and LCD
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c222", RUN+="/etc/init.d/g15daemon udev", TAG+="systemd", ENV{SYSTEMD_WANTS}+="g15daemon.service"
# Logitech G15 v2 (orange) -- extra keys and LCD
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c227", RUN+="/etc/init.d/g15daemon udev", TAG+="systemd", ENV{SYSTEMD_WANTS}+="g15daemon.service"
# Logitech Z10 -- extra keys and LCD
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="0a07", RUN+="/etc/init.d/g15daemon udev", TAG+="systemd", ENV{SYSTEMD_WANTS}+="g15daemon.service"
# Logitech G15 Gamepanel -- extra keys and LCD
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c251", RUN+="/etc/init.d/g15daemon udev", TAG+="systemd", ENV{SYSTEMD_WANTS}+="g15daemon.service"
+3 -5
View File
@@ -1,5 +1,3 @@
debian/tmp/usr/include/* usr/include/ debian/tmp/usr/include/*
debian/tmp/usr/lib/lib*.a usr/lib/ debian/tmp/usr/lib/*/lib*.a
debian/tmp/usr/lib/lib*.so usr/lib/ debian/tmp/usr/lib/*/lib*.so
debian/tmp/usr/lib/*.la usr/lib/
+1 -1
View File
@@ -1 +1 @@
usr/lib/lib*.so.* usr/lib/*/lib*.so.*
+1 -1
View File
@@ -1 +1 @@
debian/tmp/usr/lib/lib*.so.* usr/lib/ debian/tmp/usr/lib/*/lib*.so.*
+127
View File
@@ -0,0 +1,127 @@
--- a/Documentation/g15daemon.1
+++ b/Documentation/g15daemon.1
@@ -37,113 +37,6 @@
If all required libraries are installed and in locations known to your operating system, the daemon will slip quietly into the background and a clock will appear on the LCD.
Congratulations! The linux kernel will now output keycodes for all your extra keys.
-.SH "Using the keys in X11"
-Current versions of the Xorg Xserver dont have support for the extra keys that g15daemon provides. This support will be available in the next release of Xorg (7.2).
-
-For now, if you want access to the extra keys for hotkey support in X11, you need to run the xmodmaprc script on each start of X. This script is available in the contrib folder (if g15daemon is installed in the default location, the contrib folder is in /usr/share/doc/g15daemon\-${VERSION}/contrib
-
-Depending on your linux distribution, copying the xmodmaprc file (or pasting the text below) into ~/.Xmodmap may be all that's required.
-
-.SH "Xmodmaprc file"
-Copy the following into ~/.Xmodmap (depending on your distribution) for X11 to recognise all extra G15 keys:
-
-\-\- cut here \-\-
-.br
-keycode 93 = XF86Launch1
-.br
-keycode 129 = XF86Launch8
-.br
-keycode 130 = XF86Launch9
-.br
-keycode 131 = XF86Launch2
-.br
-keycode 132 = XF86Phone
-.br
-keycode 133 = XF86Messenger
-.br
-keycode 136 = XF86LaunchD
-.br
-keycode 137 = XF86Support
-.br
-keycode 138 = XF86Word
-.br
-keycode 143 = XF86LaunchF
-.br
-keycode 144 = XF86AudioPrev
-.br
-keycode 150 = XF86LogOff
-.br
-keycode 152 = XF86Launch5
-.br
-keycode 153 = XF86AudioNext
-.br
-keycode 160 = XF86AudioMute
-.br
-keycode 161 = XF86Travel
-.br
-keycode 162 = XF86AudioPlay
-.br
-keycode 163 = XF86Spell
-.br
-keycode 164 = XF86AudioStop
-.br
-keycode 170 = XF86VendorHome
-.br
-keycode 174 = XF86AudioLowerVolume
-.br
-keycode 176 = XF86AudioRaiseVolume
-.br
-keycode 177 = XF86Launch4
-.br
-keycode 178 = XF86HomePage
-.br
-keycode 182 = XF86Away
-.br
-keycode 183 = XF86WebCam
-.br
-keycode 184 = XF86Launch0
-.br
-keycode 188 = XF86Music
-.br
-keycode 190 = XF86Launch6
-.br
-keycode 194 = XF86Forward
-.br
-keycode 195 = XF86Send
-.br
-keycode 205 = XF86Calendar
-.br
-keycode 208 = XF86Launch7
-.br
-keycode 209 = XF86LaunchB
-.br
-keycode 210 = XF86LaunchC
-.br
-keycode 215 = XF86Save
-.br
-keycode 219 = XF86WWW
-.br
-keycode 220 = XF86LaunchE
-.br
-keycode 223 = XF86Sleep
-.br
-keycode 228 = XF86Pictures
-.br
-keycode 231 = XF86LaunchA
-.br
-keycode 236 = XF86Mail
-.br
-keycode 237 = XF86AudioMedia
-.br
-keycode 246 = XF86iTouch
-.br
-keycode 247 = XF86Launch3
-.br
-keycode 249 = XF86ToDoList
-.br
-keycode 251 = XF86Calculater
-.br
-\-\- end cutting \-\-
.SH "AUTHORS"
The latest release of g15daemon is available at
.P
--- a/Documentation/g15daemon_client_devel.3
+++ b/Documentation/g15daemon_client_devel.3
@@ -55,7 +55,7 @@
int retval = 0;
int screen_fd = new_g15_screen( G15_WBMPBUF );
-... do processing and display here ...
+ ... do processing and display here ...
retval = g15_close_screen( screen_fd );
+39
View File
@@ -0,0 +1,39 @@
--- a/g15daemon/utility_funcs.c
+++ b/g15daemon/utility_funcs.c
@@ -666,12 +666,24 @@
}
int uf_screendump_pbm(unsigned char *buffer,char *filename) {
+ int fd;
FILE *f;
int x,y;
#define WIDTH 40
g15canvas *canvas=g15daemon_xmalloc(sizeof(g15canvas));
memcpy(canvas->buffer,buffer,LCD_BUFSIZE);
- f = fopen(filename,"w+");
+ fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if(fd == -1) {
+ g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: open, %s.\n", strerror(errno));
+ return -1;
+ }
+ f = fdopen(fd,"w");
+ if(f==NULL) {
+ close(fd);
+ g15daemon_log(LOG_WARNING, "uf_screendump_pbm failed: fdopen, %s.\n", strerror(errno));
+ return -1;
+ }
+
fprintf(f,"P1\n160 43\n");
fprintf(f,"# G15 screendump - %s\n\n",filename);
for(y=0;y<43;y++)
@@ -681,7 +693,9 @@
fprintf(f,"\n");
}
- fclose(f);
+ fclose(f);
+ fsync(fd);
+ close(fd);
free(canvas);
return 0;
}
+11
View File
@@ -0,0 +1,11 @@
--- a/g15daemon/main.c
+++ b/g15daemon/main.c
@@ -456,7 +456,7 @@
struct passwd *nobody;
unsigned char location[1024];
- openlog("g15daemon", LOG_PID, LOG_USER);
+ openlog("g15daemon", LOG_PID, LOG_DAEMON);
if(strlen((char*)user)==0){
nobody = getpwnam("nobody");
}else {
+11
View File
@@ -0,0 +1,11 @@
--- a/g15daemon/utility_funcs.c
+++ b/g15daemon/utility_funcs.c
@@ -356,7 +356,7 @@
config_items_t * item=NULL;
char line[1024];
- config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC);
+ config_fd = open(filename,O_CREAT|O_RDWR|O_TRUNC, 0644);
if(config_fd){
snprintf(line,1024,"# G15Daemon Configuration File\n# any items entered before a [section] header\n# will be in the Global config space\n# comments you wish to keep should start with a semicolon';'\n");
write(config_fd,line,strlen(line));
@@ -0,0 +1,30 @@
--- a/plugins/g15_plugin_uinput.c
+++ b/plugins/g15_plugin_uinput.c
@@ -125,6 +125,13 @@
event.value = G15KEY_DOWN;
write (uinp_fd, &event, sizeof(event));
+
+ memset(&event, 0, sizeof(event));
+
+ event.type = EV_SYN;
+ event.code = SYN_REPORT;
+
+ write (uinp_fd, &event, sizeof(event));
}
static void g15_uinput_keyup(unsigned char code)
@@ -137,6 +144,13 @@
event.value = G15KEY_UP;
write (uinp_fd, &event, sizeof(event));
+
+ memset(&event, 0, sizeof(event));
+
+ event.type = EV_SYN;
+ event.code = SYN_REPORT;
+
+ write (uinp_fd, &event, sizeof(event));
}
void (*keyup)(unsigned char code) = &g15_uinput_keyup;
+11
View File
@@ -0,0 +1,11 @@
--- a/libg15daemon_client/g15daemon_net.c
+++ b/libg15daemon_client/g15daemon_net.c
@@ -217,7 +217,7 @@
if(poll(pfd,1,100)>0){
if(pfd[0].revents & POLLPRI && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) {
memset(packet,0,sizeof(packet));
- msgret = recv(sock, packet, 10 , MSG_OOB);
+ msgret = recv(sock, packet, sizeof(packet) , MSG_OOB);
if (msgret < 1) {
return -1;
}
+23
View File
@@ -0,0 +1,23 @@
Description: Reinitialize on any libusb error.
This allows g15daemon to correctly recover after suspend/resume.
Author: Alexander Ponyatykh <lazyranma@gmail.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libusb/+bug/1357556
Forwarded: no
Last-Update: 2019-11-17
===================================================================
--- a/g15daemon/main.c
+++ b/g15daemon/main.c
@@ -203,11 +203,10 @@
g15daemon_send_event(masterlist->current->lcd,
G15_EVENT_KEYPRESS, keypresses);
lastkeys = keypresses;
-
- }else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
+ }else if(retval != G15_NO_ERROR && retval != G15_ERROR_TIMEOUT && LIBG15_VERSION>=1200) {
+ g15daemon_log(LOG_WARNING,"Keyboard error (%d).. Reinitializing\n", retval);
pthread_mutex_lock(&g15lib_mutex);
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
- g15daemon_log(LOG_WARNING,"Keyboard has gone.. Retrying\n");
sleep(1);
}
if(!leaving) {
+44
View File
@@ -0,0 +1,44 @@
Description: Remove unused variables
Global variable keyhandler is declared as pointer to incomplete struct type.
Upon closer inspection, it turned out that this variable and
client_handles_keys are unused.
Author: Alexander Ponyatykh <lazyranma@gmail.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688465
Last-Update: 2019-11-18
===================================================================
--- a/g15daemon/linked_lists.c
+++ b/g15daemon/linked_lists.c
@@ -30,8 +30,6 @@
#include <g15daemon.h>
#include <libg15.h>
-extern lcd_t *keyhandler;
-extern unsigned int client_handles_keys;
extern plugin_info_t *generic_info;
lcd_t static * ll_create_lcd () {
@@ -175,12 +173,6 @@
(*masterlist)->current->lcd->state_changed = 1;
}
- if(&oldnode->lcd == (void*)keyhandler) {
- client_handles_keys = 0;
- keyhandler = NULL;
- g15daemon_log(LOG_WARNING,"Client key handler quit, going back to defaults");
- }
-
if((*masterlist)->head!=oldnode){
(*next)->prev = oldnode->prev;
(*prev)->next = oldnode->next;
--- a/g15daemon/main.c
+++ b/g15daemon/main.c
@@ -53,9 +53,7 @@
int keyboard_backlight_off_onexit = 0;
unsigned int g15daemon_debug = 0;
unsigned int cycle_key;
-unsigned int client_handles_keys = 0;
static unsigned int set_backlight = 0;
-struct lcd_t *keyhandler = NULL;
static int loaded_plugins = 0;
+8
View File
@@ -0,0 +1,8 @@
01-remove-x11-setup-from-man.diff
02-better-screenshort-creation.diff
03-change-syslog-facility.diff
04-open-needs-mode.diff
05-send-a-sync-event-after-key-up-down.diff
06-fix-buffer-overflow.diff
07-reinit-on-any-error.diff
08-remove-unused-variables.diff
Vendored Executable
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
#DEBHELPER#
#g15daemon.service is normally pulled by udev events at boot time or after
#plugging in a device, and deb-systemd-invoke refuses to start a static service,
#so force it to start using invoke-rc.d
if [ -d /run/systemd/system ] && [ -z "$2" ] && ( [ "$1" = "configure" ] \
|| [ "$1" = "abort-remove" ] ) ; then
invoke-rc.d g15daemon start >/dev/null || true
fi
+5 -22
View File
@@ -1,26 +1,9 @@
#!/usr/bin/make -f #!/usr/bin/make -f
DH_VERBOSE = 1
AUTOMAKE_REMOVE := Makefile Makefile.in */Makefile */Makefile.in configure aclocal.m4 %:
AUTOMAKE_REMOVE += *.lo *.o *.la */*.lo */*.o */*.la dh $@
AUTOMAKE_REMOVE += g15daemon/g15daemon g15daemon/g15daemontest
AUTOMAKE_REMOVE += config.status config.log config.h config.h.in config/* libtool stamp-h1
AUTOMAKE_REMOVE += */.libs/
clean::
-rm -Rf $(AUTOMAKE_REMOVE)
makebuilddir:: Makefile
Makefile:: Makefile.am autogen.sh
[ -d config ] || mkdir config
aclocal -I config
libtoolize --automake --force --copy
autoheader
automake --add-missing --copy
autoconf
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
override_dh_installsystemd:
dh_installsystemd --no-start
+1
View File
@@ -0,0 +1 @@
3.0 (quilt)
+1 -1
View File
@@ -3,5 +3,5 @@
# Compulsory line, this is a version 3 file # Compulsory line, this is a version 3 file
version=3 version=3
http://sf.net/g15daemon/g15daemon-([1-9].*)\.tar\.bz2 https://sf.net/g15daemon/g15daemon-([1-9].*)\.tar\.gz
+524
View File
@@ -0,0 +1,524 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
sbin_PROGRAMS = g15daemon$(EXEEXT)
noinst_PROGRAMS = g15daemontest$(EXEEXT)
subdir = g15daemon
DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(includedir)"
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_g15daemon_OBJECTS = utility_funcs.$(OBJEXT) main.$(OBJEXT) \
linked_lists.$(OBJEXT) g15_plugins.$(OBJEXT)
g15daemon_OBJECTS = $(am_g15daemon_OBJECTS)
g15daemon_DEPENDENCIES =
g15daemon_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15daemon_LDFLAGS) $(LDFLAGS) -o $@
am_g15daemontest_OBJECTS = lcdclient_test.$(OBJEXT)
g15daemontest_OBJECTS = $(am_g15daemontest_OBJECTS)
g15daemontest_DEPENDENCIES = \
$(top_builddir)/libg15daemon_client/libg15daemon_client.la
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
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 = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(g15daemon_SOURCES) $(g15daemontest_SOURCES)
DIST_SOURCES = $(g15daemon_SOURCES) $(g15daemontest_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS) $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
AM_CFLAGS = -DG15DAEMON_BUILD -Wall
noinst_HEADERS = g15logo.h
g15daemon_SOURCES = utility_funcs.c g15daemon.h main.c linked_lists.c g15_plugins.c
g15daemon_LDADD = -ldl
g15daemon_LDFLAGS = -rdynamic
g15daemontest_SOURCES = lcdclient_test.c
INCLUDES = -I$(top_builddir)/libg15daemon_client/
g15daemontest_LDADD = $(top_builddir)/libg15daemon_client/libg15daemon_client.la
include_HEADERS = g15daemon.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu g15daemon/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu g15daemon/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
rm -f "$(DESTDIR)$(sbindir)/$$f"; \
done
clean-sbinPROGRAMS:
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
g15daemon$(EXEEXT): $(g15daemon_OBJECTS) $(g15daemon_DEPENDENCIES)
@rm -f g15daemon$(EXEEXT)
$(g15daemon_LINK) $(g15daemon_OBJECTS) $(g15daemon_LDADD) $(LIBS)
g15daemontest$(EXEEXT): $(g15daemontest_OBJECTS) $(g15daemontest_DEPENDENCIES)
@rm -f g15daemontest$(EXEEXT)
$(LINK) $(g15daemontest_OBJECTS) $(g15daemontest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15_plugins.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lcdclient_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linked_lists.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility_funcs.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@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@ mv -f $(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
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-sbinPROGRAMS
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-includeHEADERS uninstall-sbinPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am \
install-includeHEADERS install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-sbinPROGRAMS 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-includeHEADERS \
uninstall-sbinPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+116 -14
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 179 $ - $Date: 2006-11-19 09:33:12 +0100 (Sun, 19 Nov 2006) $ $Author: mlampard $ $Revision: 408 $ - $Date: 2008-01-09 12:07:02 +1030 (Wed, 09 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -52,13 +52,35 @@ void * g15daemon_dlopen_plugin(char *name,unsigned int library) {
void * handle; void * handle;
char * error; char * error;
static int deepbind = 0;
int mode = library==1?RTLD_GLOBAL:RTLD_LOCAL; int mode = library==1?RTLD_GLOBAL:RTLD_LOCAL;
#ifdef RTLD_DEEPBIND
mode|=RTLD_DEEPBIND; /* set ordering of symbols so plugin uses its
own symbols in preference to ours */
if(!deepbind)
g15daemon_log(LOG_INFO,"G15Daemon Plugin_Loader - DEEPBIND Flag available. Using it.\n");
deepbind=1;
#endif
handle = dlopen (name,RTLD_NOW | mode); g15daemon_log(LOG_INFO,"PRELOADING %s",name);
/* remove any pending errors */
dlerror();
handle = dlopen (name,RTLD_LAZY | mode | RTLD_NODELETE);
dlclose(handle);
dlerror();
handle = dlopen (name,RTLD_NOW | mode | RTLD_NOLOAD);
if(!handle) { /* FIXME: retry once more if load failed */
dlerror();
g15daemon_log(LOG_ERR, "Initialisation Failed. Retrying..");
handle = dlopen (name, RTLD_LAZY | mode );
}
if ((error = dlerror()) != NULL) { if ((error = dlerror()) != NULL) {
g15daemon_log (LOG_ERR, "%s\n", error); g15daemon_log (LOG_ERR, "Plugin_Loader - Error loading %s - %s\n", name, error);
return(NULL); return(NULL);
} }
@@ -67,7 +89,12 @@ void * g15daemon_dlopen_plugin(char *name,unsigned int library) {
int g15daemon_dlclose_plugin(void *handle) { int g15daemon_dlclose_plugin(void *handle) {
char * error;
dlclose(handle); dlclose(handle);
error = dlerror();
if(error != NULL)
g15daemon_log(LOG_ERR, "Error from dlclose %s\n",error);
return 0; return 0;
} }
@@ -101,6 +128,7 @@ void run_lcd_client(plugin_t *plugin_args) {
if(!leaving) if(!leaving)
g15daemon_lcdnode_remove(display); g15daemon_lcdnode_remove(display);
} }
void run_advanced_client(plugin_t *plugin_args) void run_advanced_client(plugin_t *plugin_args)
{ {
plugin_info_t *info = plugin_args->info; plugin_info_t *info = plugin_args->info;
@@ -129,7 +157,7 @@ void run_advanced_client(plugin_t *plugin_args)
g15daemon_msleep(info->update_msecs); g15daemon_msleep(info->update_msecs);
} }
}else{ }else{
while(1){ while(!leaving){
g15daemon_msleep(500); g15daemon_msleep(500);
} }
} }
@@ -144,15 +172,17 @@ void *plugin_thread(plugin_t *plugin_args) {
void *handle = plugin_args->plugin_handle; void *handle = plugin_args->plugin_handle;
if(plugin_args->info->plugin_run!=NULL||plugin_args->info->event_handler!=NULL) { if(plugin_args->info->plugin_run!=NULL||plugin_args->info->event_handler!=NULL) {
g15daemon_log(LOG_ERR,"registered plugin \"%s\"",info->name); g15daemon_log(LOG_ERR,"Plugin \"%s\" boot successful.",info->name);
} else { } else {
return NULL; return NULL;
} }
if(plugin_args->type == G15_PLUGIN_LCD_CLIENT){ if(plugin_args->type == G15_PLUGIN_LCD_CLIENT){
g15daemon_log(LOG_INFO,"Starting plugin thread \"%s\" in standard mode\n",info->name);
run_lcd_client(plugin_args); run_lcd_client(plugin_args);
} }
else if(plugin_args->type == G15_PLUGIN_CORE_OS_KB||plugin_args->type == G15_PLUGIN_LCD_SERVER) { else if(plugin_args->type == G15_PLUGIN_CORE_OS_KB||plugin_args->type == G15_PLUGIN_LCD_SERVER) {
g15daemon_log(LOG_INFO,"Starting plugin thread \"%s\" in advanced mode\n",info->name);
run_advanced_client(plugin_args); run_advanced_client(plugin_args);
} }
@@ -165,6 +195,32 @@ void *plugin_thread(plugin_t *plugin_args) {
return NULL; return NULL;
} }
int g15_count_plugins(char *plugin_directory) {
DIR *directory;
struct dirent *ep;
char pluginname[2048];
int count=0;
directory = opendir (plugin_directory);
if (directory != NULL)
{
while ((ep = readdir (directory))) {
if(strstr(ep->d_name,".so")){
strcpy(pluginname, plugin_directory);
strncat(pluginname,"/",1);
strncat(pluginname,ep->d_name,200);
++count;
}
}
(void) closedir (directory);
}
else
count = -1;
return count;
}
int g15_plugin_load (g15daemon_t *masterlist, char *filename) { int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
void * plugin_handle = NULL; void * plugin_handle = NULL;
@@ -173,14 +229,19 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
pthread_t client_connection; pthread_t client_connection;
pthread_attr_t attr; pthread_attr_t attr;
lcdnode_t *clientnode; lcdnode_t *clientnode;
char *error_str;
if((plugin_handle = g15daemon_dlopen_plugin(filename,G15_PLUGIN_NONSHARED))!=NULL) { if((plugin_handle = g15daemon_dlopen_plugin(filename,G15_PLUGIN_NONSHARED))!=NULL) {
plugin_t *plugin_args=malloc(sizeof(plugin_t)); plugin_t *plugin_args=malloc(sizeof(plugin_t));
plugin_args->info = dlsym(plugin_handle, "g15plugin_info"); plugin_args->info = dlsym(plugin_handle, "g15plugin_info");
dlerror(); error_str=dlerror();
if(error_str!=NULL)
g15daemon_log(LOG_ERR,"g15_plugin_load: %s %s\n",filename,error_str);
if(!plugin_args->info) { /* if it doesnt have a valid struct, we should just load it as a library... but we dont at the moment FIXME */ if(!plugin_args->info) { /* if it doesnt have a valid struct, we should just load it as a library... but we dont at the moment FIXME */
g15daemon_log(LOG_ERR,"%s is not a valid g15daemon plugin\n",filename); g15daemon_log(LOG_ERR,"%s is not a valid g15daemon plugin. Unloading\n",filename);
g15daemon_dlclose_plugin(plugin_handle); g15daemon_dlclose_plugin(plugin_handle);
dlerror(); dlerror();
return -1; return -1;
@@ -188,10 +249,14 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
if(strncasecmp("Load",g15daemon_cfg_read_string(plugin_cfg, plugin_args->info->name,"Load"),5)!=0) if(strncasecmp("Load",g15daemon_cfg_read_string(plugin_cfg, plugin_args->info->name,"Load"),5)!=0)
{ {
g15daemon_log(LOG_ERR, "\"%s\" Plugin disabled in g15daemon.conf - not running\n",plugin_args->info->name);
g15daemon_dlclose_plugin(plugin_handle); g15daemon_dlclose_plugin(plugin_handle);
return -1; return -1;
} }
g15daemon_log(LOG_WARNING, "Booting plugin \"%s\"",plugin_args->info->name);
plugin_args->type = plugin_args->info->type; plugin_args->type = plugin_args->info->type;
/* assign the generic eventhandler if the plugin doesnt provide one - the generic one does nothing atm. FIXME*/ /* assign the generic eventhandler if the plugin doesnt provide one - the generic one does nothing atm. FIXME*/
if(plugin_args->info->event_handler==NULL) if(plugin_args->info->event_handler==NULL)
@@ -223,7 +288,7 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&attr,64*1024); /* set stack to 64k - dont need 8Mb */ pthread_attr_setstacksize(&attr,64*1024); /* set stack to 64k - dont need 8Mb */
if (pthread_create(&client_connection, &attr, (void*)plugin_thread, plugin_args) != 0) { if (pthread_create(&client_connection, &attr, (void*)plugin_thread, plugin_args) != 0) {
g15daemon_log(LOG_WARNING,"Unable to create client thread."); g15daemon_log(LOG_ERR,"Unable to create client thread.");
} else { } else {
pthread_detach(client_connection); pthread_detach(client_connection);
} }
@@ -232,26 +297,63 @@ int g15_plugin_load (g15daemon_t *masterlist, char *filename) {
} }
void g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory) { int g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory) {
DIR *directory; DIR *directory;
struct dirent *ep; struct dirent *ep;
char pluginname[2048]; char pluginname[2048];
int loadcount = 0;
int count = g15_count_plugins(plugin_directory);
config_section_t *load_cfg = g15daemon_cfg_load_section(masterlist,"PLUGIN_LOAD_ORDER");
if(!uf_search_confitem(load_cfg,"TotalPlugins") ||
(g15daemon_cfg_read_int(load_cfg,"TotalPlugins",0)!=count) ||
(g15daemon_cfg_read_string(load_cfg,"0","")[0]=='/')) {
g15daemon_log(LOG_INFO,"Number of plugins has changed. Rebuilding load order.");
directory = opendir (plugin_directory); directory = opendir (plugin_directory);
if (directory != NULL) if (directory != NULL && count)
{ {
g15daemon_log(LOG_WARNING,"Attempting load of %i plugins",count);
while ((ep = readdir (directory))) { while ((ep = readdir (directory))) {
if(strstr(ep->d_name,".so")){ if(strstr(ep->d_name,".so")){
strcpy(pluginname, plugin_directory); strcpy(pluginname, plugin_directory);
strncat(pluginname,"/",1); strncat(pluginname,"/",1);
strncat(pluginname,ep->d_name,200); strncat(pluginname,ep->d_name,200);
g15daemon_log(LOG_INFO, "Loading plugin %s",pluginname); if(g15_plugin_load (masterlist, pluginname)==0){
g15_plugin_load (masterlist, pluginname); char tmp[10];
sprintf(tmp,"%i",loadcount);
g15daemon_cfg_write_string(load_cfg,tmp,ep->d_name);
loadcount++;
}
g15daemon_msleep(20); g15daemon_msleep(20);
} }
} }
(void) closedir (directory); (void) closedir (directory);
g15daemon_cfg_write_int(load_cfg,"TotalPlugins",loadcount);
g15daemon_log(LOG_WARNING,"Successfully loaded %i of %i plugins.",loadcount,count);
return loadcount;
} }
else else
perror ("Couldn't open the directory"); g15daemon_log (LOG_ERR,"Unable to open the directory: %s",plugin_directory);
}else{
int i;
g15daemon_log(LOG_INFO,"Loading %i plugins named in g15daemon.conf.",count);
for(i=0;i<count;i++){
char tmp[10];
char plugin_fname[1024];
sprintf(tmp,"%i",i);
strcpy(plugin_fname,PLUGINDIR);
strncat(plugin_fname,"/",1);
strncat(plugin_fname,g15daemon_cfg_read_string(load_cfg,tmp,""),128);
g15_plugin_load(masterlist,plugin_fname);
g15daemon_msleep(20);
}
return count;
}
return 0;
} }
+17 -6
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 295 $ - $Date: 2007-09-09 06:37:50 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $ $Revision: 441 $ - $Date: 2008-01-22 20:39:21 +1030 (Tue, 22 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -46,6 +46,7 @@
#define CLIENT_CMD_GET_KEYSTATE 'k' #define CLIENT_CMD_GET_KEYSTATE 'k'
#define CLIENT_CMD_SWITCH_PRIORITIES 'p' #define CLIENT_CMD_SWITCH_PRIORITIES 'p'
#define CLIENT_CMD_NEVER_SELECT 'n'
#define CLIENT_CMD_IS_FOREGROUND 'v' #define CLIENT_CMD_IS_FOREGROUND 'v'
#define CLIENT_CMD_IS_USER_SELECTED 'u' #define CLIENT_CMD_IS_USER_SELECTED 'u'
#define CLIENT_CMD_BACKLIGHT 0x80 #define CLIENT_CMD_BACKLIGHT 0x80
@@ -171,13 +172,14 @@ typedef struct lcd_s
int max_x; int max_x;
int max_y; int max_y;
int connection; int connection;
long int ident;
unsigned int backlight_state; unsigned int backlight_state;
unsigned int mkey_state; unsigned int mkey_state;
unsigned int contrast_state; unsigned int contrast_state;
unsigned int state_changed; unsigned int state_changed;
/* set to 1 if user manually selected this screen 0 otherwise*/ /* set to 1 if user manually selected this screen 0 otherwise */
unsigned int usr_foreground; unsigned int usr_foreground;
/* set to 1 if screen is never to be user-selectable */
unsigned int never_select;
/* only used for plugins */ /* only used for plugins */
plugin_t *g15plugin; plugin_t *g15plugin;
@@ -221,13 +223,18 @@ pthread_mutex_t g15lib_mutex;
#ifdef G15DAEMON_BUILD #ifdef G15DAEMON_BUILD
/* internal g15daemon-only functions */ /* internal g15daemon-only functions */
void uf_write_buf_to_g15(lcd_t *lcd); void g15daemon_init_refresh();
void g15daemon_quit_refresh();
int uf_write_buf_to_g15(lcd_t *lcd);
/* write a pbm format file 'filename' with image contained in 'buf' */
int uf_screendump_pbm(unsigned char *buf,char *filename);
int uf_read_keypresses(unsigned int *keypresses, unsigned int timeout);
/* return the pid of a running copy of g15daemon, else -1 */ /* return the pid of a running copy of g15daemon, else -1 */
int uf_return_running(); int uf_return_running();
/* create a /var/run/g15daemon.pid file, returning 0 on success else -1 */ /* create a /var/run/g15daemon.pid file, returning 0 on success else -1 */
int uf_create_pidfile(); int uf_create_pidfile();
/* open & run all plugins in the given directory */ /* open & run all plugins in the given directory */
void g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory); int g15_open_all_plugins(g15daemon_t *masterlist, char *plugin_directory);
/* linked lists */ /* linked lists */
g15daemon_t *ll_lcdlist_init(); g15daemon_t *ll_lcdlist_init();
void ll_lcdlist_destroy(g15daemon_t **masterlist); void ll_lcdlist_destroy(g15daemon_t **masterlist);
@@ -245,6 +252,10 @@ int internal_generic_eventhandler(plugin_event_t *myevent);
#endif #endif
/* the following functions are available for use by plugins */ /* the following functions are available for use by plugins */
/* send notification of LCD buffer update */
void g15daemon_send_refresh(lcd_t *lcd);
/* wait on notification of LCD buffer update */
void g15daemon_wait_refresh();
/* create a new section */ /* create a new section */
config_section_t *g15daemon_cfg_load_section(g15daemon_t *masterlist,char *name); config_section_t *g15daemon_cfg_load_section(g15daemon_t *masterlist,char *name);
/* return string value from key in sectionname */ /* return string value from key in sectionname */
+13 -13
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 300 $ - $Date: 2007-09-10 09:52:01 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $ $Revision: 381 $ - $Date: 2008-01-01 23:41:08 +1030 (Tue, 01 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
// keystate = g15_send_cmd (g15screen_fd, G15DAEMON_GET_KEYSTATE, foo); // keystate = g15_send_cmd (g15screen_fd, G15DAEMON_GET_KEYSTATE, foo);
//while(1){ //while(1){
//recv(g15screen_fd, &keystate, 4, 0); recv(g15screen_fd, &keystate, 4, 0);
if(keystate) if(keystate)
printf("keystate = %i\n",keystate); printf("keystate = %i\n",keystate);
//} //}
@@ -79,19 +79,19 @@ int main(int argc, char *argv[])
// break; // break;
/* G2,G3 & G4 change LCD backlight */ /* G2,G3 & G4 change LCD backlight */
// if(keystate & G15_KEY_G2){ if(keystate & G15_KEY_G2){
// retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_DARK); retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_DARK);
// } }
// if(keystate & G15_KEY_G3){ if(keystate & G15_KEY_G3){
// retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_MEDIUM); retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_MEDIUM);
unsigned char packet[2]; unsigned char packet[2];
packet[0] = G15DAEMON_BACKLIGHT|G15_BRIGHTNESS_MEDIUM; packet[0] = G15DAEMON_BACKLIGHT|G15_BRIGHTNESS_MEDIUM;
printf("sent %i bytes\n",send(g15screen_fd, packet, 1, MSG_OOB )); printf("sent %i bytes\n",send(g15screen_fd, packet, 1, MSG_OOB ));
// } }
// if(keystate & G15_KEY_G4){ if(keystate & G15_KEY_G4){
// retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_BRIGHT); retval = g15_send_cmd (g15screen_fd, G15DAEMON_BACKLIGHT, G15_BRIGHTNESS_BRIGHT);
// } }
/* /*
retval = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, foo); retval = g15_send_cmd (g15screen_fd, G15DAEMON_IS_FOREGROUND, foo);
@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
// } // }
*/ */
sleep(2); // sleep(2);
#ifdef TEST_KEYHANDLER #ifdef TEST_KEYHANDLER
/* ok.. request that all G&M keys are passed to us.. */ /* ok.. request that all G&M keys are passed to us.. */
retval = g15_send_cmd (g15screen_fd, G15DAEMON_KEY_HANDLER, foo); retval = g15_send_cmd (g15screen_fd, G15DAEMON_KEY_HANDLER, foo);
+18 -12
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 177 $ - $Date: 2006-11-18 14:46:03 +0100 (Sat, 18 Nov 2006) $ $Author: mlampard $ $Revision: 451 $ - $Date: 2008-01-25 15:15:04 +1030 (Fri, 25 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -116,35 +116,40 @@ lcdnode_t *g15daemon_lcdnode_add(g15daemon_t **masterlist) {
/* cycle through connected client displays */ /* cycle through connected client displays */
void g15daemon_lcdnode_cycle(g15daemon_t *masterlist) void g15daemon_lcdnode_cycle(g15daemon_t *masterlist)
{ {
lcdnode_t *current_screen = masterlist->current; lcdnode_t *current_screen = NULL;
pthread_mutex_lock(&lcdlist_mutex);
skip:
current_screen = masterlist->current;
g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN); g15daemon_send_event(current_screen->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_HIDDEN);
do do
{ {
pthread_mutex_lock(&lcdlist_mutex); masterlist->current->lcd->usr_foreground=0;
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 0);
if(masterlist->tail == masterlist->current){ if(masterlist->tail == masterlist->current){
masterlist->current = masterlist->head; masterlist->current = masterlist->head;
}else{ }else{
masterlist->current = masterlist->current->prev; masterlist->current = masterlist->current->prev;
} }
pthread_mutex_unlock(&lcdlist_mutex);
} }
while (current_screen != masterlist->current); while (current_screen != masterlist->current);
pthread_mutex_lock(&lcdlist_mutex);
if(masterlist->tail == masterlist->current) { if(masterlist->tail == masterlist->current) {
masterlist->current = masterlist->head; masterlist->current = masterlist->head;
} else { } else {
masterlist->current = masterlist->current->prev; masterlist->current = masterlist->current->prev;
} }
pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE); if(masterlist->current->lcd->never_select==1) {
g15daemon_send_event(current_screen->lcd, G15_EVENT_USER_FOREGROUND, 1); goto skip;
pthread_mutex_lock(&lcdlist_mutex); }
masterlist->current->lcd->state_changed = 1;
masterlist->current->last_priority = masterlist->current; masterlist->current->last_priority = masterlist->current;
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
masterlist->current->lcd->usr_foreground=1;
g15daemon_send_event(masterlist->current->lcd, G15_EVENT_VISIBILITY_CHANGED, SCR_VISIBLE);
} }
void g15daemon_lcdnode_remove (lcdnode_t *oldnode) { void g15daemon_lcdnode_remove (lcdnode_t *oldnode) {
@@ -183,6 +188,7 @@ void g15daemon_lcdnode_remove (lcdnode_t *oldnode) {
(*prev)->next = (*masterlist)->tail; (*prev)->next = (*masterlist)->tail;
(*masterlist)->head = oldnode->prev; (*masterlist)->head = oldnode->prev;
} }
g15daemon_send_refresh((*masterlist)->current->lcd);
free(oldnode); free(oldnode);
+128 -50
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 302 $ - $Date: 2007-09-10 09:57:53 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $ $Revision: 457 $ - $Date: 2008-01-31 15:32:46 +1030 (Thu, 31 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -54,8 +54,11 @@ int keyboard_backlight_off_onexit = 0;
unsigned int g15daemon_debug = 0; unsigned int g15daemon_debug = 0;
unsigned int cycle_key; unsigned int cycle_key;
unsigned int client_handles_keys = 0; unsigned int client_handles_keys = 0;
static unsigned int set_backlight = 0;
struct lcd_t *keyhandler = NULL; struct lcd_t *keyhandler = NULL;
static int loaded_plugins = 0;
/* send event to foreground client's eventlistener */ /* send event to foreground client's eventlistener */
int g15daemon_send_event(void *caller, unsigned int event, unsigned long value) int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
{ {
@@ -64,6 +67,10 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
static unsigned long lastkeys; static unsigned long lastkeys;
if(!(value & cycle_key) && !(lastkeys & cycle_key)){ if(!(value & cycle_key) && !(lastkeys & cycle_key)){
lcd_t *lcd = (lcd_t*)caller; lcd_t *lcd = (lcd_t*)caller;
if(!lcd->g15plugin->info)
break;
int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler; int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler;
plugin_event_t *newevent=g15daemon_xmalloc(sizeof(plugin_event_t)); plugin_event_t *newevent=g15daemon_xmalloc(sizeof(plugin_event_t));
newevent->event = event; newevent->event = event;
@@ -82,9 +89,19 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno)); g15daemon_log(LOG_WARNING,"Error in send: %s\n",strerror(errno));
} }
if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state if(value & G15_KEY_LIGHT){ // the backlight key was pressed - maintain user-selected state
lcd_t *displaying = lcd->masterlist->current->lcd;
lcd->masterlist->kb_backlight_state++; lcd->masterlist->kb_backlight_state++;
if(lcd->masterlist->kb_backlight_state>2) lcd->masterlist->kb_backlight_state %= 3;
lcd->masterlist->kb_backlight_state=0; displaying->backlight_state++;
displaying->backlight_state %= 3; // limit to 0-2 inclusive
}
if(value & G15_KEY_M1 && value & G15_KEY_M3) {
static int scr_num=0;
char filename[128];
lcd_t *displaying = lcd->masterlist->current->lcd;
sprintf(filename,"/tmp/g15daemon-sc-%i.pbm",scr_num);
uf_screendump_pbm(displaying->buf,filename);
scr_num++;
} }
free(newevent); free(newevent);
}else{ }else{
@@ -92,6 +109,7 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
lcd_t *lcd = (lcd_t*)caller; lcd_t *lcd = (lcd_t*)caller;
g15daemon_t* masterlist = lcd->masterlist; g15daemon_t* masterlist = lcd->masterlist;
static unsigned int clicktime; static unsigned int clicktime;
if(value & cycle_key) { if(value & cycle_key) {
clicktime=g15daemon_gettime_ms(); clicktime=g15daemon_gettime_ms();
}else{ }else{
@@ -146,8 +164,11 @@ int g15daemon_send_event(void *caller, unsigned int event, unsigned long value)
} }
} }
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_send_refresh((lcd_t*)lcdnode->list->current->lcd);
break; break;
} }
case G15_EVENT_VISIBILITY_CHANGED:
g15daemon_send_refresh((lcd_t*)caller);
default: { default: {
lcd_t *lcd = (lcd_t*)caller; lcd_t *lcd = (lcd_t*)caller;
int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler; int *(*plugin_listener)(plugin_event_t *newevent) = (void*)lcd->g15plugin->info->event_handler;
@@ -168,68 +189,72 @@ static void *keyboard_watch_thread(void *lcdlist){
unsigned int keypresses = 0; unsigned int keypresses = 0;
int retval = 0; int retval = 0;
static int lastkeys = 0;
while (!leaving) { while (!leaving) {
pthread_mutex_lock(&g15lib_mutex); retval = uf_read_keypresses(&keypresses, 20);
retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex);
/* every 2nd packet contains the codes we want.. immediately try again */ /* every 2nd packet contains the codes we want.. immediately try again */
while (retval == G15_ERROR_TRY_AGAIN){ while (retval == G15_ERROR_TRY_AGAIN){
pthread_mutex_lock(&g15lib_mutex); retval = uf_read_keypresses(&keypresses, 20);
retval = getPressedKeys(&keypresses, 40);
pthread_mutex_unlock(&g15lib_mutex);
} }
if(retval == G15_NO_ERROR){ if(retval == G15_NO_ERROR && lastkeys != keypresses) {
g15daemon_send_event(masterlist->current->lcd, g15daemon_send_event(masterlist->current->lcd,
G15_EVENT_KEYPRESS, keypresses); G15_EVENT_KEYPRESS, keypresses);
} lastkeys = keypresses;
if(retval == -ENODEV && LIBG15_VERSION>=1200) {
}else if(retval == -ENODEV && LIBG15_VERSION>=1200) {
pthread_mutex_lock(&g15lib_mutex); pthread_mutex_lock(&g15lib_mutex);
while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){ while((retval=re_initLibG15() != G15_NO_ERROR) && !leaving){
g15daemon_log(LOG_WARNING,"Keyboard has gone.. Retrying\n");
sleep(1); sleep(1);
} }
if(!leaving) { masterlist->current->lcd->state_changed=1; masterlist->current->lcd->ident=random();} if(!leaving) {
masterlist->current->lcd->state_changed=1;
g15daemon_send_refresh(masterlist->current->lcd);
}
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
} }
g15daemon_msleep(40);
g15daemon_msleep(10);
} }
return NULL; return NULL;
} }
static void *lcd_draw_thread(void *lcdlist){ static void *lcd_draw_thread(void *lcdlist){
g15daemon_t *masterlist = (g15daemon_t*)(lcdlist); g15daemon_t *masterlist = (g15daemon_t*)(lcdlist);
static long int lastlcd = 1;
static unsigned int lastscreentime;
/* unsigned int fps = 0; */ /* unsigned int fps = 0; */
lcd_t *displaying = masterlist->tail->lcd; lcd_t *displaying = masterlist->tail->lcd;
char *lastdisplayed=NULL;
memset(displaying->buf,0,1024); memset(displaying->buf,0,1024);
static int prev_state=0;
g15daemon_sleep(2); g15daemon_sleep(2);
while (!leaving) { while (!leaving) {
pthread_mutex_lock(&lcdlist_mutex); /* wait until a client has updated */
g15daemon_wait_refresh();
pthread_mutex_lock(&lcdlist_mutex);
displaying = masterlist->current->lcd; displaying = masterlist->current->lcd;
if(displaying->ident != lastlcd){
/* monitor 'fps' - due to the TCP protocol, some frames will be bunched up. /* monitor 'fps' - due to the TCP protocol, some frames will be bunched up.
discard excess to reduce load on the bus */ discard excess to reduce load on the bus */
/* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */ /* fps = 1000 / (g15daemon_gettime_ms() - lastscreentime); */
/* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */ /* if the current screen is less than 20ms from the previous (equivelant to 50fps) delay it */
/* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */ /* this allows a real-world fps of 40fps with no almost frame loss and reduces peak usb bus-load */
if((g15daemon_gettime_ms() - lastscreentime)>=20||(char*)displaying!=lastdisplayed){ g15daemon_log(LOG_DEBUG,"Updating LCD");
uf_write_buf_to_g15(displaying); uf_write_buf_to_g15(displaying);
lastscreentime = g15daemon_gettime_ms(); g15daemon_log(LOG_DEBUG,"LCD Update Complete");
lastdisplayed = (char*)displaying;
lastlcd = displaying->ident; if(prev_state!=displaying->backlight_state && set_backlight!=0) {
} prev_state=displaying->backlight_state;
pthread_mutex_lock(&g15lib_mutex);
setLCDBrightness(displaying->backlight_state);
usleep(5);
setLCDBrightness(displaying->backlight_state);
setKBBrightness(displaying->backlight_state);
pthread_mutex_unlock(&g15lib_mutex);
} }
if(displaying->state_changed){ if(displaying->state_changed){
@@ -237,17 +262,11 @@ static void *lcd_draw_thread(void *lcdlist){
setLCDContrast(displaying->contrast_state); setLCDContrast(displaying->contrast_state);
if(displaying->masterlist->remote_keyhandler_sock==0) // only allow mled control if the macro recorder isnt running if(displaying->masterlist->remote_keyhandler_sock==0) // only allow mled control if the macro recorder isnt running
setLEDs(displaying->mkey_state); setLEDs(displaying->mkey_state);
if(masterlist->kb_backlight_state)
setLCDBrightness(displaying->backlight_state);
else
setLCDBrightness(masterlist->kb_backlight_state);
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
displaying->state_changed = 0; displaying->state_changed = 0;
} }
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
g15daemon_msleep(5);
} }
return NULL; return NULL;
} }
@@ -257,6 +276,7 @@ void g15daemon_sighandler(int sig) {
case SIGUSR1: case SIGUSR1:
keyboard_backlight_off_onexit = 1; keyboard_backlight_off_onexit = 1;
case SIGINT: case SIGINT:
case SIGTERM:
case SIGQUIT: case SIGQUIT:
leaving = 1; leaving = 1;
break; break;
@@ -265,6 +285,39 @@ void g15daemon_sighandler(int sig) {
} }
} }
#ifndef HAVE_DAEMON
/* daemon() is not posix compliant, so we roll our own if needed.*/
int daemon(int nochdir, int noclose) {
pid_t pid;
if(nochdir<1)
chdir("/");
pid = fork();
switch(pid){
case -1:
printf("Unable to daemonise!\n");
return -1;
break;
case 0: {
umask(0);
if(setsid()==-1) {
perror("setsid");
return -1;
}
if(noclose<1) {
freopen( "/dev/null", "r", stdin);
freopen( "/dev/null", "w", stdout);
freopen( "/dev/null", "w", stderr);
}
break;
}
default:
_exit(0);
}
return 0;
}
#endif
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
@@ -275,6 +328,7 @@ int main (int argc, char *argv[])
struct sigaction new_action; struct sigaction new_action;
cycle_key = G15_KEY_L1; cycle_key = G15_KEY_L1;
unsigned char user[256]; unsigned char user[256];
unsigned int lcdlevel = 1;
pthread_t keyboard_thread; pthread_t keyboard_thread;
pthread_t lcd_thread; pthread_t lcd_thread;
@@ -309,13 +363,14 @@ int main (int argc, char *argv[])
if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) { if (!strncmp(daemonargs, "-h",2) || !strncmp(daemonargs, "--help",6)) {
printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running"); printf("G15Daemon version %s - %s\n",VERSION,uf_return_running() >= 0 ?"Loaded & Running":"Not Running");
printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) or -v (--version)\n\n -k will kill a previous incarnation",argv[0]); printf("%s -h (--help) or -k (--kill) or -s (--switch) or -d (--debug) [level] or -v (--version) or -l (--lcdlevel) [0-2] \n\n -k\twill kill a previous incarnation",argv[0]);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
printf(", if uppercase -K or -KILL turn off the keyboard backlight on the way out."); printf("\n -K\tturn off the keyboard backlight on the way out.");
#endif #endif
#endif #endif
printf("\n -h shows this help\n -s changes the screen-switch key from MR to L1\n -d debug mode - stay in foreground and output all debug messages to STDERR\n -v show version\n"); printf("\n -h\tshows this help\n -s\tchanges the screen-switch key from L1 to MR (beware)\n -d\tdebug mode - stay in foreground and output all debug messages to STDERR\n -v\tshow version\n -l\tset default LCD backlight level\n");
printf(" --set-backlight sets backlight individually for currently shown screen.\n\t\tDefault is to set backlight globally (keyboard default).\n");
exit(0); exit(0);
} }
@@ -324,6 +379,10 @@ int main (int argc, char *argv[])
cycle_cmdline_override=1; cycle_cmdline_override=1;
} }
if (!strncmp(daemonargs, "--set-backlight",15)) {
set_backlight = 1;
}
if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) { if (!strncmp(daemonargs, "-d",2) || !strncmp(daemonargs, "--debug",7)) {
g15daemon_debug = 1; g15daemon_debug = 1;
if((argv[i+1])!=NULL) if((argv[i+1])!=NULL)
@@ -340,6 +399,21 @@ int main (int argc, char *argv[])
} }
} }
if (!strncmp(daemonargs, "-l",2) || !strncmp(daemonargs, "--lcdlevel",7)) {
if((argv[i+1])!=NULL)
if(isdigit(argv[i+1][0])){
lcdlevel = atoi(argv[i+1]);
}
}
}
if(g15daemon_debug){
g15daemon_log(LOG_INFO, "G15Daemon %s Build Date: %s",PACKAGE_VERSION,BUILD_DATE);
g15daemon_log(LOG_DEBUG, "Build OS: %s",BUILD_OS_NAME);
g15daemon_log(LOG_DEBUG, "With compiler: %s",COMPILER_VERSION);
fprintf(stderr, "G15Daemon CMDLINE ARGS: ");
for(i=1;i<argc;i++)
fprintf(stderr, "%s ",argv[i]);
fprintf(stderr,"\n");
} }
if(uf_return_running()>=0) { if(uf_return_running()>=0) {
g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting"); g15daemon_log(LOG_ERR,"G15Daemon already running.. Exiting");
@@ -382,7 +456,7 @@ int main (int argc, char *argv[])
struct passwd *nobody; struct passwd *nobody;
unsigned char location[1024]; unsigned char location[1024];
openlog("g15daemon", LOG_PID, LOG_DAEMON); openlog("g15daemon", LOG_PID, LOG_USER);
if(strlen((char*)user)==0){ if(strlen((char*)user)==0){
nobody = getpwnam("nobody"); nobody = getpwnam("nobody");
}else { }else {
@@ -401,7 +475,8 @@ int main (int argc, char *argv[])
setLCDContrast(1); setLCDContrast(1);
setLEDs(0); setLEDs(0);
lcdlist->kb_backlight_state=1; lcdlist->kb_backlight_state=1;
setLCDBrightness(lcdlist->kb_backlight_state); lcdlist->current->lcd->backlight_state=lcdlevel;
setLCDBrightness(lcdlevel);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
@@ -414,27 +489,26 @@ int main (int argc, char *argv[])
if(!cycle_cmdline_override){ if(!cycle_cmdline_override){
cycle_key = 1==g15daemon_cfg_read_bool(global_cfg,"Use MR as Cycle Key",0)?G15_KEY_MR:G15_KEY_L1; cycle_key = 1==g15daemon_cfg_read_bool(global_cfg,"Use MR as Cycle Key",0)?G15_KEY_MR:G15_KEY_L1;
} }
#ifndef OSTYPE_SOLARIS
/* all other processes/threads should be seteuid nobody */ /* all other processes/threads should be seteuid nobody */
if(nobody!=NULL) { if(nobody!=NULL) {
seteuid(nobody->pw_uid); seteuid(nobody->pw_uid);
setegid(nobody->pw_gid); setegid(nobody->pw_gid);
} }
#endif
/* initialise the pthread condition for the LCD thread */
g15daemon_init_refresh();
pthread_mutex_init(&g15lib_mutex, NULL); pthread_mutex_init(&g15lib_mutex, NULL);
pthread_attr_init(&attr); pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM);
int thread_policy=SCHED_RR;
pthread_attr_setschedpolicy(&attr,thread_policy);
pthread_attr_setstacksize(&attr,512*1024); /* set stack to 512k - dont need 8Mb !! */
if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) { if (pthread_create(&keyboard_thread, &attr, keyboard_watch_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting"); g15daemon_log(LOG_ERR,"Unable to create keyboard listener thread. Exiting");
goto exitnow; goto exitnow;
} }
pthread_attr_setstacksize(&attr,128*1024); pthread_attr_setstacksize(&attr,128*1024);
/* all other threads have a lower priority... maybe */
pthread_attr_setscope(&attr,PTHREAD_SCOPE_PROCESS);
thread_policy=SCHED_OTHER;
pthread_attr_setschedpolicy(&attr,thread_policy);
if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) { if (pthread_create(&lcd_thread, &attr, lcd_draw_thread, lcdlist) != 0) {
g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting"); g15daemon_log(LOG_ERR,"Unable to create display thread. Exiting");
@@ -455,17 +529,17 @@ int main (int argc, char *argv[])
snprintf((char*)location,1024,"%s",PLUGINDIR); snprintf((char*)location,1024,"%s",PLUGINDIR);
g15_open_all_plugins(lcdlist,(char*)location); loaded_plugins = g15_open_all_plugins(lcdlist,(char*)location);
new_action.sa_handler = g15daemon_sighandler; new_action.sa_handler = g15daemon_sighandler;
new_action.sa_flags = 0; new_action.sa_flags = 0;
sigaction(SIGINT, &new_action, NULL); sigaction(SIGINT, &new_action, NULL);
sigaction(SIGQUIT, &new_action, NULL); sigaction(SIGQUIT, &new_action, NULL);
sigaction(SIGTERM, &new_action, NULL);
sigaction(SIGUSR1, &new_action, NULL); sigaction(SIGUSR1, &new_action, NULL);
do { do {
pause(); pause();
} while( leaving == 0); } while( leaving == 0);
g15daemon_log(LOG_INFO,"Leaving by request"); g15daemon_log(LOG_INFO,"Leaving by request");
@@ -473,6 +547,9 @@ int main (int argc, char *argv[])
pthread_join(lcd_thread,NULL); pthread_join(lcd_thread,NULL);
pthread_join(keyboard_thread,NULL); pthread_join(keyboard_thread,NULL);
/* switch off the lcd backlight */ /* switch off the lcd backlight */
char *blank=g15daemon_xmalloc(G15_BUFFER_LEN);
writePixmapToLCD((unsigned char*)blank);
free(blank);
setLCDBrightness(0); setLCDBrightness(0);
#ifdef LIBG15_VERSION #ifdef LIBG15_VERSION
#if LIBG15_VERSION >= 1200 #if LIBG15_VERSION >= 1200
@@ -494,6 +571,7 @@ exitnow:
seteuid(0); seteuid(0);
setegid(0); setegid(0);
closelog(); closelog();
g15daemon_quit_refresh();
uf_conf_write(lcdlist,"/etc/g15daemon.conf"); uf_conf_write(lcdlist,"/etc/g15daemon.conf");
uf_conf_free(lcdlist); uf_conf_free(lcdlist);
unlink("/var/run/g15daemon.pid"); unlink("/var/run/g15daemon.pid");
+121 -18
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 190 $ - $Date: 2006-11-21 17:31:03 +0100 (Tue, 21 Nov 2006) $ $Author: mlampard $ $Revision: 449 $ - $Date: 2008-01-24 17:42:07 +1030 (Thu, 24 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -44,10 +44,14 @@
#include "g15daemon.h" #include "g15daemon.h"
#include <libg15.h> #include <libg15.h>
#include <stdarg.h> #include <stdarg.h>
#include <libg15render.h>
extern unsigned int g15daemon_debug; extern unsigned int g15daemon_debug;
extern volatile int leaving;
#define G15DAEMON_PIDFILE "/var/run/g15daemon.pid" #define G15DAEMON_PIDFILE "/var/run/g15daemon.pid"
pthread_cond_t lcd_refresh = PTHREAD_COND_INITIALIZER;
/* if no exitfunc or eventhandler, member should be NULL */ /* if no exitfunc or eventhandler, member should be NULL */
const plugin_info_t generic_info[] = { const plugin_info_t generic_info[] = {
@@ -71,6 +75,45 @@ void *g15daemon_xmalloc(size_t size) {
return ptr; return ptr;
} }
static int refresh_pending=0;
void g15daemon_init_refresh() {
pthread_condattr_t attr;
pthread_cond_init(&lcd_refresh, &attr);
}
void g15daemon_send_refresh(lcd_t *lcd) {
if(lcd==lcd->masterlist->current->lcd||lcd->state_changed) {
pthread_cond_broadcast(&lcd_refresh);
refresh_pending++;
}
}
void g15daemon_wait_refresh() {
pthread_mutex_t dummy_mutex;
struct timespec timeout;
int retval;
if(refresh_pending<1) {
/* Create a dummy mutex which doesn't unlock for sure while waiting. */
pthread_mutex_init(&dummy_mutex, NULL);
pthread_mutex_lock(&dummy_mutex);
start:
time(&timeout.tv_sec);
timeout.tv_sec += 1;
timeout.tv_nsec = 0L;
retval=pthread_cond_timedwait(&lcd_refresh, &dummy_mutex, &timeout);
if(!leaving && retval == ETIMEDOUT)
goto start;
pthread_mutex_unlock(&dummy_mutex);
pthread_mutex_destroy(&dummy_mutex);
}
refresh_pending--;
}
void g15daemon_quit_refresh() {
pthread_cond_destroy(&lcd_refresh);
}
int uf_return_running(){ int uf_return_running(){
int fd; int fd;
char pidtxt[128]; char pidtxt[128];
@@ -133,20 +176,36 @@ int uf_create_pidfile() {
/* syslog wrapper */ /* syslog wrapper */
int g15daemon_log (int priority, const char *fmt, ...) { int g15daemon_log (int priority, const char *fmt, ...) {
va_list argp; va_list argp;
va_start (argp, fmt); va_start (argp, fmt);
if(g15daemon_debug == 0) int real_prio=0;
switch(g15daemon_debug) {
case 0:
case 1:
real_prio = LOG_WARNING;
break;
case 2:
real_prio = LOG_INFO;
break;
default:
real_prio = LOG_DEBUG;
}
if(real_prio>=priority) {
if(g15daemon_debug == 0) {
vsyslog(priority, fmt, argp); vsyslog(priority, fmt, argp);
else { } else {
vfprintf(stderr,fmt,argp); vfprintf(stderr,fmt,argp);
fprintf(stderr,"\n"); fprintf(stderr,"\n");
} }
}
va_end (argp); va_end (argp);
return 0; return 0;
} }
/* takes a 6880 byte (1byte==1pixel) buffer and packs it into libg15 format. */
void g15daemon_convert_buf(lcd_t *lcd, unsigned char * orig_buf) void g15daemon_convert_buf(lcd_t *lcd, unsigned char * orig_buf)
{ {
unsigned int x,y,val; unsigned int x,y,val;
@@ -166,13 +225,31 @@ void g15daemon_convert_buf(lcd_t *lcd, unsigned char * orig_buf)
} }
} }
/* wrap the libg15 function */ /* wrap the libg15 functions */
void uf_write_buf_to_g15(lcd_t *lcd) int uf_write_buf_to_g15(lcd_t *lcd)
{ {
int retval = 0;
#ifdef LIBUSB_BLOCKS
retval = writePixmapToLCD(lcd->buf);
#else
pthread_mutex_lock(&g15lib_mutex); pthread_mutex_lock(&g15lib_mutex);
writePixmapToLCD(lcd->buf); retval = writePixmapToLCD(lcd->buf);
pthread_mutex_unlock(&g15lib_mutex); pthread_mutex_unlock(&g15lib_mutex);
return; #endif
return retval;
}
int uf_read_keypresses(unsigned int *keypresses, unsigned int timeout)
{
int retval=0;
#ifdef LIBUSB_BLOCKS
retval = getPressedKeys(keypresses, timeout);
#else
pthread_mutex_lock(&g15lib_mutex);
retval = getPressedKeys(keypresses, timeout);
pthread_mutex_unlock(&g15lib_mutex);
#endif
return retval;
} }
/* Sleep routine (hackish). */ /* Sleep routine (hackish). */
@@ -195,18 +272,24 @@ void g15daemon_sleep(int seconds) {
pthread_mutex_destroy(&dummy_mutex); pthread_mutex_destroy(&dummy_mutex);
} }
/* microsecond sleep routine. */
int g15daemon_usleep(int useconds) {
struct timeval timeout;
if(useconds < 10000)
useconds = 10000;
timeout.tv_sec = useconds / 1000000;
timeout.tv_usec = useconds % 1000000;
return select (0,0,0,0,&timeout);
}
/* millisecond sleep routine. */ /* millisecond sleep routine. */
int g15daemon_msleep(int milliseconds) { int g15daemon_msleep(int milliseconds) {
struct timespec timeout; return g15daemon_usleep(milliseconds*1000);
if(milliseconds>999)
milliseconds=999;
timeout.tv_sec = 0;
timeout.tv_nsec = milliseconds*1000000;
return nanosleep (&timeout, NULL);
} }
unsigned int g15daemon_gettime_ms(){ unsigned int g15daemon_gettime_ms(){
struct timeval tv; struct timeval tv;
gettimeofday(&tv,NULL); gettimeofday(&tv,NULL);
@@ -367,7 +450,6 @@ char * uf_remove_whitespace(char *str){
int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){ int g15daemon_cfg_write_string(config_section_t *section, char *key, char *val){
config_items_t *new = NULL; config_items_t *new = NULL;
const char empty[]=" ";
if(section==NULL) if(section==NULL)
return -1; return -1;
@@ -519,7 +601,7 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
int config_fd=-1; int config_fd=-1;
char *sect; char *sect;
char *start; char *start;
char *bar; char *bar = NULL;
int i; int i;
struct stat stats; struct stat stats;
@@ -583,3 +665,24 @@ int uf_conf_open(g15daemon_t *list, char *filename) {
return 0; return 0;
} }
int uf_screendump_pbm(unsigned char *buffer,char *filename) {
FILE *f;
int x,y;
#define WIDTH 40
g15canvas *canvas=g15daemon_xmalloc(sizeof(g15canvas));
memcpy(canvas->buffer,buffer,LCD_BUFSIZE);
f = fopen(filename,"w+");
fprintf(f,"P1\n160 43\n");
fprintf(f,"# G15 screendump - %s\n\n",filename);
for(y=0;y<43;y++)
for(x=0;x<160;x++) {
fprintf(f,"%i",g15r_getPixel(canvas,x,y));
if(x%WIDTH==WIDTH-1)
fprintf(f,"\n");
}
fclose(f);
free(canvas);
return 0;
}
+495
View File
@@ -0,0 +1,495 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = libg15daemon_client
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libg15daemon_client_la_LIBADD =
am_libg15daemon_client_la_OBJECTS = g15daemon_net.lo
libg15daemon_client_la_OBJECTS = $(am_libg15daemon_client_la_OBJECTS)
libg15daemon_client_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libg15daemon_client_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
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 = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libg15daemon_client_la_SOURCES)
DIST_SOURCES = $(libg15daemon_client_la_SOURCES)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
lib_LTLIBRARIES = libg15daemon_client.la
libg15daemon_client_la_LDFLAGS = -version-info 1:2:0
libg15daemon_client_la_SOURCES = g15daemon_client.h g15daemon_net.c
include_HEADERS = g15daemon_client.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libg15daemon_client/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libg15daemon_client/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libg15daemon_client.la: $(libg15daemon_client_la_OBJECTS) $(libg15daemon_client_la_DEPENDENCIES)
$(libg15daemon_client_la_LINK) -rpath $(libdir) $(libg15daemon_client_la_OBJECTS) $(libg15daemon_client_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15daemon_net.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@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@ mv -f $(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
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES 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-includeHEADERS \
uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+4 -3
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 301 $ - $Date: 2007-09-10 09:55:15 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $ $Revision: 410 $ - $Date: 2008-01-13 13:28:55 +1030 (Sun, 13 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -50,6 +50,7 @@ extern "C"
#define G15DAEMON_SWITCH_PRIORITIES 'p' #define G15DAEMON_SWITCH_PRIORITIES 'p'
#define G15DAEMON_IS_FOREGROUND 'v' #define G15DAEMON_IS_FOREGROUND 'v'
#define G15DAEMON_IS_USER_SELECTED 'u' #define G15DAEMON_IS_USER_SELECTED 'u'
#define G15DAEMON_NEVER_SELECT 'n'
const char *g15daemon_version(); const char *g15daemon_version();
@@ -67,7 +68,7 @@ int g15_send(int sock, char *buf, unsigned int len);
int g15_recv(int sock, char *buf, unsigned int len); int g15_recv(int sock, char *buf, unsigned int len);
/* send a command (defined above) to the daemon. any replies from the daemon are returned */ /* send a command (defined above) to the daemon. any replies from the daemon are returned */
int g15_send_cmd (int sock, unsigned char command, unsigned char value); unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value);
/* receive an oob byte from the daemon, used internally by g15_send_cmd, but useful elsewhere */ /* receive an oob byte from the daemon, used internally by g15_send_cmd, but useful elsewhere */
#define G15_FOREGROUND_SENT_OOB 1 #define G15_FOREGROUND_SENT_OOB 1
int g15_recv_oob_answer(int sock); int g15_recv_oob_answer(int sock);
+61 -8
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 301 $ - $Date: 2007-09-10 09:55:15 +0200 (Mon, 10 Sep 2007) $ $Author: mlampard $ $Revision: 451 $ - $Date: 2008-01-25 15:15:04 +1030 (Fri, 25 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -25,6 +25,7 @@
*/ */
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
@@ -33,6 +34,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <config.h> #include <config.h>
@@ -51,14 +53,61 @@ const char *g15daemon_version () {
return VERSION; return VERSION;
} }
#ifdef HAVE_BACKTRACE
#include <signal.h>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#define BACKTRACE_LEN 100
_Bool segv_init = 0;
/* sighandler function to print backtrace on segfault */
void g15_sighandler(int sig) {
int i,nptrs;
void *buf[BACKTRACE_LEN];
char **btfuncs;
switch (sig) {
case SIGSEGV:
#ifdef HAVE_EXECINFO_H
fprintf(stderr, "The application (or it's libraries) caught a Segmentation Fault. Backtrace follows:\n");
nptrs = backtrace(buf,BACKTRACE_LEN);
btfuncs = backtrace_symbols(buf,nptrs);
if(btfuncs == NULL)
return;
for(i=0;i<nptrs;i++)
fprintf(stderr,"Backtrace: %s\n",btfuncs[i]);
fprintf(stderr,"End of Backtrace.\n");
free(btfuncs);
exit(1);
#endif
break;
}
}
#endif
int new_g15_screen(int screentype) int new_g15_screen(int screentype)
{ {
struct sigaction new_sigaction;
int g15screen_fd; int g15screen_fd;
struct sockaddr_in serv_addr; struct sockaddr_in serv_addr;
static int sighandler_init=0;
/* raise the priority of our packets */ /* raise the priority of our packets */
int tos = 0x6; int tos = 0x6;
char buffer[256]; char buffer[256];
if(sighandler_init==0) {
#ifdef HAVE_BACKTRACE
new_sigaction.sa_handler = g15_sighandler;
new_sigaction.sa_flags = 0;
sigaction(SIGSEGV,&new_sigaction,NULL);
#endif
sighandler_init=1;
}
g15screen_fd = socket(AF_INET, SOCK_STREAM, 0); g15screen_fd = socket(AF_INET, SOCK_STREAM, 0);
if (g15screen_fd < 0) if (g15screen_fd < 0)
@@ -177,7 +226,7 @@ int g15_recv_oob_answer(int sock) {
return packet[0]; return packet[0];
} }
int g15_send_cmd (int sock, unsigned char command, unsigned char value) unsigned long g15_send_cmd (int sock, unsigned char command, unsigned char value)
{ {
int retval; int retval;
unsigned char packet[2]; unsigned char packet[2];
@@ -217,11 +266,15 @@ int g15_send_cmd (int sock, unsigned char command, unsigned char value)
packet[0] = (unsigned char)command; packet[0] = (unsigned char)command;
retval = send( sock, packet, 1, MSG_OOB ); retval = send( sock, packet, 1, MSG_OOB );
break; break;
case G15DAEMON_NEVER_SELECT:
packet[0] = (unsigned char)command;
retval = send( sock, packet, 1, MSG_OOB );
break;
case G15DAEMON_GET_KEYSTATE:{ case G15DAEMON_GET_KEYSTATE:{
retval = 0; retval = 0;
packet[0] = (unsigned char)command; unsigned long keystate = 0;
send( sock, packet, 1, MSG_OOB ); g15_recv(sock, (char*)&keystate, sizeof(keystate));
g15_recv(sock, (char*)&retval, sizeof(retval)); return keystate;
break; break;
} }
case G15DAEMON_IS_FOREGROUND:{ case G15DAEMON_IS_FOREGROUND:{
@@ -233,12 +286,12 @@ int g15_send_cmd (int sock, unsigned char command, unsigned char value)
case G15DAEMON_IS_USER_SELECTED:{ case G15DAEMON_IS_USER_SELECTED:{
packet[0] = (unsigned char)command; packet[0] = (unsigned char)command;
send( sock, packet, 1, MSG_OOB ); send( sock, packet, 1, MSG_OOB );
retval = g15_recv_oob_answer(sock) - 48; retval = g15_recv_oob_answer(sock);
break; break;
} }
default: default:
return -1; return -1;
} }
usleep(1000);
return retval; return retval;
} }
+6 -3
View File
@@ -3,11 +3,14 @@ METASOURCES = AUTO
libdir = @G15DAEMON_PLUGIN_DIR@ libdir = @G15DAEMON_PLUGIN_DIR@
AM_CFLAGS = -Wall AM_CFLAGS = -Wall
lib_LTLIBRARIES =g15plugin_uinput.la g15plugin_tcpserver.la g15plugin_clock.la if UINPUT_INTERFACE_PLUGIN
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
g15plugin_uinput_la_LDFLAGS = -avoid-version -module g15plugin_uinput_la_LDFLAGS = -avoid-version -module
input_la = g15plugin_uinput.la
endif
lib_LTLIBRARIES = ${input_la} g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c
g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module
+505
View File
@@ -0,0 +1,505 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = plugins
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
g15plugin_clock_la_LIBADD =
am_g15plugin_clock_la_OBJECTS = g15_plugin_clock.lo
g15plugin_clock_la_OBJECTS = $(am_g15plugin_clock_la_OBJECTS)
g15plugin_clock_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_clock_la_LDFLAGS) $(LDFLAGS) -o $@
g15plugin_tcpserver_la_LIBADD =
am_g15plugin_tcpserver_la_OBJECTS = g15_plugin_net.lo
g15plugin_tcpserver_la_OBJECTS = $(am_g15plugin_tcpserver_la_OBJECTS)
g15plugin_tcpserver_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_tcpserver_la_LDFLAGS) $(LDFLAGS) -o $@
g15plugin_uinput_la_LIBADD =
am__g15plugin_uinput_la_SOURCES_DIST = g15_plugin_uinput.c
@UINPUT_INTERFACE_PLUGIN_TRUE@am_g15plugin_uinput_la_OBJECTS = \
@UINPUT_INTERFACE_PLUGIN_TRUE@ g15_plugin_uinput.lo
g15plugin_uinput_la_OBJECTS = $(am_g15plugin_uinput_la_OBJECTS)
g15plugin_uinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(g15plugin_uinput_la_LDFLAGS) $(LDFLAGS) -o $@
@UINPUT_INTERFACE_PLUGIN_TRUE@am_g15plugin_uinput_la_rpath = -rpath \
@UINPUT_INTERFACE_PLUGIN_TRUE@ $(libdir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
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 = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(g15plugin_clock_la_SOURCES) \
$(g15plugin_tcpserver_la_SOURCES) \
$(g15plugin_uinput_la_SOURCES)
DIST_SOURCES = $(g15plugin_clock_la_SOURCES) \
$(g15plugin_tcpserver_la_SOURCES) \
$(am__g15plugin_uinput_la_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
G15DAEMON_PLUGIN_DIR = @G15DAEMON_PLUGIN_DIR@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
KEXT_LOCATION = @KEXT_LOCATION@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @G15DAEMON_PLUGIN_DIR@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
METASOURCES = AUTO
AM_CFLAGS = -Wall
@UINPUT_INTERFACE_PLUGIN_TRUE@g15plugin_uinput_la_SOURCES = g15_plugin_uinput.c
@UINPUT_INTERFACE_PLUGIN_TRUE@g15plugin_uinput_la_LDFLAGS = -avoid-version -module
@UINPUT_INTERFACE_PLUGIN_TRUE@input_la = g15plugin_uinput.la
lib_LTLIBRARIES = ${input_la} g15plugin_tcpserver.la g15plugin_clock.la
INCLUDES = -I$(top_builddir)/libg15daemon_client/ -I$(top_builddir)/g15daemon
g15plugin_tcpserver_la_SOURCES = g15_plugin_net.c
g15plugin_tcpserver_la_LDFLAGS = -avoid-version -module
g15plugin_clock_la_SOURCES = g15_plugin_clock.c
g15plugin_clock_la_LDFLAGS = -avoid-version -module
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu plugins/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
g15plugin_clock.la: $(g15plugin_clock_la_OBJECTS) $(g15plugin_clock_la_DEPENDENCIES)
$(g15plugin_clock_la_LINK) -rpath $(libdir) $(g15plugin_clock_la_OBJECTS) $(g15plugin_clock_la_LIBADD) $(LIBS)
g15plugin_tcpserver.la: $(g15plugin_tcpserver_la_OBJECTS) $(g15plugin_tcpserver_la_DEPENDENCIES)
$(g15plugin_tcpserver_la_LINK) -rpath $(libdir) $(g15plugin_tcpserver_la_OBJECTS) $(g15plugin_tcpserver_la_LIBADD) $(LIBS)
g15plugin_uinput.la: $(g15plugin_uinput_la_OBJECTS) $(g15plugin_uinput_la_DEPENDENCIES)
$(g15plugin_uinput_la_LINK) $(am_g15plugin_uinput_la_rpath) $(g15plugin_uinput_la_OBJECTS) $(g15plugin_uinput_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15_plugin_clock.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15_plugin_net.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g15_plugin_uinput.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@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@ mv -f $(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
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am 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-libLTLIBRARIES 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-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+5 -5
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 290 $ - $Date: 2007-09-08 08:50:33 +0200 (Sat, 08 Sep 2007) $ $Author: mlampard $ $Revision: 391 $ - $Date: 2008-01-02 17:02:46 +1030 (Wed, 02 Jan 2008) $ $Author: mlampard $
simple Clock plugin, replace the various functions with your own, and change the g15plugin_info struct below to suit, simple Clock plugin, replace the various functions with your own, and change the g15plugin_info struct below to suit,
edit Makefile.am and compile. Add salt and pepper to taste. For a more advanced plugin that creates it's own lcd screens on-the-fly, edit Makefile.am and compile. Add salt and pepper to taste. For a more advanced plugin that creates it's own lcd screens on-the-fly,
@@ -61,7 +61,7 @@ g15canvas *static_canvas = NULL;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// calc x,y for given minute/hour/sec (pos), cut_off is for radius variations // calc x,y for given minute/hour/sec (pos), cut_off is for radius variations
// ( ie. shorter/longer clock-hands, line parts....) // ( ie. shorter/longer clock-hands, line parts....)
void get_clock_pos(int pos, int *x, int *y, int cut_off) static void get_clock_pos(int pos, int *x, int *y, int cut_off)
{ {
// pos = [0-60] // pos = [0-60]
@@ -86,7 +86,7 @@ void get_clock_pos(int pos, int *x, int *y, int cut_off)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// draw clock frame (only once, as it is stored in static_canvas) // draw clock frame (only once, as it is stored in static_canvas)
// NOTE - coords here are hardcoded ! // NOTE - coords here are hardcoded !
void draw_static_canvas(void) static void draw_static_canvas(void)
{ {
g15canvas *c = static_canvas; g15canvas *c = static_canvas;
int i; int i;
@@ -282,7 +282,7 @@ static int lcdclock(lcd_t *lcd)
ret = draw_analog(canvas); ret = draw_analog(canvas);
memcpy (lcd->buf, canvas->buffer, G15_BUFFER_LEN); memcpy (lcd->buf, canvas->buffer, G15_BUFFER_LEN);
lcd->ident = random(); g15daemon_send_refresh(lcd);
free(canvas); free(canvas);
return G15_PLUGIN_OK; return G15_PLUGIN_OK;
} }
+31 -20
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 299 $ - $Date: 2007-09-09 19:19:52 +0200 (Sun, 09 Sep 2007) $ $Author: mlampard $ $Revision: 456 $ - $Date: 2008-01-28 16:35:31 +1030 (Mon, 28 Jan 2008) $ $Author: mlampard $
This daemon listens on localhost port 15550 for client connections, This daemon listens on localhost port 15550 for client connections,
and arbitrates LCD display. Allows for multiple simultaneous clients. and arbitrates LCD display. Allows for multiple simultaneous clients.
@@ -40,8 +40,8 @@
#include <libg15.h> #include <libg15.h>
#include <g15daemon.h> #include <g15daemon.h>
static int leaving; static int leaving = 0;
int server_events(plugin_event_t *myevent); static int server_events(plugin_event_t *myevent);
#ifndef SO_PRIORITY #ifndef SO_PRIORITY
#define SO_PRIORITY 12 #define SO_PRIORITY 12
@@ -69,6 +69,12 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
g15daemon_send_event(lcdnode,G15_EVENT_REQ_PRIORITY,1); g15daemon_send_event(lcdnode,G15_EVENT_REQ_PRIORITY,1);
break; break;
} }
case CLIENT_CMD_NEVER_SELECT: { /* client can never be user-selected */
pthread_mutex_lock(&lcdlist_mutex);
lcdnode->lcd->never_select = 1;
pthread_mutex_unlock(&lcdlist_mutex);
break;
}
case CLIENT_CMD_IS_FOREGROUND: { /* client wants to know if it's currently viewable */ case CLIENT_CMD_IS_FOREGROUND: { /* client wants to know if it's currently viewable */
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
memset(msgbuf,0,2); memset(msgbuf,0,2);
@@ -83,12 +89,12 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
} }
case CLIENT_CMD_IS_USER_SELECTED: { /* client wants to know if it was set to foreground by the user */ case CLIENT_CMD_IS_USER_SELECTED: { /* client wants to know if it was set to foreground by the user */
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
if(lcdnode->lcd->usr_foreground) /* user manually selected this lcd */ if(lcdnode->lcd->usr_foreground==1) /* user manually selected this lcd */
msgbuf[0] = '1'; msgbuf[0] = 1;
else else
msgbuf[0] = '0'; msgbuf[0] = 0;
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
send(sock,msgbuf,1,0); send(sock,msgbuf,1,MSG_OOB);
break; break;
} }
default: default:
@@ -108,7 +114,8 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
} }
else if (msgbuf[0] & CLIENT_CMD_BACKLIGHT) else if (msgbuf[0] & CLIENT_CMD_BACKLIGHT)
{ {
send(sock,&lcdnode->lcd->backlight_state,1,MSG_OOB); unsigned char retval = lcdnode->lcd->backlight_state;
send(sock,&retval,1,MSG_OOB);
lcdnode->lcd->backlight_state = msgbuf[0]-0x80; lcdnode->lcd->backlight_state = msgbuf[0]-0x80;
lcdnode->lcd->state_changed = 1; lcdnode->lcd->state_changed = 1;
} }
@@ -126,7 +133,7 @@ static void process_client_cmds(lcdnode_t *lcdnode, int sock, unsigned int *msgb
} }
/* create and open a socket for listening */ /* create and open a socket for listening */
int init_sockserver(){ static int init_sockserver(){
int listening_socket; int listening_socket;
int yes=1; int yes=1;
int tos = 0x18; int tos = 0x18;
@@ -160,7 +167,7 @@ int init_sockserver(){
} }
int g15_send(int sock, char *buf, unsigned int len) static int g15_send(int sock, char *buf, unsigned int len)
{ {
int total = 0; int total = 0;
int retval = 0; int retval = 0;
@@ -190,7 +197,7 @@ int g15_send(int sock, char *buf, unsigned int len)
} }
int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len) static int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
{ {
int total = 0; int total = 0;
int retval = 0; int retval = 0;
@@ -212,7 +219,7 @@ int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
} }
process_client_cmds(lcdnode, sock, msgbuf,len); process_client_cmds(lcdnode, sock, msgbuf,len);
} }
else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL)) { else if(pfd[0].revents & POLLIN && !(pfd[0].revents & POLLERR || pfd[0].revents & POLLHUP || pfd[0].revents & POLLNVAL || pfd[0].revents & POLLPRI)) {
retval = recv(sock, buf+total, bytesleft, 0); retval = recv(sock, buf+total, bytesleft, 0);
if (retval < 1) { if (retval < 1) {
@@ -238,7 +245,7 @@ int g15_recv(lcdnode_t *lcdnode, int sock, char *buf, unsigned int len)
* once the client disconnects by closing the socket, the LCD buffer is * once the client disconnects by closing the socket, the LCD buffer is
* removed and will no longer be displayed. * removed and will no longer be displayed.
*/ */
void *lcd_client_thread(void *display) { static void *lcd_client_thread(void *display) {
lcdnode_t *g15node = display; lcdnode_t *g15node = display;
lcd_t *client_lcd = g15node->lcd; lcd_t *client_lcd = g15node->lcd;
@@ -266,7 +273,7 @@ void *lcd_client_thread(void *display) {
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
memset(client_lcd->buf,0,1024); memset(client_lcd->buf,0,1024);
g15daemon_convert_buf(client_lcd,tmpbuf); g15daemon_convert_buf(client_lcd,tmpbuf);
client_lcd->ident = random(); g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
} }
} }
@@ -278,7 +285,7 @@ void *lcd_client_thread(void *display) {
} }
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
memcpy(client_lcd->buf,tmpbuf,sizeof(client_lcd->buf)); memcpy(client_lcd->buf,tmpbuf,sizeof(client_lcd->buf));
client_lcd->ident = random(); g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
} }
} }
@@ -311,7 +318,7 @@ void *lcd_client_thread(void *display) {
pthread_mutex_lock(&lcdlist_mutex); pthread_mutex_lock(&lcdlist_mutex);
memcpy(client_lcd->buf,tmpbuf+header,buflen+header); memcpy(client_lcd->buf,tmpbuf+header,buflen+header);
client_lcd->ident = random(); g15daemon_send_refresh(client_lcd);
pthread_mutex_unlock(&lcdlist_mutex); pthread_mutex_unlock(&lcdlist_mutex);
} }
} }
@@ -326,7 +333,7 @@ exitthread:
} }
/* poll the listening socket for connections, spawning new threads as needed to handle clients */ /* poll the listening socket for connections, spawning new threads as needed to handle clients */
int g15_clientconnect (g15daemon_t **g15daemon, int listening_socket) { static int g15_clientconnect (g15daemon_t **g15daemon, int listening_socket) {
int conn_s; int conn_s;
struct pollfd pfd[1]; struct pollfd pfd[1];
@@ -399,7 +406,7 @@ static void lcdserver_thread(void *lcdlist){
} }
/* incoming events */ /* incoming events */
int server_events(plugin_event_t *event) { static int server_events(plugin_event_t *event) {
lcd_t *lcd = (lcd_t*) event->lcd; lcd_t *lcd = (lcd_t*) event->lcd;
switch (event->event) switch (event->event)
@@ -426,10 +433,14 @@ int server_events(plugin_event_t *event) {
return G15_PLUGIN_OK; return G15_PLUGIN_OK;
} }
static void g15plugin_net_exit() {
leaving = 1;
}
/* if no exitfunc or eventhandler, member should be NULL */ /* if no exitfunc or eventhandler, member should be NULL */
plugin_info_t g15plugin_info[] = { plugin_info_t g15plugin_info[] = {
/* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */ /* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */
{G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, NULL, (void*)server_events, NULL}, {G15_PLUGIN_LCD_SERVER, "LCDServer" , (void*)lcdserver_thread, 500, (void*)g15plugin_net_exit, (void*)server_events, NULL},
{G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL} {G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL}
}; };
-105
View File
@@ -1,105 +0,0 @@
/*
This file is part of g15daemon.
g15daemon 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.
g15daemon 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 g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others
$Revision: 129 $ - $Date: 2006-11-13 03:02:49 +0100 (Mon, 13 Nov 2006) $ $Author: mlampard $
simple template plugin, replace the various functions with your own, and change the g15plugin_info struct below to suit,
edit Makefile.am and compile. Add salt and pepper to taste. For a more advanced plugin that creates it's own lcd screens on-the-fly,
see the tcpserver plugin in this directory.
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <config.h>
#include <g15daemon.h>
static int *lcdclock(lcd_t *lcd)
{
unsigned int col = 0;
unsigned int len=0;
int narrows=0;
int totalwidth=0;
char buf[10];
time_t currtime = time(NULL);
memset(lcd->buf,0,1024);
memset(buf,0,10);
strftime(buf,6,"%H:%M",localtime(&currtime));
if(buf[0]==49)
narrows=1;
len = strlen(buf);
if(narrows)
totalwidth=(len*20)+(15);
else
totalwidth=len*20;
for (col=0;col<len;col++)
{
draw_bignum (lcd, (80-(totalwidth)/2)+col*20, 1,(80-(totalwidth)/2)+(col+1)*20, LCD_HEIGHT, BLACK, buf[col]);
}
lcd->ident = currtime+100;
return G15_PLUGIN_OK;
}
static int myeventhandler(plugin_event_t *myevent) {
// lcd_t *lcd = (lcd_t*) myevent->lcd;
switch (myevent->event)
{
case G15_EVENT_KEYPRESS:
printf("template plugin received keypress event : %i\n",myevent->value);
break;
case G15_EVENT_VISIBILITY_CHANGED:
printf("template received new visibility status (%i)\n",myevent->value);
break;
default:
break;
}
return G15_PLUGIN_OK;
}
/* completely uncessary function called when plugin is exiting */
static void *callmewhenimdone(lcd_t *lcd){
}
/* completely unnecessary initialisation function which could just as easily have been set to NULL in the g15plugin_info struct */
static void *myinithandler(lcd_t *lcd){
}
/* if no exitfunc or eventhandler, member should be NULL */
plugin_info_t g15plugin_info[] = {
/* TYPE, name, initfunc, updatefreq, exitfunc, eventhandler, initfunc */
{G15_PLUGIN_LCD_CLIENT, "template plugin clock", (void*)lcdclock, 500, (void*)callmewhenimdone, (void*)myeventhandler, (void*)myinithandler},
{G15_PLUGIN_NONE, "" , NULL, 0, NULL, NULL, NULL}
};
+7 -7
View File
@@ -15,9 +15,9 @@
along with g15daemon; if not, write to the Free Software along with g15daemon; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
(c) 2006 Mike Lampard, Philip Lawatsch, and others (c) 2006-2008 Mike Lampard, Philip Lawatsch, and others
$Revision: 177 $ - $Date: 2006-11-18 14:46:03 +0100 (Sat, 18 Nov 2006) $ $Author: mlampard $ $Revision: 388 $ - $Date: 2008-01-02 12:57:03 +1030 (Wed, 02 Jan 2008) $ $Author: mlampard $
UINPUT key processing plugin. receives events and sends keycodes to the linux kernel. UINPUT key processing plugin. receives events and sends keycodes to the linux kernel.
*/ */
@@ -54,7 +54,7 @@ static int map_Lkeys = 0;
#define G15KEY_DOWN 1 #define G15KEY_DOWN 1
#define G15KEY_UP 0 #define G15KEY_UP 0
int g15_init_uinput(void *plugin_args) { static int g15_init_uinput(void *plugin_args) {
int i=0; int i=0;
char *custom_filename; char *custom_filename;
@@ -115,7 +115,7 @@ void g15_exit_uinput(void *plugin_args){
} }
void g15_uinput_keydown(unsigned char code) static void g15_uinput_keydown(unsigned char code)
{ {
struct input_event event; struct input_event event;
memset(&event, 0, sizeof(event)); memset(&event, 0, sizeof(event));
@@ -127,7 +127,7 @@ void g15_uinput_keydown(unsigned char code)
write (uinp_fd, &event, sizeof(event)); write (uinp_fd, &event, sizeof(event));
} }
void g15_uinput_keyup(unsigned char code) static void g15_uinput_keyup(unsigned char code)
{ {
struct input_event event; struct input_event event;
memset(&event, 0, sizeof(event)); memset(&event, 0, sizeof(event));
@@ -147,7 +147,7 @@ void g15_uinput_keyup(unsigned char code)
#endif #endif
#endif #endif
void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys) static void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigned int lastkeys)
{ {
/* 'G' keys */ /* 'G' keys */
if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1)) if((currentkeys & G15_KEY_G1) && !(lastkeys & G15_KEY_G1))
@@ -292,7 +292,7 @@ void g15_process_keys(g15daemon_t *masterlist, unsigned int currentkeys, unsigne
} }
int keyevents(plugin_event_t *myevent) { static int keyevents(plugin_event_t *myevent) {
lcd_t *lcd = (lcd_t*) myevent->lcd; lcd_t *lcd = (lcd_t*) myevent->lcd;
static int lastkeys; static int lastkeys;
switch (myevent->event) switch (myevent->event)
+2 -4
View File
@@ -3,18 +3,16 @@
%define prefix /usr %define prefix /usr
Summary: Daemon to control logitech G15 keyboards Summary: Daemon to control logitech G15 keyboards
Name: g15daemon Name: g15daemon
Version: 1.2.5 Version: 1.9.5.3
Release: 1 Release: 1
Copyright: GPL Copyright: GPL
Group: Applications/System Group: Applications/System
Source: ftp://prdownloads.sf.net/g15daemon-1.2.5.tar.bz2 Source: ftp://prdownloads.sf.net/g15daemon-1.9.5.3.tar.bz2
URL: http://g15daemon.sf.net URL: http://g15daemon.sf.net
Distribution: Linux Distribution: Linux
Vendor: NONE Vendor: NONE
Packager: Mike Lampard <mlampard@users.sourceforge.net> Packager: Mike Lampard <mlampard@users.sourceforge.net>
Buildroot: /var/tmp/g15daemon-%{PACKAGE_VERSION}-root Buildroot: /var/tmp/g15daemon-%{PACKAGE_VERSION}-root
BuildRequires: daemon-devel
Requires: daemon
Requires: libg15 Requires: libg15
Provides: g15daemon Provides: g15daemon