pbbuttonsd-0.7.9/0000777000175000017500000000000010507757762010740 500000000000000pbbuttonsd-0.7.9/Makefile.in0000644000175000017500000003704710507757743012733 00000000000000# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CXX = @CXX@ DATADIRNAME = @DATADIRNAME@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_LIB = @HAVE_LIB@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_WPRINTF = @HAVE_WPRINTF@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LIB = @LIB@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LN_S = @LN_S@ LTLIB = @LTLIB@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ PACKAGE = @PACKAGE@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ localstatedir = @localstatedir@ SUBDIRS = intl libpbbipc pbbcmd po src EXTRA_DIST = autogen.sh BUGS pbbcmd.1 pbbuttonsd.1 pbbuttonsd.conf.5 pbbuttonsd.conf config.rpath man_MANS = pbbuttonsd.1 pbbuttonsd.conf.5 pbbcmd.1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ INSTALL Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess \ config.h.in config.sub configure configure.in install-sh missing \ mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h @if test ! -f $@; then \ rm -f stamp-h; \ $(MAKE) stamp-h; \ else :; fi stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h 2> /dev/null $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h maintainer-clean-hdr: install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(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/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(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/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man5: $(mkinstalldirs) $(DESTDIR)$(man5dir) @list='$(man5_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.5*) 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/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ done uninstall-man5: @list='$(man5_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ rm -f $(DESTDIR)$(man5dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 install-man5 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 uninstall-man5 # 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. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ 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) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && 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) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(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 -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-man install-data-local install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-man uninstall: uninstall-recursive all-am: Makefile $(MANS) config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ install-man1 uninstall-man1 install-man5 uninstall-man5 install-man \ uninstall-man install-data-recursive uninstall-data-recursive \ install-exec-recursive uninstall-exec-recursive installdirs-recursive \ uninstalldirs-recursive all-recursive check-recursive \ installcheck-recursive info-recursive dvi-recursive \ mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-local install-data-am \ install-data install-am install uninstall-am uninstall all-redirect \ all-am all installdirs-am installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean install-data-local: @$(NORMAL_INSTALL) $(INSTALL) -d $(DESTDIR)$(sysconfdir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/pbbuttons $(INSTALL) -d $(DESTDIR)$(localstatedir)/ibam $(INSTALL_DATA) --suffix=.old -b $(srcdir)/pbbuttonsd.conf $(DESTDIR)$(sysconfdir)/pbbuttonsd.conf @for dir in power power/scripts.d power/event.d; do \ $(INSTALL) -d $(DESTDIR)$(sysconfdir)/$$dir; \ src=`basename $$dir`; \ if [ $$src == $$dir ]; then src=""; fi; \ for file in $(srcdir)/scripts/$$src/*; do \ name=`basename $$file`; \ if [ "$$src" != "" ] && [ "$$src" != "scripts.d" ]; then \ $(LN_S) -f ../scripts.d/$$name $(DESTDIR)$(sysconfdir)/$$dir/$$name; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ fi; \ done; \ done; dist-hook: @for dir in scripts scripts/scripts.d scripts/event.d; do \ $(INSTALL) -d $(distdir)/$$dir; \ for file in $(srcdir)/$$dir/*; do \ if [ `basename $$file` == "laptop-mode" ]; then \ continue; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(distdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(distdir)/$$dir/; \ fi; \ done; \ done; # 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: pbbuttonsd-0.7.9/README0000644000175000017500000002567210507756527011546 00000000000000 README ====== PBButtons is a program suite to support laptop specific functions and make them available again under Linux. Basically it was developed to support the special hotkeys of an Apple iBook, Powerbook or TiBook but since version 0.5 the design has been changed to support all kind of laptop or notebook. (c) 2002-2006 Matthias Grimm IBAM is (c) 2004-2006 Sebastian Ritterbusch With this programs the keys for the display brightness, the volume of speaker and headphone, the mute key and the eject key will do their job as expected. This package contains the PBButtons server: pbbuttonsd The server work as a daemon that do all the work. It runs in background and is preferable started at boot time. Multiple clients could register themselves to get messages about events from the server. The following list shows what's done by the daemon. Advanced Power Management: - suspend the machine (configurable) if idle to save energy, - prevent the machine from entering sleep mode if CPU or Net is busy until the job is finished, - send a warning if battery is running low, - configurable emergency actions if battery is critically low, - dims the display if user is passive to save energy - suspend the machine (configurable) if cover was closed, - executes external scripts on certain power management events to allow most flexibility, - is able to replace power management daemons like pmud, apmd, etc. Support for laptop dependent hotkeys: - to adjust display brightness - to adjust keyboard illumination, - to adjust the sound volume, - to mute/unmute the sound channels, - to open/close the CDROM tray, - to trigger sleep mode. - to switch external video on/off Support for laptop dependent specialities: - initializes trackpad and keyboard mode during startup, - disables trackpad's mouse click emulation while typing on a keyboard, - keeps keyboard settings during machine suspend, - cycles through the trackpad operating modes via hotkeys, - supports PowerBook's ambient light sensor and automatic adjustment of LCD and keyboard brightness. Currently the following events cause a message broadcast to clients: - The display brightness has changed by the user, - the keyboard brightness has changed by the user, - the speaker volume has changed by the user, - the speakers has been muted/unmuted by the user, - the battery is running out of energy, - the machine is going to enter sleep mode, - the machine is going to be shut down by the daemon and - the user wants to eject a cdrom. It is up to the clients what they do with this messages. Furthermore the client/server interface was redesigned so that every current and future feature could be configured at runtime by a appropriate client. See program documentation for details. Due to the redesign of the client/server interface the versions 0.5.x isn't compatible to older versions. Older clients won't work with the new daemon. Please update also any clients you use. REQUIREMENTS ============ To use this program, you need some additional parts: 1. An laptop or notebook supported by pbbuttonsd. - Apple Powerbooks and iBooks are fully supported - Intel based laptops are supported without powermanagement and model specific features. Help with writing additional hardware modules to support more machines is always welcome. 2. Kernel support for /proc/pmu/ for battery features (only on pmac). 3. Kernel support for /dev/input/event% for input handling. This support is sufficiently implemented for Powerbooks in Kernel 2.4 (versions 2.4.18-rc2-benh or newer should be preferred). User of x86 notebooks need the full patch from Vojtech Pavlik. Kernel 2.6 should be prepared sufficiently. 4. OSS or ALSA Sounddriver, 5. GLib library 2.6 or later 6. Kernel 2.4.18-rc2-benh or later for full funcionallity. 7. Kernel 2.6.18 for sysfs backlight support INSTALLATION ============ To compile and install pbbuttonsd please see INSTALL. Pbbuttonsd can be compiled for a specific laptop model or family to support specific features. To do this the model must be specified and command line option for ./configure in the following manner: ./configure LAPTOP= Currently two models/families were supported: LAPTOP=[POWERBOOK | powerbook | pb | PB] Apple PowerBooks or iBooks, all models. LAPTOP=[I386 | i386] Generic support for Intel based laptops. Up to now support for powermanagement and specific laptop features is missing but it's also up to you to push this tool forward. Two additional features could be activated at compile time. To do this call the configure script with the option --enable-: debug: Activates additional output to console. Pbbuttonsd should not be called with -d (detach) to get full benefit of this option. The complete internal data communication between modules and the current status of the sleeplocks will be displayed. The former features 'batcycle' and 'batlog' have become runtime options They are not longer available on compile level. Please see man-pages for details. One additional module could be activated at compile time. To do this call the configure script with the option --with-: ibam: This option will enable the intelligent battery monitor that uses statistical methods to increase accuracy of battery life time predictions. See the man page for full description. This option is enanbled by default. To disable is use the --without-ibam option. oss: The OSS mixer module will be compiled in. This is the default behaviour. If you don't have OSS on your system or you don't want to use it, give --without-oss to disable the OSS mixer module. alsa: The native ALSA mixer module will be compiled in. This would be the default behaviour if the ALSA libraries were found in your system. If you don't have ALSA or you don't want to use the native ALSA mixer give --without-alsa to disable it. ALSA's OSS emulation works also with the OSS mixer modules. -- if both mixer modules were compiled in you could choose -- -- the module to be used in pbbuttonsd's configuration file -- pmud: Additional code will be integrated in Pbbuttonsd to use pmud as low level power manager. Normally PBButtons will do all necessary jobs by its own, but for special applications it could make sense to keep pmud running. In this case PBButtons must be compiled with pmud support to cooperate and don't conflict with it. Compiled with pmud support PBButtonsd uses pmud to trigger sleep mode and release cover control. If the machine went to sleep after closing the lid would be the responsibility of pmud then. -- I recommend not to use this option. Compile pbbuttonsd -- -- without pmud support. It will work better. -- BUILDING FROM CVS ================= If you got the source from the CVS repository you would need to run ./autogen.sh first to build all necessary files for compiling. To do this the autotools (autoconf and automake) and a recent gettext development package have to be installed. After autogen.sh have successfully executed the program can be compiled and installed with the usual tripple: ./configure; make; make install. DIFFERENCES TO PMUD =================== PBButtonsd could be configured to work in friendly coexistence with pmud but it is designed to fully replace it. So, if there isn't any very good reason to keep pmud running, remove it and configure PBButtonsd to do all the jobs. This is also important because pmud's development has been given up. Of course there are a lot of differences between pmud and PBButtons and please read the documentation to catch all details. At this point only those pmud options should be discussed that PBButtonsd doesn't support. - test pccard eject >> Not possible on Pismo, it seems to be that the pmu doesn't >> recognize this key, need feedback from users in this case - option to send SIGPWR whenever sleep is requested or triggered >> I don't think that it would be meaningful but pmud did it. - maybe export pmu version in environment >> I don't think it's necessary except to be 100% compatible with pmud - option to disable backlight control by pbbuttonsd >> pmud has such an option but until now nobody requested it for >> pbbuttonsd. If so it could be easily implemented. You see that some options depend on user request. If you think you need one or more of the missing options or you missed any other feature, please write an email to me. Until now I always found a way to content the users. LEGAL NOTICE ============ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. CREDITS ======= Special thanks deserve some people who supported pbbuttonsd with their own contributions: ALSA mixer module from John Steele Scott catalan translation from David Riera and Oriol Pellicer spanish translation from Rudy Godoy This program wouldn't exists if not some people wrote other programs from which I learned how special things worked. I can't name all of them so I picked those out, whose programs I could call the 'parents' of PBButtons: keyevd from Joseph P. Garcia ikeyd from Stefan Pfetzing pmud from Stephan Leemburg snooze from Paul Mackerras and Stephan Leemburg trackpad from Ben Herrenschmidt fnset from Jimi X lmud from Andreas Jaggi alcd from Federico Gamio ibam from Sebastion Ritterbusch Also thanks to all unknown developers, who make my little program possible. HOW IT WORKS ============ The daemon 'pbbuttonsd' gets its input directly from the keyboard event handler. Consequently the keys are always active. It doesn't matter if X11 is in front or if you are working on a console or which X11 window has the focus. You can always use the hotkeys and get the appropriate reaction. A lot of parameters are configurable with a configuration file. Please read the man page for details. Enjoy Matthias Grimm pbbuttonsd-0.7.9/stamp-h.in0000644000175000017500000000001210507663774012545 00000000000000timestamp pbbuttonsd-0.7.9/ABOUT-NLS0000644000175000017500000013023510002313243012053 00000000000000Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of December 2003. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files am az be bg ca cs da de el en en_GB eo es +-------------------------------------------+ a2ps | [] [] [] [] | aegis | () | ant-phone | () | anubis | | ap-utils | | bash | [] [] [] [] | batchelor | | bfd | [] [] | binutils | [] [] | bison | [] [] [] | bluez-pin | [] [] | clisp | | clisp | [] [] [] | coreutils | [] [] [] [] | cpio | [] [] [] | darkstat | [] () [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | error | [] [] [] [] [] | fetchmail | [] () [] [] [] [] | fileutils | [] [] [] | findutils | [] [] [] [] [] [] [] | flex | [] [] [] [] | fslint | | gas | [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | [] [] | gettext | [] [] [] [] [] | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] [] [] [] | gliv | | glunarclock | [] [] | gnubiff | [] | gnucash | [] () [] [] | gnucash-glossary | [] () [] | gnupg | [] () [] [] [] [] | gpe-aerial | [] | gpe-beam | [] [] | gpe-calendar | [] [] | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | () () () | gramadoir | [] | grep | [] [] [] [] [] [] | gretl | [] | gtick | () | hello | [] [] [] [] [] [] | id-utils | [] [] | indent | [] [] [] [] | jpilot | [] [] [] | jtag | | jwhois | [] | kbd | [] [] [] [] [] | latrine | () | ld | [] [] | libc | [] [] [] [] [] [] | libgpewidget | [] [] | libiconv | [] [] [] [] [] | lifelines | [] () | lilypond | [] | lingoteach | | lingoteach_lessons | () () | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] | man-db | [] () [] [] () | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] () [] [] [] | nano_1_0 | [] () [] [] [] | opcodes | [] | parted | [] [] [] [] [] | ptx | [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] [] [] | sed | [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | | sharutils | [] [] [] [] [] [] | silky | () | skencil | [] () [] | sketch | [] () [] | soundtracker | [] [] [] | sp | [] | tar | [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] | tin | () () | tuxpaint | [] [] [] [] [] [] [] | util-linux | [] [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | [] [] [] [] [] [] | xchat | [] [] [] [] | xfree86_xkb_xml | [] | xpad | [] | +-------------------------------------------+ am az be bg ca cs da de el en en_GB eo es 0 0 8 3 37 38 56 73 15 1 5 12 64 et fa fi fr ga gl he hr hu id is it ja +----------------------------------------+ a2ps | [] [] [] () | aegis | | ant-phone | | anubis | [] | ap-utils | [] | bash | [] [] | batchelor | [] | bfd | [] | binutils | [] [] | bison | [] [] [] [] | bluez-pin | [] [] [] [] [] | clisp | | clisp | [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | darkstat | () [] [] [] | diffutils | [] [] [] [] [] [] [] | e2fsprogs | | enscript | [] [] | error | [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] [] [] | flex | [] [] | fslint | | gas | [] | gawk | [] [] [] | gbiff | | gcal | [] | gcc | [] | gettext | [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] | gimp-print | [] [] | gliv | () | glunarclock | [] [] [] [] | gnubiff | | gnucash | () [] | gnucash-glossary | [] | gnupg | [] [] [] [] [] [] [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] [] [] | gpe-clock | [] | gpe-conf | [] | gpe-contacts | [] [] | gpe-edit | [] [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] [] [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] | gprof | [] [] | gpsdrive | () [] () () | gramadoir | [] | grep | [] [] [] [] [] [] [] [] [] [] [] | gretl | [] | gtick | [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] [] | indent | [] [] [] [] [] [] [] [] [] | jpilot | [] () | jtag | | jwhois | [] [] [] [] | kbd | [] | latrine | | ld | [] | libc | [] [] [] [] [] | libgpewidget | [] [] [] [] | libiconv | [] [] [] [] [] [] [] [] [] | lifelines | () | lilypond | [] | lingoteach | [] [] | lingoteach_lessons | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | | make | [] [] [] [] [] | man-db | () () | minicom | [] [] [] [] | mysecretdiary | [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] | parted | [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | [] | recode | [] [] [] [] [] [] | rpm | | screem | | scrollkeeper | [] | sed | [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] | shared-mime-info | [] | sharutils | [] [] [] [] [] | silky | [] () | skencil | [] | sketch | [] | soundtracker | [] [] [] [] | sp | [] () | tar | [] [] [] [] [] [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] [] [] | tin | [] () | tuxpaint | [] [] [] [] [] [] [] [] | util-linux | [] [] [] [] () [] | vorbis-tools | [] | wastesedge | () | wdiff | [] [] [] [] [] [] | wget | [] [] [] [] [] [] [] | xchat | [] [] [] | xfree86_xkb_xml | | xpad | [] | +----------------------------------------+ et fa fi fr ga gl he hr hu id is it ja 21 1 25 86 24 24 8 10 38 31 1 23 32 ko lg lt lv ms nb nl nn no pl pt pt_BR ro +-------------------------------------------+ a2ps | () [] [] () () [] [] | aegis | () () | ant-phone | [] [] | anubis | [] [] [] [] [] | ap-utils | [] () [] | bash | [] [] | batchelor | [] | bfd | [] | binutils | | bison | [] [] [] [] | bluez-pin | [] [] [] | clisp | | clisp | [] | coreutils | [] | cpio | [] [] [] [] [] | darkstat | [] [] [] [] | diffutils | [] [] [] [] | e2fsprogs | [] | enscript | [] [] [] | error | [] [] [] | fetchmail | [] [] () | fileutils | [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] | fslint | [] [] | gas | | gawk | [] [] [] | gbiff | [] [] | gcal | | gcc | | gettext | [] [] [] | gettext-examples | [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] [] | gimp-print | [] | gliv | [] [] [] | glunarclock | [] [] [] | gnubiff | | gnucash | [] [] () | gnucash-glossary | [] [] | gnupg | [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] | gpe-calendar | [] [] [] | gpe-clock | [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] [] | gpe-go | [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] | gpe-sketchbook | [] [] [] | gpe-su | [] [] [] | gpe-taskmanager | [] [] [] | gpe-timesheet | [] [] [] | gpe-today | [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] | gprof | [] [] | gpsdrive | () () () [] | gramadoir | [] | grep | [] [] [] [] | gretl | | gtick | [] [] | hello | [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] | indent | [] [] [] | jpilot | () () | jtag | | jwhois | [] [] [] [] | kbd | [] [] [] | latrine | [] | ld | | libc | [] [] [] [] [] | libgpewidget | [] [] [] | libiconv | [] [] [] [] | lifelines | | lilypond | | lingoteach | | lingoteach_lessons | | lynx | [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] [] | man-db | [] | minicom | [] [] [] | mysecretdiary | [] [] [] | nano | [] [] [] [] | nano_1_0 | [] [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | ptx | [] [] [] [] [] [] [] | python | | radius | [] | recode | [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] | sed | [] [] [] | sh-utils | [] | shared-mime-info | [] | sharutils | [] | silky | | skencil | [] [] | sketch | [] [] | soundtracker | | sp | | tar | [] [] [] [] [] [] | texinfo | [] [] [] | textutils | [] [] | tin | | tuxpaint | [] [] [] [] [] [] [] [] [] | util-linux | [] [] | vorbis-tools | [] [] | wastesedge | | wdiff | [] [] [] [] | wget | [] [] | xchat | [] [] | xfree86_xkb_xml | [] | xpad | [] [] | +-------------------------------------------+ ko lg lt lv ms nb nl nn no pl pt pt_BR ro 12 0 1 2 12 10 60 4 4 38 25 35 76 ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW +-------------------------------------------+ a2ps | [] [] [] [] [] | 16 aegis | () | 0 ant-phone | | 2 anubis | [] [] [] | 9 ap-utils | () | 3 bash | [] | 9 batchelor | | 2 bfd | [] [] | 6 binutils | [] [] [] | 7 bison | [] [] [] | 14 bluez-pin | [] [] [] | 13 clisp | | 0 clisp | | 5 coreutils | [] [] [] [] [] | 16 cpio | [] [] [] | 14 darkstat | [] [] [] () () | 12 diffutils | [] [] [] [] | 22 e2fsprogs | [] [] | 5 enscript | [] [] [] | 12 error | [] [] [] | 15 fetchmail | [] [] [] | 11 fileutils | [] [] [] [] [] [] | 17 findutils | [] [] [] [] [] [] [] | 29 flex | [] [] [] | 13 fslint | | 2 gas | [] | 3 gawk | [] [] | 12 gbiff | | 3 gcal | [] [] | 4 gcc | [] | 4 gettext | [] [] [] [] [] [] | 16 gettext-examples | [] [] [] [] | 11 gettext-runtime | [] [] [] [] [] [] [] [] [] | 21 gettext-tools | [] [] [] [] [] [] | 14 gimp-print | [] [] | 10 gliv | | 3 glunarclock | [] [] [] [] | 13 gnubiff | | 1 gnucash | [] [] [] | 9 gnucash-glossary | [] [] [] | 8 gnupg | [] [] [] [] | 17 gpe-aerial | [] [] | 7 gpe-beam | [] [] | 8 gpe-calendar | [] [] [] [] [] | 13 gpe-clock | [] [] [] [] | 10 gpe-conf | [] [] [] | 9 gpe-contacts | [] [] [] [] | 11 gpe-edit | [] [] [] [] [] [] | 12 gpe-go | [] | 5 gpe-login | [] [] [] [] [] [] | 13 gpe-ownerinfo | [] [] [] [] [] | 13 gpe-sketchbook | [] [] [] | 9 gpe-su | [] [] [] [] | 10 gpe-taskmanager | [] [] [] [] | 10 gpe-timesheet | [] [] [] [] [] | 12 gpe-today | [] [] [] [] [] [] | 13 gpe-todo | [] [] [] [] [] | 12 gphoto2 | [] [] [] | 11 gprof | [] [] | 9 gpsdrive | [] [] | 4 gramadoir | | 3 grep | [] [] [] [] [] | 26 gretl | | 2 gtick | [] | 5 hello | [] [] [] [] [] | 33 id-utils | [] [] [] | 12 indent | [] [] [] [] [] | 21 jpilot | [] [] [] [] [] | 9 jtag | [] | 1 jwhois | () () [] [] | 11 kbd | [] [] | 11 latrine | | 1 ld | [] [] | 5 libc | [] [] [] [] | 20 libgpewidget | [] [] [] [] | 13 libiconv | [] [] [] [] [] [] [] [] [] | 27 lifelines | [] | 2 lilypond | [] | 3 lingoteach | | 2 lingoteach_lessons | () | 0 lynx | [] [] [] [] | 14 m4 | [] [] [] | 15 mailutils | [] | 5 make | [] [] [] [] | 16 man-db | [] | 5 minicom | [] | 11 mysecretdiary | [] [] | 10 nano | [] [] [] [] [] | 17 nano_1_0 | [] [] [] [] | 17 opcodes | [] [] | 6 parted | [] [] [] | 15 ptx | [] [] [] | 22 python | | 0 radius | [] | 4 recode | [] [] [] [] | 20 rpm | [] [] [] | 7 screem | [] [] | 2 scrollkeeper | [] [] [] [] | 15 sed | [] [] [] [] [] [] | 23 sh-utils | [] [] [] | 14 shared-mime-info | [] [] | 4 sharutils | [] [] [] [] [] | 17 silky | () | 2 skencil | [] | 6 sketch | [] | 6 soundtracker | [] [] | 9 sp | [] | 3 tar | [] [] [] [] [] | 24 texinfo | [] [] [] [] | 14 textutils | [] [] [] [] [] | 16 tin | | 1 tuxpaint | [] [] [] [] [] | 29 util-linux | [] [] [] | 15 vorbis-tools | [] | 8 wastesedge | | 0 wdiff | [] [] [] [] | 18 wget | [] [] [] [] [] [] [] [] | 23 xchat | [] [] [] [] [] | 14 xfree86_xkb_xml | [] [] [] [] [] [] | 8 xpad | | 4 +-------------------------------------------+ 51 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW 120 domains 59 42 16 25 81 0 56 12 1 10 21 22 1260 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If December 2003 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. pbbuttonsd-0.7.9/AUTHORS0000644000175000017500000000014610342661544011712 00000000000000Matthias Grimm Sebastian Ritterbusch pbbuttonsd-0.7.9/COPYING0000644000000000000000000004312110447341474011646 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pbbuttonsd-0.7.9/ChangeLog0000644000175000017500000017213010507704307012415 00000000000000 CHANGELOG ========== 2006-10-01 0.7.9 (public release) * class backlight will always succeed, even if there is no backlight controller available. * PMU backlight driver checks for availibility now. 2006-09-30 0.7.8-6 * added chapter about pbbuttonsd's capabilities in man page * set debug.h back to default 2006-09-29 0.7.8-5 * ATTENTION: Configuration changed: The options LCD_FadingSpeed and KBD_FadingSpeed got a new meaning to make the configuration device independent. See man pages pbbuttonsd.conf.5 or pbbcmd.1 for details. * fix a bug in the pbbcmd man page. The decription of TAG_KBDMODE was outdated. * man pages updated. * german locale updated * TAG_SYSINFO got two new machine dependent flags: SYSINFO_PB_USB_KBD - machine has an USB keyboard SYSINFO_PB_USB_TPAD - machine has an USB trackpad This flags are only available on PowerBooks/iBooks and control certain elements in PowerPrefs. 2006-09-28 0.7.8-4 * SysFS backlight interface suported with kernel >= 2.6.18 * new class backlight: It got two low level backlight driver: sysfs and pmu with autodetection. If the Sysfs driver should be used it is recommended to compile the kernel without CONFIG_PMAC_BACKLIGHT_LEGACY to prevent interferences between ancient kernel code and the new sysfs interface. * ATTENTION: The client interface has changed: The following tags use values in percent now instead of the device dependent physical value: TAG_LCDBRIGHTNESS TAG_KBDBRIGHTNESS TAG_KBDONBRIGHTNESS The following tags are deprecated and shouldn't be used any longer: TAG_LCDBRIGHTNESSMAX TAG_KBDBRIGHTNESSMAX Clients have to be adapted to this changes. It is recommended to use new versions of GTKPbbuttons and PowerPrefs with this release. * ATTENTION: The change of the client interface has also an impact on the configuration file. According to the tags above following configuration options use percent values now: LCD_Brightness KBD_Brightness 2006-09-23 0.7.8-3 * set default status of option UseFBBlank to 'no' because it might collide with the backlight controll in recent kernels the man page pbbuttonsd.conf was updated accordingly. * rewind input handler change from 2006-07-30 because the code doesn't do the trick. 2006-09-06 0.7.8-2 * disabling optional packages often didn't unbound all dependencies. For example after disabling IBAM pbbuttonsd will still be compiled with libstdc++ even if it is not needed any longer. The compile scripts have been modified to handle this cleanly. Thanks to Luca Barbato for his patch. * configure.in cleaned up 2006-09-05 0.7.8-1 * laptopmode script parses fstab correctly now, even if it contains tabs instead of spaces. Thanks to S. Lockwood-Childs who found this patch in the gentoo bugtracker. * fix warnings reported by -Wextra 2006-07-31 0.7.8 (public release) 2006-07-30 0.7.7-1 * adding input handler for /dev/input/mice to work around the problem with synaptics trackpad driver. * fixing problem with unstable autoconf package 2006-07-29 0.7.7 (public release) 2006-07-28 0.7.6-4 * code cleanups 2006-07-22 0.7.6-3 * I2C address of LMU Controller is dynamically read from OF device-tree * The I2C device the LMU controller is connected to is retrieved with sysfs. Therefore kernel 2.6 is needed and the i2c-dev kernel module must be loaded for this to work. * remove some warnings from the code 2006-07-21 0.7.6-2 * machine identification improved. Any PowerBook or iBook model will be precisely identified. * machine identification is read now from /proc/device-tree/model instead of /proc/cpuinfo. * got rid of i2c-dev.h. Only I2C_SLAVE was used. This value is now defined in module_pmac.h 2006-07-16 0.7.6-1 * division by zero error fixed in power_read_cpu(). Thanks to René Nussbaumer . 2006-07-02 0.7.6 (public release) * increase KBD_BRIGHTNESS_MIN from 1 to 16 in respect of the new scale. Man page changed accordingly. 2006-06-30 0.7.5-6 * the static 10ms timer has been removed. The timer function will be dynamically created whenever it is needed and only for the time it is needed. This will permanently decrease context switches independent of configuration. * Despite of runing on bash only the script 'autogen.sh' referenced '/bin/sh' - fixed. * change keyboard illumination to use 255 brightness steps during fading. keyboard up/down still uses 16 steps. Thanks to Paul Collins . 2006-06-17 0.7.5-5 * moved low priority request functions in module_pmac.c like read battery status, read AC status and read Cover status into an one second timer routine. (debian bug #372760) * increase poll interval of IPC messages from 10ms to 100ms * module_display will only register a 10ms task if fading (LCD or KBD) is configured (fadingspeed > 0). Otherwise it will register a 100ms task. * The 10ms queue will terminate itself if it was found empty. This will decrease the count of context switches. (debian bug #372760) 2006-05-20 0.7.5-4 * Powerbooks before Pismo still weren't detected correctly because the field 'machine' from /proc/cpuinfo was used. This was changed to 'motherboard' and now it works. 2006-05-17 0.7.5-3 * bug in alsamixer caused a segfault - fixed. Reported to ubuntu. Thanks to John Steele Scott , who reported it to me :-) 2006-05-14 0.7.5-2 * bug in machine detection routine. PowerBooks before Pismo weren't detected correctly - fixed. * fix some warnings in module_pmac.c: keyboard_getconfig(), keyboard_setconfig() * added some debug code to track pbbuttonsd communication with the PMU in /var/log/pbbuttonsd. Set PMUTALK in debug.h to activate 2006-04-26 0.7.5-1 * PowerBook 6,7 has a USB Trackpad which was not correctly reported by pbbuttonsd - fixed. 2006-04-02 0.7.5 (public release) * default value for LCD_FadingSpeed in config file changed from 5 to 4 to make fading smoother. 2006-03-23 0.7.4-2 * SIMUABIENT code was broken - fixed * added sync() before calling any suspend mode. (debian bug #357595) * allow the user to dim the display until it's dark (brightness level zero) even if autoadjusting is active. The former minimum level was one. (debian bug #345314) 2006-03-20 0.7.4-1 * the vendor and product identifier from USB devices are not unique so that selecting input devices based on product/vendor will miss some devices. The code has been changed to use the device identifier instead. 2006-01-27 0.7.4 (public release) 2006-01-22 0.7.3-7g * fixed two minor bugs in module_pmac.c regarding USB keyboard configuration - Thanks to Michael Hanselmann 2006-01-21 0.7.3-6g (public beta) * added keyboard configuration of PowerBook USB keyboard. Needs kernel 2.6.16 or later. 2006-01-17 0.7.3-5g (public beta) * some small fixes regarding LMU * add Alluminum PowerBook to identity string 2006-01-16 0.7.3-4g * add support for ambient sensor and keyboard illumination connected to the PMU. Thanks to René Nussbaumer and Michael Hanselmann for their code. 2006-01-08 0.7.3-3g * add test for glib into configure.in * pbbuttonsd mainloop ported to glib mainloop * rewrite input source handling to fit into glib mainloop * rewrite signal handling to fit into glib main loop 2006-01-05 0.7.3.2 * bugfix in apm-compat script 2006-01-03 0.7.3-1 * new tag added: TAG_CHARGETIME this tag would deliver the time until the batteries are fully recharged, if IBaM support was compiled in. 2005-12-23 0.7.3 (public release) * compile with ibam by default * man page updated, typo's corrected 2005-12-18 0.7.2-10 * removed bug in module_pmac.c that would trigger sleep again immediately after wake-up under certain circumstances. Thanks to Stefan Bruda for reporting this problem. 2005-12-13 0.7.2-9 * install script creates data directory for IBaM * man pages revised 2005-12-05 0.7.2-8 * typo's in man-paged fixed 2005-12-02 0.7.3beta1 (public beta) * small data type fixes in IBAM code * man-page updated 2005-12-01 0.7.2-7 * libpbbipc: API of check_permissions() extended by required permissions * incomplete error handling in copy_path() - fixed * ibam stub won't create IBAM object at startup. Module_powersave will initialize it by calling ibam_init() * IBAM: object constructor gets the data path as argument now. The file operations regarding the data path have been removed. * IBAM: internal define VERSION renamed to IBAM_VERSION because the former name collide with autotools * IBAM: internal define DEBUG renamed to IBAM_DEBUG to be able to control IBAM debugging through pbbuttons debugging mechanisms * new configuration option 'IBAM_DataDir' added * new TAG_IBAMDATADIR added * IBAM: locale settings removed so that data files become locale sensitive. * default value for CmdTimeout increased from 4 to 8 seconds * apm-compat script: Fix arguments on calling apm scripts on resume. * man pages updated * default of option 'autorescan' changed to 'yes' in config file 2005-11-28 0.7.2-6 * documentation and man-page updated with IBAM 2005-11-18 0.7.2-5 * added SYSINFO flag for IBAM 2005-11-17 0.7.2-4 * spell error in conditional compile expression - fixed * timeremaining could be uninitialized after startup which leads to immediately entering sleep mode - fixed 2005-11-16 0.7.2-3 * move TAG_TIMEREMAINING to module_powersave if compiled with IBAM support * add some more #ifdef for IBAM in module_pmac.c 2005-11-15 0.7.2-2 * IBAM: Time = 0 must not be filtered out. 2005-11-13 0.7.2-1 * IBAM integrated in module_poversave.c. Support must be enabled at compile time with --with-ibam * sync display brightness with external after wakeup. Some user reported that the display was at minimum brightness after wakeup. 2005-10-04 0.7.2 (public release) 2005-10-01 0.7.1-7 * new action 'shutdown' completed, scripts modified accordingly * CFLAGS filter removed from configure.in and Makefile.am. Thanks to Frank Lichtenheld for his report * runlevel check in module_powersave added. Pbbuttonsd will not suspend the machine if a shutdown or reboot is in progress (runlevel 0 or 6). Thanks to Kristian Benoit for his patch. * source cleanup in module_powersave.h 2005-09-13 0.7.1-6 * implementation of new action "shutdown" started. 2005-09-06 0.7.1-5 * Code reorganized to prevent the left mouse button key event from breaking 'NoTapTyping' but reset the dim or sleep timer. * power source change during the cover is closed will follow the configured power profile (onX_CoverAction) now. (debian bug #306482) 2005-09-04 0.7.1-4 * memory leaks fixed in module_alsamixer: snd_mixer_free() replaced by snd_mixer_close(). * add command HIBERNATE to pbbuttonsd and pbbcmd. This applies a patch ubuntu maintainers have sent to debian. (debian bug #329369) * man pages updated. 2005-09-01 0.7.1-3 * module_mixer would return an error if the configured sound system couldn't be initialized. Now the sound system will be disabled but the daemon won't abort anymore. (debian bug #325309 and #321631) 2005-08-27 0.7.1-2 * module_cdrom: getmountpoint() terminates the wrong buffer - fixed * module_cdrom: Still problems with relative links - fixed. Thanks to Johannes Berg for his report and patch. * module_alsamixer: non-allocated memory freed - fixed * valgrind memcheck: - uninitialized ioctl parameter in scanEventDevices() - fixed - source and destination string of strncpy() might have overlapped under certain circumstances - fixed. - complains about some issues in libasound.so.2.0.0. Can't do anything about this :-(. - memory leak in module_alsamixer. snd_mixer_detach() wasn't called - fixed. 2005-08-09 0.7.1-1 * Check also device class to find trackpad device to prevent conflict with appletouch USB driver. Thanks to Luca Bigliardi for the patch. * Absolute position events will reset sleep and dim timer of powermanagement module now. This is needed to support the appletouch USB trackpad driver. 2005-07-18 0.7.1 (public release) 2005-07-17 0.7.0-4 * If the sound card supported more than 100 volume levels, the new volume fine tuning would not work - fixed 2005-07-15 0.7.0-3 * change volume control: volume up/down change volume always by 10% (hardware independent), shift + volume up/down change volume by 1 step (hardware dependent). 2005-07-11 0.7.0-2 * module_cdrom can't find the mountpoint if the link to the device is a relative link - fixed. * readlink buffer not correctly terminated - fixed. 2005-07-10 0.7.0-1 * event scripts redefine PATH which makes trouble with the definition in the PMCS master script. PATH definitions removed. 2005-07-10 0.7.0 (public release) 2005-07-04 0.7.0beta2-2 * catalan catalog updated. Thanks to Oriol Pellicer * added mouseemu comment to NoTapTyping option in pbbuttonsd.conf.5 man page 2005-07-03 0.7.0beta2-1 * volume of alsamixer can't be set correctly with TAG_VOLUME - fixed Thanks to Elimar Riesebieter for his report. 2005-07-01 0.7.0beta2 (public bets) * check for ADB keyboard and trackpad added. Configuration of the trackpad and/or keyboard is now restricted to PowerBooks which have an ADB trackpad and/or ADB keyboard. * Trackpad tap will be disabled at first key press and enabled again at first mouse movement. No changes inbetween. This reduces ADB messages significantly. * spanish language file updated. Thanks to Rudy Godoy * pbbcmd man page updated 2005-06-26 0.7.0beta1 (public beta) * reorganize debugging code in module_cdrom * add some comments to module_cdrom's functions * reorganize debugging code in module_pmac * add some comments to module_pmac * pbbcmd: pseudo 'cmd' removed. * pbbcmd: missing parameter checks added. * german translation file updated * pbbcmd man page updated 2005-06-24 0.6.10-7 * support for pbbuttonsd commands added to pbbcmd * pbbcmd now can print a list of clients * man pages updated * default for NoTapTyping set to 'no' due to freeze problems on some machines. 2005-06-23 0.6.10-6 * alsamixer unmute didn't work - fixed * alsamixer code cleanup * some comments in module_pmac updated 2005-06-21 0.6.10-5 * buffer overflow in input handler management. buffer functions will handle completely filled buffers correctly. Furthermore the maximun count of input devices has been increased. 2005-06-19 0.6.10-4 * the mountpoint is found in both directions now. For example: dev_cdrom = /dev/cdrom /dev/cdrom is a link to /dev/hdc /dev/hdc is mounted or dev_cdrom = /dev/hdc /dev/cdrom is a link to /dev/hdc /dev/cdrom is mounted 2005-06-18 0.6.10-3 * If the configured CDROM device is a link to another device and the CDROM is mounted trough this other device, pbbuttonsd couldn't eject the CDROM. This is fixed now because both devices are checked. * typo's in german language file corrected, thanks to Jens Seidel for his patch. 2005-06-17 0.6.10-2 * FBIOBLANK argument changed to highest vesa mode. New framebuffers support different modes with different impact on power consumption. 2005-06-10 0.6.10-1 * error in if statement in display module. It will never become true - fixed. * If user requested ACTION_BLANK on cover close this request would be sent twice - fixed. 2005-05-26 0.6.10 (public release) 2005-05-23 0.6.9-5 (public beta) * some code and documentation cleanup 2005-05-21 0.6.9-4 * filter BTN_LEFT as key event because it breaks 'NoTapTyping'. Problem with trackpad fixed. 2005-05-20 0.6.9-3 (public beta) * Tags TAG_MOUSEBUTTONS and TAG_MOUSEWHEEL removed * scan_for_kdbdevs() replaced by scanEventDevices() which will scan for all event devices, not only for keyboards. * New event input handler replacing the special input handlers for mouse and keyboard. * input handler return an error code now. If the input handler belong to an event device, this device will be disabled and scanEventDevices () is called. If the input handler belong to any other source, the daemon will quit due to a FATAL error. * evdev kernel module is no longer loaded if missing. The system must be set up accordingly before starting the daemon. 2005-04-27 0.6.9-2 * a pseudo keycode will be emitted if an power button interrupt is received. This is important for new aluminum powerbooks until the kernel supports the power button natively. 2005-04-13 0.6.9-1 * some error messages in module_alsamixer added * E_NOSUPPORT won't exit the program anymore 2005-04-06 0.6.9 (public release) 2005-04-05 0.6.8-3 * explain keycodes in man-page. This closed debian bug #280211 2005-04-04 0.6.8-2 * pmcs script bdflush logs a message if an external laptop-mode script is active. * errors during program initialisation didn't lead to program abortion - fixed * error messages uses more syslog levels for reporting (LOG_ERR, LOG_WARNING and LOG_INFO) instead of using only LOG_ERR. * Even if started as daemon error messages will be printed to stderr as long as the parent process recognises them. Warnings and info messages will be redirected into syslog as soon as the \'-d\' is detected in the command line arguments. This closes debian bug #188317 * language files updated 2005-04-01 0.6.8-1 * TAG_CLIENTPID added. The server recorded the client pid for internal use. Recommendation: Recompile all clients. * trackpad configurations has been downgraded from secure to normal function. * trackpad reconfiguration takes also place now when a key is constantly pressed (key repeatition function) * trackpad disable time decreased to 600 ms again. * script bdflush updated so that it look for a global laptop- mode script first before using the private one. This script is depreciated now and might be removed in future releases including the local copy of laptopmode.sh. This closes debian bug #290766 * a native pbbuttonsd script for laptop-mode-tools has been sent to the package maintainer of laptop-mode-tools. It will enter pbbuttonsd's CVS but never become part of a distribution package. * added current directory to PATH in pmcs-pbbuttonsd to make it work with other shells than bash too. Thanks to Jörg Sommer for his patch. This closes debian bug #295178. 2005-03-24 0.6.8 (public release) * keyboard scanner tested for EV_REP but some new button devices haven't this flag set and therefore aren't detected. To exclude pointing devices the keyboard scanner tests now for EV_KEY && !EV_REL to detect keyboards. 2005-03-22 0.6.7-9 * client list extended with name and flags. If a client wants to register it must provide a name and optional additional flags. ! Please pay attention to the changed ipc_init() interface. ! ! Clients linked with an old libpbb will work as usual but ! ! you should move to the extended interface with your next ! ! release. Future extensions will depend on the extra data. ! * libpbb IPC: servertags evaluation moved behind taglist processing. This has the advantage that strings in taglists provided with server action like register and unregister clients would be correctly relocated. * trackpad enable (notap) time increased to 0.8 seconds * registerflags CLIENT_EXCLUSIVE and CLIENT_REPLACEMENT added. With CLIENT_EXCLUSIVE only one client instance is allowed. Additional registrations will be rejected. With CLIENT_REPLACEMENT only one client instance is allowed too, but this time the existing instance will be closed and replaced by the new one. 2005-03-21 0.6.7-8 * list code moved to libpbb * static client array replaced by dynamic client list. Client count isn't limited anymore. * documentation updated 2005-03-20 0.6.7-7 * returned channels from ossmixer were filtered by supported channels which leads to wrong channels if the mixer module is not active. Solution: Mixer will always return user setting now even the mixer doesn't support the named channels. * automatic mixer detection fail if only one or no mixer module is compiled in - fixed * language files updated 2005-03-19 0.6.8beta1 (public beta) 2005-03-17 0.6.7-6 * improved error reporting in various modules * error in open functions of alsamixer and ossmixer - fixed * Following depreciated tags have been removed and won't be supported any longer: TAG_ONACPOLICY, TAG_ONACSLEEP, TAG_ONACCOVERSLEEP, TAG_ONACTIMESLEEP, TAG_ONACTIMEDIM, TAG_ONBATTERYPOLICY, TAG_ONBATTERYSLEEP, TAG_ONACDIM, TAG_ONBATTERYCOVERSLEEP, TAG_ONBATTERYTIMESLEEP, TAG_ONBATTERYTIMEDIM, TAG_ONBATTERYTIMEHDOFF, TAG_ONBATTERYDIM, TAG_ONBATTERYBLANK, TAG_ONACTIMEHDOFF, TAG_ONACBLANK, TAG_SCRIPTBATCRITICAL, TAG_SCRIPTPROFCHANGED, TAG_SCRIPTHDSETUP, ! If you use this tags in your program please change ! ! it and use the appropriate replacement tags. ! * added soundsystem autodetection code 2005-03-16 0.6.7-5 * all modules adapted to the config manager. Old configfile mechanism removed. * obsolete configuration file options removed. Old configuration files can't be used anymore. * new configuration options for ALSA and OSS specific options. ! Please update your configuration file to the new options. ! ! Some OSS related options have been renamed. ! * changed module initialization sequence: init - open - configure. * the mixer modules keep module specific configration options even the module is not active. This removes a bug from the BUGS file. * error reporting of module_cdrom improved * new command line option --quiet to suppress the welcome message * made trackpad reconfiguration while typing configurable. The tag TAG_NOTAPTYPING controls this feature. 2005-03-13 0.6.7-4 * introduce new config manager as replacement for configfile * dynamic handling of configuration options. Options will be registered by the modules now. 2005-03-06 0.6.7-3 * LMU device detection code returns wrong device number if it is below 4 - fixed. Thanks to Mark Ferry * trackpad reconfigured to 'notap' while typing (feature request from debian powerpc mailinglist). Mode will be restored 0.6 seconds after last key stroke. Function is not configurable yet. * trackpad mode has been lost after sleep - fixed 2005-02-05 0.6.7-2 * file descriptor leak in module_display - fixed. Thanks to Andreas Schwab for his patch. 2005-02-03 0.6.7a (bugfix release) 2005-02-02 0.6.7-1 * saveconfig command causes segfault - fixed * exitcode of alsamixer module causes segfault - fixed * module peep causes segfault in debug mode - fixed * module_mixer added as base for specialized OSS and ALSA mixer modules 2005-01-25 0.6.7 (public release) 2005-01-21 0.6.6-8 * alsamixer module revised. Thanks to John Steele Scott. * new tag TAG_MIXERCARD and configuration option MixerCard to support the alsamixer module * man-pages updated 2005-01-02 0.6.6-7 * seqfault in pbbcmd if string information was queried - fixed * if the display was dimmed and the first key pressed was the brightness up/down key the brightness level wouldn't recover correctly - fixed. 2004-12-12 0.6.6-6 * add soundsystem flags to TAG_SYSINFO * added query for the currently active soundsystem * added tag TAG_SOUNDSYSTEM to query active soundsystem * added tag TAG_SOUNDSYSTEMCFG to configure soundsystem. This configuration becomes active only after saving the configuration and restarting the server. 2004-12-10 0.6.6-5 * module_display checks current level of LCD brightness now before modifying it and keeps it synchron. This compensate brightness changes from other tools than pbbuttonsd. 2004-11-28 0.6.6-4 * function print_error in libpbb become UTF-8 safe. Error texts will be converted to local charset before printing to terminal or to logfile. Iconv must be available for this to work. * new spanish translation, thanks to Rudy Godoy 2004-11-25 0.6.6-3 * added m3mirror functionallity for ATI Rage128 and Radeon cards. It will support all cards the frambuffer supports. a new keycode was added to the display module to switch the external display on/off. 2004-11-21 0.6.6-2 * improved configure script: checks for ALSA now and prints a configuration summary at the end * add new configuration option 'SoundSystem' to set the used mixer at runtime * updated configuration man-page 2004-11-17 0.6.6-1 * updated debian directory in pbbuttonsd's repository * some quotings corrected discovered by debian maintainer Frank Lichtenheld. 2004-11-04 0.6.6 (public release) 2004-10-25 0.6.5-4 * Powerbook G3 lombard's PMU doesn't report the AC power flag in environment flags. Program changed to use /proc instead. 2004-09-24 0.6.5-3 * start LMU device detection now with /dev/i2c-4 to avoid errornous detection of device /dev/i2c-0. The devices 0 to 3 will be tested last. 2004-09-23 0.6.5-2 * separate getting power source from reading battery info. pmac_update_flags() falls automatically back to /proc/pmu/info if the pmu driver reports an error via ioctl. 2004-09-20 0.6.5-1 * fix bug in pmac_timer. cover and power source weren't updated correctly after sleep. 2004-09-10 0.6.5 (public release) 2004-09-09 0.6.4-6 * without backlight controller the bahaviour of the display module changed as follows: - LCD brightness only changes between 0 and MAX - clients will always get -1 as LCD brightness level This change recommends installation af latest clients - the framebuffer would be switched off before suspend-to-RAM if configured accordingly (mostly doesn't work) - display dimming, if activated, will switch the display off, if UseFBBlank=yes. (ATTENTION: Backlight might keep alit, check carefully before using display dimming this way) ATTENTION: Read file BUGS for more details. 2004-09-08 0.6.4-5 * The function getting the backlight level from the hardware checks now for errors. The new return value -1 indicates that no backlight controller is available. * documentation fine tuning * script setupenv.sh removed from distribution 2004-09-06 0.6.4-4 * extend module_cdrom.c to support closing the tray if open. Thanks to Alan Carvalho for his patch. * send message to clients if the CDROM tray will be closed. 2004-08-29 0.6.4-3 * PMCS-scripts modified to cope with the third argument * update documentation 2004-08-28 0.6.4-2 * add TAG_TAG_ONAC_POLICY, TAG_ONAC_TIMERACTION, TAG_ONAC_COVERACTION, TAG_ONAC_KEYACTION, TAG_ONAC_TIMESUSPEND, TAG_ONAC_TIMEDIM, TAG_ONBATT_POLICY, TAG_ONBATT_TIMERACTION, TAG_ONBATT_COVERACTION, TAG_ONBATT_KEYACTION, TAG_ONBATT_TIMESUSPEND and TAG_ONBATT_TIMEDIM This tags now support suspend-to-disk. * mark TAG_ONACSLEEP, TAG_ONACDIM, TAG_ONACTIMESLEEP, TAG_ONACTIMEDIM, TAG_ONACCOVERSLEEP, TAG_ONACPOLICY, TAG_ONBATTERYSLEEP, TAG_ONBATTERYDIM, TAG_ONBATTERYTIMESLEEP, TAG_ONBATTERYTIMEDIM, TAG_ONBATTERYCOVERSLEEP, TAG_ONBATTERYPOLICY and TAG_SLEEPKEYSLEEP as depreciated. Don't use them in your code. Use the replacements instead. * handle new tags in configfile.c, pbbcmd.c and module_peep.c * update man-page pbbcmd.1 * handle new tags in module_powersave.c * cover-scripts will only be called if no other script is going to be called. * on cover close the screen will always be blanked before the action set by the user is executed. * scripts calls for 'suspend' and 'resume' got a third parameter 'ram' or 'disk' * pbbuttonsd man-page and configuration file updated 2004-08-27 0.6.4-1 * new tag TAG_BATTERYPRESENT which reports which battery is present independently from /proc/pmu, which is not reliable under certain circumstances. * fixed command string for PCMCIA card command * extend PMCS Script from two to three arguments * PMCS script 'suspend' and 'resume' got 'ram' as third argument * PMCS script 'cover-open' got 'open' as third argument * PMCS script 'cover-close' got 'close' as third argument * code cleanup in module_peep.c 2004-08-22 0.6.4 (public release) 2004-08-08 0.6.3-6 * added function pmac_get_lcdbrightness(). Minor restructuring of module_pmac.c 2004-08-07 0.6.3-5 * keyboard illumination behaviour in conjunction with on/off key changed. If not in autoadjustment mode an initial brightness could now be defined with TAG_KBDONBRIGHTNESS. Thanks to Rodolfo Giometti for his patch. 2004-08-06 0.6.3-4 * new Tags TAG_BATLOG and TAG_BATCYCLE added. This control battery data logging during runtime. The compile time options --with-batlog and --with-batcycle have been removed. (closes debian bug #262544) Attention: The meaning of the Tags are not exactly the same as the compile time options. Read the man-page for details. 2004-08-03 0.6.3-3 * pbbcmd: added version to help text * pbbcmd: removed private tags from help list * pbbcmd: added parameter 'i' to force pbbcmd not to wait for servers answer after sending config commands. * pbbcmd: man-page updated * pbbcmd: decrease timeout time from 10 to 4 seconds 2004-07-30 0.6.3-2 * improved test for running deamon implemented. It detects now dead message ports and removes them at startup. With this Pbbuttonsd is able to cope with kill -9 wihout users help. 2004-07 29 0.6.3-1 * ac status in /proc/pmu/info is not reliable if no battery is pluged in. So from now on pbbuttons asks the PMU directly. 2004-07-22 0.6.3a (public release) * add script tags 'cover-open' and 'cover-close' * two spelling mistakes corrected in pbbuttonsd.conf * one spelling mistake corrected in configfile.c 2004-07-19 0.6.3 (public release) * fix a type in script bdflush 2004-07-17 0.6.2-4 * exit commands removed from scripts so that the exit codes of the subscripts survive. * The script child set his own process group so that it and all it's child could easily be terminated on error or timeout. * change the supervising code to send the SIGKILL not only to the pmcs-script child but to all childs of the same process group. Unfortunately this will only work in full with a patched run-parts version where all parts share the same process id. Debians run-parts creates a new process id with each running part so that this processes will remain in memory on error or timeout. A bug-report has been filed to debian. 2004-07-16 0.6.2-3 * some calls of open() especially in module_ossmixer didn't accept 0 as valid file handler. Due to this the mixer device may remain open after usage. After a suspend event the ALSA scrips stop all processes that uses sound devices including pbbuttonsd. This bug was fixed now. * module_powersave uses depreciated tags - cleaned up * old config options removed from configfile.c * launch_program() did't check for fork() and waitpid() error codes. A fork() failure might caused weird system reactions - fixed. * call_script() translates new error codes in human readable text. * the PMCS script 'bdflush' will only work for kernel 2.4. It was replaced by a more general one that now calls 'laptop_mode.sh' from the kernel tree. 2004-07-01 0.6.2-2 (version lost) 2004-06-30 0.6.2-1 (version lost) 2004-06-21 0.6.2 (public release) 2004-06-19 0.6.1-1 * Automatic keyboard brightness adjustment work against manual control due to bug in keyboard handler - fixed. * keyboard illumination can't be switched off completly. Copy & paste error from LCD code - fixed * Toggle keyboard illumination on/off increased the level by one each time. Collision with autoadjustment code - distangled. * added keycodes für special keyboard illumination keys from the kernel patch from Andreas Jaggi. 2004-05-26 0.6.1 (public release) * cleanup modules could be skipped if signal handler setting failed - fixed * obsolete function detach_process() removed from libpbbipc. * bug in daemonize and ipc code of libpbbipc fixed. This bug could block message queue cleanup if an error occured during program initialization. Altough the daemon isn't running, this leads to the error message "pbbuttonsd already running, only one instance allowed". 2004-05-22 0.6.0-3 * /proc/cpufreq interface for kernel 2.4 missing in scripts.d/cpufreq - added. Thanks to Wolfgang Pfeifer * errornous address CPU #1 in scripts.d/cpufreq - fixed Thanks to Wolfgang Pfeifer * use /bin/sh in scripts instead of /bin/bash * get rid of wall, shutdown message will be sent by shutdown now. 2004-05-19 0.6.0-2 * Blanking the screen comming from dimmed display causes the original brightness value to be lost (debian bug #249782)- fixed. 2004-05-12 0.6.0-1 * scripts/config renamed in scripts/pmcs-config. * type in man page fixed (debian bug #249285) 2004-05-08 0.6.0 (public release) * New Script system introduced. Debian bug #249501 solved. 2004-04-29 0.5.11-6 * call PMCS script to set power policy after wakeup if power source has changed. * call PMCS script to set power policy after TAG_REINIT. * script PMac_G3 not longer necessary with 2.4 and 2.6 kernels - removed 2004-04-26 0.5.11-5 * directories in scripts renamed: active->event.d and storage->scripts.d. * some arguments of the pmcs script renamed: sleep->suspend and wakeup->resume. All scripts modified accordingly. * script apmd_compat added. Thanks to Guido Guenther . * added support for additional directories suspend.d and resume.d if existing. 2004-04-23 0.5.11-4 * man-pages updated * obsolete code fragments removed * TAG_REINIT added to restore hardware setting for example lost due to suspend to disc. This action could also triggered with SIGUSR1. * code cleanup in install_sighandler() * code cleanup in pbbuttonsd.c * changed script config variables to policy dependent names. 2004-04-21 0.5.11-3 * add TAG_ONACPOLICY and TAG_ONBATTERYPOLICY * add onAC_policy and onBattery_policy to configfile * make options with discrete arguments like tpmode, emergencyaction etc more robust against invalid values. * code cleanup in configfile.c * replace some #defines against enum{} in module_pmac.h and module_powersave.h. This simplifies code and improve error robustness. * added TAG_BRIGHTNESS again for compatibility reasons. Please be aware that this tag is DEPRECIATED and will be removed in future. Use TAG_LCDBRIGHTNESS instead. * add TAG_POLICY to set the current power policy. * TAG_SCRIPTHDSETUP, TAG_ONACHDTOFF and TAG_ONBATTERYHDTOFF removed. Hard disc setup will be done in pmcs script now. * TAG_SCRIPTBATCRITICAL removed. This job is also done by pmcs script now (first argument=emergency). * TAG_SCRIPTPROFCHANGED renamed in TAG_SCRIPTPMCS. * changed all script calls of script_profchanged, script_hdsetup and script_batcritical to script_pmcs. * pmcs-* scripts need a 'cd' to the target directory because all paths in the scripts are relative paths. * add example script named skeleton * describe script parameters in a README instead of inside each script header. * german translations updated * script path in pbbuttonsd.conf will now be adjusted by the configure script. 2004-04-20 0.5.11-2 * added missing variable for xgettext and fixed a bug in POTFILES.in * change main Makefile.am to handle new structure in scripts/ * introduce new pbbuttonsd script system * setting Tdim=0 will disable display dimming now. Therefore TAG_ONACDIM, TAG_ONBATTERYDIM and its corresponding config options onAC_dim and onBattery_dim were useless and have been removed. * setting Tsleep=0 will disable sleep when idle now. This feature is new. * The command GOTOSLEEP will always trigger sleep now, if possible. If sleep was not supported by the hardware the screen will be blanked instead. No configuration possible. * use sig_atomic_t datatype now instead of int for global variables used by the signal handler. 2004-04-19 0.5.11-1 * development version with special debugging output. 2004-04-18 0.5.11 (public release) 2004-04-17 0.5.10-4 * module_powersave.c: TAG_POWERCHANGED called power_awake to reset the sleeptime counter. This has bad side effects so that the sleeptime counter is reseted directly in power_handle_tags(). As result the mode (dim or sleep) will not change on switching the power source. * module_powersave.c: Keeps track of cover status now and disables keyboard and mouse input if cover is closed. This was a problem with external mice and keyboards in conjunction with screen blanking on sleep request (debian bug #249783). * module_display.c: Keeps track of cover status now and disables keyboard input if cover is closed. * libpbbipc: cleanup_buffer() handles quoting incorrectly - fixed. 2004-04-16 0.5.10-3 * added catalan catalog file. Thanks to David Riera and Oriol Pellicer 2004-04-06 0.5.10-2 * added support for DESTDIR in make files. Thanke to Giulivo Navigante 2004-04-05 0.5.10-1 * not initialized variable flags.status in module_display - fixed. * eject CDROM uses the mountpoint now instead of the device. This leads to less trouble ejecting mounted CDs. Thanks to Soeren Sonnenburg 2004-03-31 0.5.10 (public release) 2004-03-30 0.5.9-5 * added compile time switch --enable-batcycle which enables counting of battery cycles only. To additionally write the battery data use --enable-batlog. * configure doesn't create debian/Makefile anymore * libpbbipc was needlessly build with -DBATLOG - fixed * update man page * write configfile to /etc now. All the link stuff has been removed. 2004-03-25 0.5.9-4 * increase interval for ambient update timer in display module to 1 second. * option HeartbeatBeep set to 'no' by default. Make the man page explain this feature more clearly. This feature confuses the users. 2004-03-24 0.5.9-3 * remove debian directory from distribution package * fix bug in display module: Shift+brightness key doesn't work if LCD automatic adjustment is enabled 2004-03-13 0.5.9-2 * fix bug in libpbb: set_timeforcmd() accepted negative timeout values. Now values <= 0 will be converted to 1. * pbbuttonsd.conf man page updated. 2004-03-07 0.5.9-1 * check for include file initreq.h added in configure.in * module_powersave.c changed to compile with/without initreq.h Thanks to Nigel Horne for the hint. * module_pmac.c calculates feedback from LCD backlight to ambient light sensors and returns a compensated value now. * fix cosmetic bug in module_display.c on i386 machines. Thanks to Nigel Horne for reporting. * debug system modified to allow better control of debug output. 2004-03-04 0.5.9 (public release) * man-pages updated * pbbcmd and module_peep.c updated * added pwrctl-wrapper script to support debian apm scripts 2004-02-25 0.5.8-12 * add tags for automatic adjustment range. One for running on battery, one for running on AC. 2004-02-22 0.5.8-11 * change timing of client message from module_cdrom to get a more convenient behaviour. * German translations updated * man-pages updated * added some flags to Sysinfo tag: pmud support, sleep support 2004-02-21 0.5.8.10 * moved write configfile stuff to module_system. * added new info tag TAG_SYSINFO which holds a set of current server options. 2004-02-20 0.5.8-9 * bugfix in module_display.c regarding ambient light management. Thanks to Federico Gamio * initialize keyboard illumination at startup (switch it off). 2004-02-19 0.5.8-8 * tag AMBIENTTHRESHOLD renamed to KBDTHRESHOLD and the new tag LCDTHRESHOLD added. Configfile updated to reflect this * changed ambient light algorithm to that one used in lmud * removed kernel i2c include files and replaced them with that one from lmsensors. 2004-02-17 0.5.8-7 * module_pmac.c: lmu_get_ambient() changed to cope better with shadows and spot lights on one of the ambient light sensors. 2004-02-10 0.5.8-6 * README updated * german translations updated * debug messages cleanup 2004-02-09 0.5.8-5 * pbbcmd and pbbuttonsd.conf man-page updated * cdrom module now looks into /proc/mounts to check if the cdrom device is mounted or not. * cdrom module sends now the tag TAG_EJECTCD to clients on every eject CD event. The argument tells the client about the success of the eject process. * new tag TAG_TIMEFORCMD added for adjusting the timeout of scripts and helper programs. Tag also added in pbbcmd and module_peep.c * pbblib updated: The exit code of the last launched program can be read with the function get_lastrc() now. 2004-02-08 0.5.8-4 * restructured configuration options for display module * beautify saved config file * default config file updated * configuration man-page updated * scale of the ambient sensor changed to percent. * eject CD event sends now a signal to all clients. This signal is also sent, if eject has failed due to umount(). This will be fixed in the future. * with configure option --with-pmud the linker can't find pmac_cover_position() - fixed. * modified equations for automatically calculated brightness levels so that the user keeps in control. An offset shifts the characteristic curve according users will. 2004-02-07 0.5.8-3 * bug in scan_kbddevices() fixed. keyboards are correctly unregistered now. * support generic i386 laptops without laptop dependent features. Call ./configure LAPTOP=i386 to activate. * module_display.c reworked to fully support keyboard illumination and the ambient light sensor on aluminum PowerBooks. * some tags related to the display module renamed and some added. most of them regarding the hotkey definitions. see pbbtags.h for complete list. * module_peep.c and pbbcmd updated to support the new and the renamed tags. * some options of the config file added and some renamed to match the changes in module_display.c 2004-01-31 0.5.8-2 * modules_display.c updated. LCD Brightness will be adjusted automatically and keyboard illumination change smoothly. Thanks to Andreas Jaggi for his patch. 2004-01-23 0.5.8-1 * implemented some functions to access lmu (i2c device for the keyboard illumination and the ambient light sensors of new aluminium PowerBooks. Thanks for code fragments from Andreas Jaggi and Alexander Clausen. 2004-01-18 0.5.8 (public release) 2004-01-17 0.5.7-4 * check for root added in module loader code in input_manager.c. * autogen.sh modified to cope with gettext 0.11.3 and above and also with its predecessors. First update had problems. * Add new option 'HeartbeatBeep' in module powersave.c. Configfile and man-page updated. * New option also added to pbbcmd. * moved to gettext 0.13.1 2004-01-08 0.5.7-3 * added code to input_manager.c to load the kernel module evdev if necessary. Thanks to Wolfram Quester for the patch. * updated german language file 2003-12-29 0.5.7-2 * configure.in and /po changed to work also if GNU gettext version >0.11.3 is installed. New version of autogen.sh 2003-12-27 0.5.7-1 * After wake up with closed cover the machine didn't go to sleep again - fixed. This happens for example when USB devices are connected/disconnected during sleep. 2003-12-19 0.5.7 (public release) 2003-12-11 0.5.6-4 * libmisc.c uses C++ keywords that causes a compile conflict with C++ compilers - fixed. 2003-12-05 0.5.6-3 * the new options onXX_coversleep weren't read from configfile - fixed * timeout for scripts was to short - extended to four seconds. * scan_for_kbdevdevs() did't close all file handles - fixed. 2003-11-17 0.5.6-2 * module_pmac.c reads flags from /proc/pmu/battery_% as decimal instead of hexadecimal. This could lead to wrong charging detection - fixed. 2003-11-13 0.5.6-1 * configure flag --with-pmud added to decide at compile time to use pmud or not. * option 'replace_pmud' removed. pmud support have to compiled in now. Default is compiling without pmud support. 2003-11-12 0.5.6 (public release) 2003-11-09 0.5.5-7 * moved foreign code from inputhandler.c to new module_system.c * man pages updated * german language files updated 2003-11-08 0.5.5-6 * Added filter reset in module_pmac to prevent erroneous battery warning due to transient oscillation of the filtered time remaining. * added function to unregister inputhandler again. * extend keyboard event device scanning so that it becomes able to scan the devices to get changes. * connect scan of event devices to the HUP signal. * add option for enabling automatic scan every 5 seconds. 2003-11-04 0.5.5-5 * warnlevel 0 wasn't send if woke up with recharged battery - fixed. * add error message E_NOSUPPORT for requested but not supported functions. module_peep.c and pbbcmd updated. * setting EMA_SLEEP with no sleep support will cause an error message now. * TAG_DIMFULLYDARK in module_display added. * module_powersave: screen off instead of sleep didn't work correctly because a broken keyboard handler - fixed. * TAG_ONACCOVERSLEEP and TAG_ONBATTERYCOVERSLEEP added to make behaviour after cover closed independently configurable. * TAG_ONACBLANK and TAG_ONBATTERYBLANK removed. * play a beep every 30 seconds when the screen is dark so the user knows the machine is still alive. * allow sleepkey also if sleep is not supported (display will be switched off in this case). 2003-11-01 0.5.5-4 * update battery status and warnlevel in module poversave after wakeup. * Send battery warnlevel 0 to clients after we had a warnlevel greater than zero and the AC connector was plugged in. 2003-10-31 0.5.5-3 * insert 1s delay between sending 'going to sleep' signal and entering sleep mode to give clients enough time to process the signal. This delay only occur at sleep requests coming from the sleepkey. 2003-10-30 0.5.5-2 * New option 'FadingSpeed' and new Tag TAG_FADINGSPEED added for module_display. * added 10ms timer callback for module_display. * brightness could be faded up and down smoothly now. the timer callback is in control for that. 2003-10-29 0.5.5-1 * collect all keyboard event devices now not only the internal keyboard and the button device. * openeventdev() removed * moved open event devices to inputhandler.c * MAXINPUTS increased from 4 to 8 2003-10-06 0.5.5 (public release) * fix ipc_exit() to handle parent and child correctly 2003-10-02 0.5.4d * unused include file pbblib.h removed * artefacts from init.c removed * added optional pidfile argument for command line switch '-d' * ordered help text a little bit * rewrite the daemonize code. A welcome message will always be printed to console now and additionally written to the log file if running as daemon. * the pid of the daemon will be written to /var/run/. * updated debian startscript for server. 2003-10-01 0.5.4c * added two functions in libpbb: find_tagitem() and taglist_count() * update key & modifier functions in configfile.c * empty filename will be accepted now. Empty names for devices and symlinks are still not allowed. * implemented support for ejecting a CDROM. The external program 'eject' isn't necessary anymore. * trap empty script names in call_script() in support.c 2003-09-24 0.5.4b * processing the configuration at startup launches some empty scripts - fixed * launching the power changed script at startup broken - fixed. * got rid of system() call, replaced by more secure launch_program() in pbb_misc.c. * ordered some mess with fixed buffer length * use geteuid() for security checks instead of getuid() * remove TAG_SLEEPINSECONDS from pbbcmd.c 2003-09-23 0.5.4a * power profile did not change after changing powersource during sleep. Thanks to Stephan Helma * fix for Makefile.am. Thanks to Stephan Helma * preparations to handle more than Apple Laptops * strcmp_nocase() in pbb_misc.c replaced by strcasecmp() in libc. code cleanup in pbbcmd and pbbuttonsd. 2003-09-13 0.5.4 (public release) * some internationalizing in module_peep * package pbbcmd integrated in pbbuttonsd. Pbbcmd makes no sense as independent package. * config.h missing in some sourcefiles - fixed * problems with translating comment for configfile - fixed 2003-09-10 0.5.3g * after awake from sleep some data in module_poversave wasn't immediately updated. It operates up to 100ms with old data. This could have caused different strange behaviour like shutdown or sleep immediately after the machine has awaken or shutdown after last disentangled warning even though the AC connector has been plugged in recently (debian bug #183614) - fixed. * script arguments for SCRIPT_PROFCHANGED changed: the arguments 'ac' and 'battery' were replaced by 'profile'. A second argument containing the powersource was added. * TAG_TIMEREMAINING and TAG_POWERSOURCE disentangled, because config and query operations with this tags were done by two different modules, which causes responsibility problems. To keep compatibility to existing clients, the tag values weren't changed. But this have to be done in an later restructuring of the interfaces. 2003-09-09 0.5.3f * mark TAG_BRIGHTNESSOP and TAG_COVERSTATUS as private * some code cleanup in display module(5 to go) * some code cleanup in input manager (4 to go) * some code cleanup in module ossmixer (3 to go) * some code cleanup in module cdrom (2 to go) * some code cleanup in module pmac(1 to go) * some code cleanup in module poversave ( done ) * preventing TAG_TIMEREMAINING from sending if AC power is connected. In conjunction with changing default low battery emergency behaviour the 'laptop halted' problem (debian bug #183614) should be solved. 2003-09-08 0.5.3e * empty strings in configfile causes segfault - fixed. * typo in framebuffer device default setting - fixed * configfile could be saved now (/var/lib/pbbuttons/). 2003-09-07 0.5.3d * some code restructuring in input manager. moved some code from pbbuttonsd.c to input_manager.c to make custom input managers possible. * moved the timer code from pbbuttonsd.c to input_manager.c * some general code cleanup * work around for kernel problem: booting without batteries connected in module_pmac.c#pmac_update_batteryinfo() implemented. 2003-09-06 0.5.3c * bug in warning level calculation makes it impossible to step a warninglevel up again - fixed. * powerwait and powerokwait implemented. SIGPWR to the init process works. * IPC signals routed through the module_peep for debugging This is only active if compiled with DEBUG. * TAG_IDENTITY added. The identity string is printed to console at pbbuttonsd startup. * The profile-changed-script and HDSetup-script will now be started at pbbuttonsd startup to do initial settings. * removed default settings for script_batcritical. Default emergency behaviour is now sleep. No shutdown anymore unless it's explicit configured. * scripts were now checked for permissions and owner to improve security. 2003-09-05 0.5.3b * TAG_ONBATTERYCRITICALSLEEP removed and replaced by TAG_EMERGENCYACTION with four commands: EMA_SLEEP, EMA_SIGNAL and EMA_COMMAND. * Signal to INIT process integrated. It uses first the new method via /dev/initctl and second if that failed the old method via /etc/powerstatus. * Module_peep writes a battery profile in /var/lib/pbbuttons/xxx_battery.log. This is only active if compiled with DEBUG. 2003-09-04 0.5.3a * ToDo List updated * Changed to new Version of autoconf/automake. The header acconfig.h was removed 2003-04-13 0.5.3a * The CDROM device could be missing now. The check at startup has been adjusted. 2003-03-16 0.5.3 * sleepkeydelay works again * sleepkeydelay and ejectcdkeydelay changed to use time periods in milliseconds instead of counting repeating keys. (debian bug #164882). * typo in option EjectCDKeyDelay in configfile - fixed (debian bug #184323) * option MixerChannels added to control which channels should be controlled by the volume keys (debian bug #176000). * pbbuttonsd failed if the mixer device didn't exist even if mixer_delayed was set. This problem occurred with devfs. Now, if mixer_delayed was set, a missing mixer device wouldn't cause an error messages or hinder pbbuttonsd to startup (debian bug #182218). * EjectCDKey in default config file set again to 161. This is the correct value for iBooks. * option 'userallowed' added to imrove security of the ipc-interface (debian bug #164881). First step done. maybe further steps will follow. 2002-12-22 0.5.2b * config file option 'replace_pmud' did nothing, fixed. 2002-10-13 0.5.2a * new include file pbbinput.h to add brightness keys to make compiling with older kernels possible. 2002-10-03 0.5.2 * documentation updated * catalogs updated 2002-08-24 0.5.1a * code changed to use the new library libpbb * code cleanup regarding error messages * TAG_SLEEPINSECONDS was mistakenly marked as private -> fixed * Sleepmessages were sent to clients even though the machine doesn't support sleep mode -> fixed 2002-07-22 0.5.0p * powersave: changed 10ms functions to 100ms interval 10ms timer removed * effect of sleeplocks reorganised, priority reduced * display: added framebuffer blank and the Tags * TAG_FRAMEBUFFERDEVICE and TAG_BLANKFRAMEBUFFER to control this function. 2002-07-10 0.5.0p * implemented sleeplocks for cpuload and netload 2002-07-07 0.5.0p * implement new improved error management for Tags * the exitcode gives detailed information about the malfunction. 2002-07-05 0.5.0p * security improvement: scripts are only changeable by the effective process owner of pbbuttonsd. 2002-07-03 0.5.0p * pmac: fixed cover status and OHARE button level evaluation. 2002-07-02 0.5.0p * powersave: script for profile change implemented * powersave: script for HD setup implemented * powersave, pmac: TAG_PREPAREFORSLEEP and TAG_WAKEUPFROMSLEEP added * peep: TAG_PREPAREFORSLEEP, TAG_WAKEUPFROMSLEEP, TAG_SCRIPT_PROFCHANGED and TAG_SCRIPT_HDSETUP added 2002-06-30 0.5.0p * module test renamed to peep and bound to compile option DEBUG. * added TAG_SKIP to list in module_peep. 2002-06-25 0.5.0p * main loop changed. return code <0 from select() won't abort the program anymore. Signal handling is done instead. * SIGHUP implemented. * config table in read_configfile() set to static due to a segfault on receiving SIGHUP. * added filter for internal private tags in IPC-receive() 2002-05-06 0.5.0p * start of pbbuttonsd restructuring. 2002-05-05 0.4.9 * new IPC commands to support new PowerPrefs features 2002-05-01 0.4.8p * added check if sleep is supported * added option 'blank_screen' as alternative to sleep * cleanup sleep code 2002-04-28 0.4.8p * added feature to save the configuration via PowerPrefs * mouse input was ignored if started with sleep disabled and would be enabled later on. * added italian translation file, Thanks to Gioele Barabucci 2002-04-20 0.4.8 * public release 2002-04-17 0.4.7p * fixed a bad behaviour with manually set backlight level of zero. * fixed another problem in battery status routines and warning level calculation. 2002-04-14 0.4.7p * fixed a bug in time remaining calculation with more than one battery. Implemented an work-around for a kernel problem. Thanks to Michael G Schwern 2002-04-09 0.4.7 * another bugfix in calculation of battery warnlevels thanks to Vincent Katz * warning added if kernel doesn't support /proc/pmu * configfile will now be read from sysconfdir defined by ./configure rather than hard-coded from /etc * Makefile adapted to adjustable config file location thanks to Uwe Steinmann and to Ralf Ertzinger 2002-04-07 0.4.7 * added commands to get and set trackpad, keyboard and pbbuttonsd configuration. Preparation for new client PowerPrefs. 2002-04-03 0.4.6 * bugfix in calculation of battery warnlevels 2002-03-31 0.4.5 * swaped the configuration from command line to a configuration file. * tpmode and snooze keys are now configurable * the delay of the snooze key could be disabled now 2002-03-24 0.4.5 * some code cleanup in event.c * Test added in do_delayed_jobs() if user released any keys before perform trackpad configuration or trigger sleep mode. 2002-03-23 0.4.5 * If battery is critically low, the machine will be shut down. * The keyboard settings are now kept during sleep (only Powerbooks G3/G4 that support this) * The trackpad mode could now be toogled with alt+brightnesskeys (up/down). * with alt+mute the sleep mode could be triggered (delayed key, press 3-4 seconds). * problem with delayed keys fixed 2002-03-17 0.4.4 * If the machine is idle first the display will be dimmed and after some additional idle time it will go to sleep * add command line switch '-n (nosleep)' to disable the dim/sleep feature on user demand. 2002-03-15 0.4.3 * add the command line switch '-e' which causes that the eject key has to be constantly pressed for 3-4 seconds to react. * put some flags into an bitfield. 2002-03-08 0.4.3 * program returns now positive error codes * if started as daemon, error messages would be redirected to SYSLOG * pbbuttonsd reads battery states now from /proc/pmu. this should work on every supported machine. 2002-03-07 0.4.2a * fixed a problem with the exit code. * fixed serious bug that caused a segfault when the program exited (Thanks to Geof) 2002-03-06 0.4.2 * The server was put to a separate package. * removed package name from package data directory * adapt some texts to the new package name * update the documentation * open mixer device only if needed. Calculate hardware independent volume values by myself. ------------------------------------------------------------------------ 2002-03-03 * Server calculates battery warnlevels and sends alarm messages to clients. * little sequencing problem with detach option in client and server fixed. * Client displays battery warnings now. * Client got the option to play a sound during volume adjustment or play alarm sound at battery warnings. 2002-02-28 0.4.1 * Server sends exit-message to clients, when it exits. * Client exited, if it receives the exit-message. * Server polls the pmu and collects data about the cover, the states of the batteries, the volume and brightness buttons and pmu version. Pollcycle was reduced from 100ms to 10ms. 2002-02-26 0.4 * package divided into client and server. The server could run as root and the client could run as user. The communication is done via SystemV IPC messages. * low level IPC functions were exported to a static library. * the directory structure was reorganized * newly created and updated man pages for client and server 2002-02-22 0.3.3 * mixer code reworked to fix some problems with newer PowerMac sound hardware, especially iBook2 and new TiBooks. * changed lockfile name to a more conventional one. * backlight control adapted to new kernel features. Since 2.4.18-rc2-benh the PPC branch of the kernel allow backlight control trough user space programs. In this context the default keycodes for brightness control changed to new kernel defined values. Thanks to Ben Herrenschmidt 2002-02-21 0.3.2 * changed mixer code for verification trough beta testers. 2002-02-20 0.3.1 * added new comand line switch 'd --detach', so PBButtons could be started now as background process. * running PBButtons as daemon causes high CPU time consuming - fixed. Thanks to Uwe Steinmann . * PBButtons now would use alternative PMU and Mixer devices, if specified. exchanged hard wired device names with dynamic ones. * fixed some problems, if compiled with optimization switched on. 2002-02-18 0.3 * added I18N support with GNU gettext * added setup-script to check and setup used devices and directories with suitable user permissions. 2002-02-16 0.2.1 * PBButtons works now with ALSA 0.9.x via OSS emulation. The mixer device must not to be closed after each adjustment. If so the ALSA OSS-emu mixer would forget the device independent volume levels. The mixer device will now be kept open while the program is running. 2002-02-14 0.2 * program take care about multiply instances. * defined exit procedure via sighandlers. * improved error handling. * general code cleanup * work with ALSA stable (0.5.x) via OSS emulation * devices, keycodes and lockfile are now configurable via comand line 2002-02-06 0.1 * inital release pbbuttonsd-0.7.9/INSTALL0000644000000000000000000001722710447341475011655 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. pbbuttonsd-0.7.9/Makefile.am0000644000175000017500000000277210347631421012701 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = intl libpbbipc pbbcmd po src EXTRA_DIST = autogen.sh BUGS pbbcmd.1 pbbuttonsd.1 pbbuttonsd.conf.5 pbbuttonsd.conf config.rpath man_MANS = pbbuttonsd.1 pbbuttonsd.conf.5 pbbcmd.1 install-data-local: @$(NORMAL_INSTALL) $(INSTALL) -d $(DESTDIR)$(sysconfdir) $(INSTALL) -d $(DESTDIR)$(localstatedir)/pbbuttons $(INSTALL) -d $(DESTDIR)$(localstatedir)/ibam $(INSTALL_DATA) --suffix=.old -b $(srcdir)/pbbuttonsd.conf $(DESTDIR)$(sysconfdir)/pbbuttonsd.conf @for dir in power power/scripts.d power/event.d; do \ $(INSTALL) -d $(DESTDIR)$(sysconfdir)/$$dir; \ src=`basename $$dir`; \ if [ $$src == $$dir ]; then src=""; fi; \ for file in $(srcdir)/scripts/$$src/*; do \ name=`basename $$file`; \ if [ "$$src" != "" ] && [ "$$src" != "scripts.d" ]; then \ $(LN_S) -f ../scripts.d/$$name $(DESTDIR)$(sysconfdir)/$$dir/$$name; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(DESTDIR)$(sysconfdir)/$$dir/; \ fi; \ done; \ done; dist-hook: @for dir in scripts scripts/scripts.d scripts/event.d; do \ $(INSTALL) -d $(distdir)/$$dir; \ for file in $(srcdir)/$$dir/*; do \ if [ `basename $$file` == "laptop-mode" ]; then \ continue; \ elif test -x $$file; then \ $(INSTALL_SCRIPT) $$file $(distdir)/$$dir/; \ elif test -f $$file; then \ $(INSTALL_DATA) $$file $(distdir)/$$dir/; \ fi; \ done; \ done; pbbuttonsd-0.7.9/NEWS0000644000175000017500000000000007442620652011330 00000000000000pbbuttonsd-0.7.9/TODO0000644000175000017500000000124310507201534011321 00000000000000 TODO ==== - some modules still missing for other architectures and laptop models - change libpbbipc so that clients could survive an daemon's exit and resyncronize after the daemon have reappeared. - move pbbuttonsd more towards kernel 2.6: - use hotplug or HAL to get informed about new input devices - IBaM data currently uses angloamerican locale by chance. This must be implemented more reliable. - make IPC interface asynchron so that messages could be processed while pbbuttonsd is waiting for an external process. - build a 1. pmu and OF lib 2. sysfs lib - change module_mixer to class_mixer with the appropriate drivers Good ideas are always welcome. pbbuttonsd-0.7.9/aclocal.m40000644000175000017500000035071610507656446012525 00000000000000dnl aclocal.m4 generated automatically by aclocal 1.4-p6 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # lib-prefix.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) # lib-link.m4 serial 6 (gettext-0.14.3) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.50) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) # lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # Copyright 2002 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., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.4-p6])]) # # Check to make sure that the build environment is sane. # AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN([AM_MISSING_PROG], [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN([AM_CONFIG_HEADER], [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT($USE_MAINTAINER_MODE) AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_SUBST($1_TRUE) AC_SUBST($1_FALSE) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) # isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) # serial 1 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac AC_DEFUN([AM_PROG_CC_STDC], [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require dnl a magic option to avoid problems with ANSI preprocessor commands dnl like #elif. dnl FIXME: can't do this because then AC_AIX won't work due to a dnl circular dependency. dnl AC_BEFORE([$0], [AC_PROG_CPP]) AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) AC_CACHE_VAL(am_cv_prog_cc_stdc, [am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; ], [ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC" ]) if test -z "$am_cv_prog_cc_stdc"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT($am_cv_prog_cc_stdc) fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela dnl Last modification: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. dnl enables arguments --with-alsa-prefix= dnl --with-alsa-enc-prefix= dnl --disable-alsatest dnl dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. dnl AC_DEFUN([AM_PATH_ALSA], [dnl Save the original CFLAGS, LDFLAGS, and LIBS alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes dnl dnl Get the cflags and libraries for alsa dnl AC_ARG_WITH(alsa-prefix, [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], [alsa_prefix="$withval"], [alsa_prefix=""]) AC_ARG_WITH(alsa-inc-prefix, [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) dnl FIXME: this is not yet implemented AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], [enable_alsatest="$enableval"], [enable_alsatest=yes]) dnl Add any special include directories AC_MSG_CHECKING(for ALSA CFLAGS) if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi AC_MSG_RESULT($ALSA_CFLAGS) CFLAGS="$alsa_save_CFLAGS" dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi dnl add the alsa library ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) dnl Check for a working version of libasound that is of the right version. min_alsa_version=ifelse([$1], ,0.1.1,$1) AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include ], [ /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) alsa_found=no] ) AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. if test "x$enable_alsatest" = "xyes"; then AC_CHECK_LIB([asound], [snd_ctl_open],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) alsa_found=no] ) fi LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) else ALSA_CFLAGS="" ALSA_LIBS="" ifelse([$3], , :, [$3]) fi dnl That should be it. Now just export out symbols: AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) ]) # gettext.m4 serial 37 (gettext-0.14.4) dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then gt_LC_MESSAGES fi if test -n "$INTL_MACOSX_LIBS"; then CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) # po.m4 serial 7 (gettext-0.14.3) dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) # progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) # glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) # signed.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) fi ]) # longlong.m4 serial 5 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG if 'long long' works. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, [AC_TRY_LINK([long long ll = 1LL; int i = 63;], [long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll;], ac_cv_type_long_long=yes, ac_cv_type_long_long=no)]) if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) # longdouble.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) # wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) # wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) # inttypes_h.m4 serial 6 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # stdint_h.m4 serial 5 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) # intmax.m4 serial 2 (gettext-0.14.2) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) # printf-posix.m4 serial 2 (gettext-0.13.1) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the printf() function supports POSIX/XSI format strings with dnl positions. AC_DEFUN([gt_PRINTF_POSIX], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], gt_cv_func_printf_posix, [ AC_TRY_RUN([ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) # glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) # intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) # uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) # ulonglong.m4 serial 4 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) # inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) # inttypes-pri.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gt_HEADER_INTTYPES_H]) if test $gt_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) # xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) # size_max.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) result= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], result=yes) if test -z "$result"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', dnl which is guaranteed to work from LONG_MIN to LONG_MAX. _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, [#include ], result=?) _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, [#include ], result=?) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], result=?) if test "$fits_in_uint" = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi if test -z "$result"; then if test "$fits_in_uint" = 1; then result="$res_hi$res_lo"U else result="$res_hi$res_lo"UL fi else dnl Shouldn't happen, but who knows... result='~(size_t)0' fi fi AC_MSG_RESULT([$result]) if test "$result" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) # codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) # lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) pbbuttonsd-0.7.9/config.guess0000755000000000000000000012626010466646770013151 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pbbuttonsd-0.7.9/config.h.in0000644000175000017500000002221710477316427012676 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED /* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FGETS_UNLOCKED /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETC_UNLOCKED /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF /* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNWPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fwprintf' function. */ #undef HAVE_FWPRINTF /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INITREQ_H /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define if exists and doesn't clash with . */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the `asound' library (-lasound). */ #undef HAVE_LIBASOUND /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define if you have the 'long double' type. */ #undef HAVE_LONG_DOUBLE /* Define if you have the 'long long' type. */ #undef HAVE_LONG_LONG /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the header file. */ #undef HAVE_NL_TYPES_H /* Define if your printf() function supports format strings with positions. */ #undef HAVE_POSIX_PRINTF /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define if you have the 'uintmax_t' type in or . */ #undef HAVE_UINTMAX_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the 'unsigned long long' type. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if you have the `__argz_count' function. */ #undef HAVE___ARGZ_COUNT /* Define to 1 if you have the `__argz_next' function. */ #undef HAVE___ARGZ_NEXT /* Define to 1 if you have the `__argz_stringify' function. */ #undef HAVE___ARGZ_STRINGIFY /* Define to 1 if you have the `__fsetlocking' function. */ #undef HAVE___FSETLOCKING /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if integer division by zero raises signal SIGFPE. */ #undef INTDIV0_RAISES_SIGFPE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* place for data files */ #undef PACKAGE_DATA_DIR /* target dir for package */ #undef PACKAGE_LOCALE_DIR /* 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 if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* place for configuration files */ #undef SYS_CONF_DIR /* machine to build the package for */ #undef SYS_I386_ACPI /* machine to build the package for */ #undef SYS_I386_GENERIC /* machine to build the package for */ #undef SYS_POWERBOOK /* Version number of package */ #undef VERSION /* enable ALSA support */ #undef WITH_ALSA /* enable IBAM support */ #undef WITH_IBAM /* enable OSS support */ #undef WITH_OSS /* use pmud as basement */ #undef WITH_PMUD /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long' if does not define. */ #undef off_t /* Define as the type of the result of subtracting two pointers, if the system doesn't define it. */ #undef ptrdiff_t /* Define to empty if the C compiler doesn't support this keyword. */ #undef signed /* Define to `unsigned' if does not define. */ #undef size_t /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t pbbuttonsd-0.7.9/config.sub0000755000000000000000000007730010466646770012614 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pbbuttonsd-0.7.9/configure0000755000175000017500000140054610507656470012567 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="configure.in" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX AWK LN_S RANLIB ac_ct_RANLIB PKG_CONFIG ac_pt_PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS ALSA_CFLAGS ALSA_LIBS DEBUG_TRUE DEBUG_FALSE PB_OBJECTS PB_LIBS CPP EGREP MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os GLIBC2 ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_env_PKG_CONFIG_value=$PKG_CONFIG ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG ac_env_PACKAGE_CFLAGS_set=${PACKAGE_CFLAGS+set} ac_env_PACKAGE_CFLAGS_value=$PACKAGE_CFLAGS ac_cv_env_PACKAGE_CFLAGS_set=${PACKAGE_CFLAGS+set} ac_cv_env_PACKAGE_CFLAGS_value=$PACKAGE_CFLAGS ac_env_PACKAGE_LIBS_set=${PACKAGE_LIBS+set} ac_env_PACKAGE_LIBS_value=$PACKAGE_LIBS ac_cv_env_PACKAGE_LIBS_set=${PACKAGE_LIBS+set} ac_cv_env_PACKAGE_LIBS_value=$PACKAGE_LIBS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-alsatest Do not try to compile and run a test Alsa program --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pmud use pmud as low level power manager (default=no) --with-oss enable OSS support in pbbuttonsd (default=yes) --with-alsa enable ALSA support in pbbuttonsd (default=yes) --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) --with-ibam enable IBAM support in pbbuttonsd (default=yes) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-included-gettext use the GNU gettext library included here --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility PACKAGE_CFLAGS C compiler flags for PACKAGE, overriding pkg-config PACKAGE_LIBS linker flags for PACKAGE, overriding pkg-config CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.4" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftestfile ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=pbbuttonsd VERSION=0.7.9 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF missing_dir=`cd $ac_aux_dir && pwd` echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5 echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal-${am__api_version} echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working autoconf" >&5 echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5 echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake-${am__api_version} echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOMAKE="$missing_dir/missing automake-${am__api_version}" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working autoheader" >&5 echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi echo "$as_me:$LINENO: checking for working makeinfo" >&5 echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$as_me:$LINENO: result: missing" >&5 echo "${ECHO_T}missing" >&6 fi ac_config_headers="$ac_config_headers config.h" ac_config_commands="$ac_config_commands default-1" echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cposix_strerror=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 if test $ac_cv_lib_cposix_strerror = yes; then LIBS="$LIBS -lcposix" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5 echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${am_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_prog_cc_stdc="$ac_arg"; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done CC="$ac_save_CC" fi if test -z "$am_cv_prog_cc_stdc"; then echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 else echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$am_cv_prog_cc_stdc" >&6 fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi localstatedir="/var/lib" echo -n "checking for system: " ac_laptop=powerbook if test "x$laptop" != "x"; then ac_laptop=$laptop elif test "x$LAPTOP" != "x"; then ac_laptop=$LAPTOP fi case "$ac_laptop" in POWERBOOK | powerbook | pb | PB ) cat >>confdefs.h <<_ACEOF #define SYS_POWERBOOK "" _ACEOF ac_laptop="Apple PowerBook" ;; I386ACPI | i386acpi | acpi | ACPI ) cat >>confdefs.h <<_ACEOF #define SYS_I386_ACPI "" _ACEOF ac_laptop="Intel based laptop with ACPI" ;; I386 | i386) cat >>confdefs.h <<_ACEOF #define SYS_I386_GENERIC "" _ACEOF ac_laptop="Intel based laptop" ;; *) echo -e "\nOption 'laptop' not set or unknown. Please call 'configure laptop='" echo "Possible targets are: powerbook" { { echo "$as_me:$LINENO: error: unknown target system" >&5 echo "$as_me: error: unknown target system" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$ac_laptop" echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi pkg_modules="glib-2.0 >= 2.0.0" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi PKG_CONFIG=$ac_pt_PKG_CONFIG else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 PKG_CONFIG="" fi fi pkg_failed=no echo "$as_me:$LINENO: checking for PACKAGE" >&5 echo $ECHO_N "checking for PACKAGE... $ECHO_C" >&6 if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_CFLAGS"; then pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_LIBS"; then pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$pkg_modules"` else PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"` fi # Put the nasty error message in config.log where it belongs echo "$PACKAGE_PKG_ERRORS" >&5 { { echo "$as_me:$LINENO: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 echo "$as_me: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : fi PB_OBJECTS= PB_LIBS= pbb_with_pmud=no # Check whether --with-pmud or --without-pmud was given. if test "${with_pmud+set}" = set; then withval="$with_pmud" pbb_with_pmud=$withval fi; if test "$pbb_with_pmud" == "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_PMUD 1 _ACEOF PB_OBJECTS+="tcp.$OBJEXT" fi pbb_with_oss=yes # Check whether --with-oss or --without-oss was given. if test "${with_oss+set}" = set; then withval="$with_oss" pbb_with_oss=$withval fi; if test "$pbb_with_oss" == "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_OSS 1 _ACEOF fi pbb_with_alsa=yes # Check whether --with-alsa or --without-alsa was given. if test "${with_alsa+set}" = set; then withval="$with_alsa" pbb_with_alsa=$withval fi; if test "$pbb_with_alsa" == "yes"; then alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes # Check whether --with-alsa-prefix or --without-alsa-prefix was given. if test "${with_alsa_prefix+set}" = set; then withval="$with_alsa_prefix" alsa_prefix="$withval" else alsa_prefix="" fi; # Check whether --with-alsa-inc-prefix or --without-alsa-inc-prefix was given. if test "${with_alsa_inc_prefix+set}" = set; then withval="$with_alsa_inc_prefix" alsa_inc_prefix="$withval" else alsa_inc_prefix="" fi; # Check whether --enable-alsatest or --disable-alsatest was given. if test "${enable_alsatest+set}" = set; then enableval="$enable_alsatest" enable_alsatest="$enableval" else enable_alsatest=yes fi; echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6 if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 echo "${ECHO_T}$ALSA_CFLAGS" >&6 CFLAGS="$alsa_save_CFLAGS" echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6 if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 echo "${ECHO_T}$ALSA_LIBS" >&6 min_alsa_version=1.0.0 echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6 no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: found." >&5 echo "${ECHO_T}found." >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: not present." >&5 echo "${ECHO_T}not present." >&6 alsa_found=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$enable_alsatest" = "xyes"; then echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6 if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char snd_ctl_open (); int main () { snd_ctl_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_asound_snd_ctl_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_asound_snd_ctl_open=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6 if test $ac_cv_lib_asound_snd_ctl_open = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBASOUND 1 _ACEOF LIBS="-lasound $LIBS" else alsa_found=no fi fi LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then pbb_have_alsa=yes else ALSA_CFLAGS="" ALSA_LIBS="" pbb_have_alsa=no fi if test "$pbb_have_alsa" == "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_ALSA 1 _ACEOF fi fi pbb_with_ibam=yes # Check whether --with-ibam or --without-ibam was given. if test "${with_ibam+set}" = set; then withval="$with_ibam" pbb_with_ibam=$withval fi; if test "$pbb_with_ibam" == "yes"; then cat >>confdefs.h <<_ACEOF #define WITH_IBAM 1 _ACEOF PB_OBJECTS+=" ibam_stub.$OBJEXT" PB_LIBS+=" -lstdc++" fi if test "$enable_debug" = yes; then DEBUG_TRUE= DEBUG_FALSE='#' else DEBUG_TRUE='#' DEBUG_FALSE= fi if test "$enable_debug" == "yes"; then PB_OBJECTS+=" module_peep.$OBJEXT" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in initreq.h alloca.h argz.h errno.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ALL_LINGUAS="de ca es" MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f messages.po # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6 GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-2" # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2 or newer... $ECHO_C" >&6 if test "${ac_cv_gnu_library_2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2=yes else ac_cv_gnu_library_2=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2" >&6 GLIBC2="$ac_cv_gnu_library_2" echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for signed" >&5 echo $ECHO_N "checking for signed... $ECHO_C" >&6 if test "${bh_cv_c_signed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { signed char x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bh_cv_c_signed=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 bh_cv_c_signed=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $bh_cv_c_signed" >&5 echo "${ECHO_T}$bh_cv_c_signed" >&6 if test $bh_cv_c_signed = no; then cat >>confdefs.h <<\_ACEOF #define signed _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6 if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ long long ll = 1LL; int i = 63; int main () { long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6 if test "${gt_cv_c_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$GCC" = yes; then gt_cv_c_long_double=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_long_double=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 echo "${ECHO_T}$gt_cv_c_long_double" >&6 if test $gt_cv_c_long_double = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6 if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wchar_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 echo "${ECHO_T}$gt_cv_c_wchar_t" >&6 if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for wint_t" >&5 echo $ECHO_N "checking for wint_t... $ECHO_C" >&6 if test "${gt_cv_c_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wint_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 echo "${ECHO_T}$gt_cv_c_wint_t" >&6 if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WINT_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_inttypes_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6 if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6 if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6 if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6 if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif int main () { intmax_t x = -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 echo "${ECHO_T}$gt_cv_c_intmax_t" >&6 if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF fi echo "$as_me:$LINENO: checking whether printf() supports POSIX/XSI format strings" >&5 echo $ECHO_N "checking whether printf() supports POSIX/XSI format strings... $ECHO_C" >&6 if test "${gt_cv_func_printf_posix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "notposix" >/dev/null 2>&1; then gt_cv_func_printf_posix="guessing no" else gt_cv_func_printf_posix="guessing yes" fi rm -f conftest* else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_printf_posix=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_func_printf_posix=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gt_cv_func_printf_posix" >&5 echo "${ECHO_T}$gt_cv_func_printf_posix" >&6 case $gt_cv_func_printf_posix in *yes) cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_PRINTF 1 _ACEOF ;; esac # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 GLIBC21="$ac_cv_gnu_library_2_1" echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5 echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6 if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Guess based on the CPU. case "$host_cpu" in alpha* | i3456786 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_int_divbyzero_sigfpe=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gt_cv_int_divbyzero_sigfpe=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5 echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6 case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac cat >>confdefs.h <<_ACEOF #define INTDIV0_RAISES_SIGFPE $value _ACEOF echo "$as_me:$LINENO: checking for unsigned long long" >&5 echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unsigned long long ull = 1ULL; int i = 63; int main () { unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF fi if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 if test "${gt_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_header_inttypes_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6 if test $gt_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi if test $gt_cv_header_inttypes_h = yes; then echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5 echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6 if test "${gt_cv_inttypes_pri_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef PRId32 char *p = PRId32; #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_inttypes_pri_broken=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_inttypes_pri_broken=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5 echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6 fi if test "$gt_cv_inttypes_pri_broken" = yes; then cat >>confdefs.h <<_ACEOF #define PRI_MACROS_BROKEN 1 _ACEOF fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6 result= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Found it" >/dev/null 2>&1; then result=yes fi rm -f conftest* if test -z "$result"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 / 10) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 / 10) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 / 10) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 / 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) res_hi=$ac_lo;; '') result=? ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include long longval () { return ~(size_t)0 / 10; } unsigned long ulongval () { return ~(size_t)0 / 10; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((~(size_t)0 / 10) < 0) { long i = longval (); if (i != (~(size_t)0 / 10)) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (~(size_t)0 / 10)) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then res_hi=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 % 10) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 % 10) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 % 10) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((~(size_t)0 % 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) res_lo=$ac_lo;; '') result=? ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include long longval () { return ~(size_t)0 % 10; } unsigned long ulongval () { return ~(size_t)0 % 10; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((~(size_t)0 % 10) < 0) { long i = longval (); if (i != (~(size_t)0 % 10)) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (~(size_t)0 % 10)) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then res_lo=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) fits_in_uint=$ac_lo;; '') result=? ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include long longval () { return sizeof (size_t) <= sizeof (unsigned int); } unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) { long i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val if test "$fits_in_uint" = 1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern size_t foo; extern unsigned long foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test -z "$result"; then if test "$fits_in_uint" = 1; then result="$res_hi$res_lo"U else result="$res_hi$res_lo"UL fi else result='~(size_t)0' fi fi echo "$as_me:$LINENO: result: $result" >&5 echo "${ECHO_T}$result" >&6 if test "$result" != yes; then cat >>confdefs.h <<_ACEOF #define SIZE_MAX $result _ACEOF fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6 if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6 if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 with_gnu_ld=$acl_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6 wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" : else enable_rpath=yes fi; use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi; LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6 if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((ptrdiff_t *) 0) return 0; if (sizeof (ptrdiff_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ptrdiff_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6 if test $ac_cv_type_ptrdiff_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define ptrdiff_t long _ACEOF fi for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl__snprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snprintf char *p = (char *) _snprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl__snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snprintf=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6 if test $ac_cv_have_decl__snprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNPRINTF $gt_value _ACEOF echo "$as_me:$LINENO: checking whether _snwprintf is declared" >&5 echo $ECHO_N "checking whether _snwprintf is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl__snwprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef _snwprintf char *p = (char *) _snwprintf; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl__snwprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snwprintf=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl__snwprintf" >&5 echo "${ECHO_T}$ac_cv_have_decl__snwprintf" >&6 if test $ac_cv_have_decl__snwprintf = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNWPRINTF $gt_value _ACEOF echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef feof_unlocked char *p = (char *) feof_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_feof_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 if test $ac_cv_have_decl_feof_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FEOF_UNLOCKED $gt_value _ACEOF echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef fgets_unlocked char *p = (char *) fgets_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_fgets_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_fgets_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 if test $ac_cv_have_decl_fgets_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETS_UNLOCKED $gt_value _ACEOF echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef getc_unlocked char *p = (char *) getc_unlocked; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getc_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getc_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 if test $ac_cv_have_decl_getc_unlocked = yes; then gt_value=1 else gt_value=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETC_UNLOCKED $gt_value _ACEOF case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6 else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6 cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi if test $ac_cv_header_locale_h = yes; then echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 if test "${gt_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_val_LC_MESSAGES=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$gt_cv_val_LC_MESSAGES" >&6 if test $gt_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi if test -n "$INTL_MACOSX_LIBS"; then CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" fi for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_INTLBISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$INTLBISON"; then ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_INTLBISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then echo "$as_me:$LINENO: result: $INTLBISON" >&5 echo "${ECHO_T}$INTLBISON" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else echo "$as_me:$LINENO: checking version of bison" >&5 echo $ECHO_N "checking version of bison... $ECHO_C" >&6 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac echo "$as_me:$LINENO: result: $ac_prog_version" >&5 echo "${ECHO_T}$ac_prog_version" >&6 fi if test $ac_verc_fail = yes; then INTLBISON=: fi echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6 if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6 if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi; echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6 if test "$gt_cv_func_gnugettext1_libc" != "yes"; then use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix or --without-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval="$with_libintl_prefix" if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi fi; LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6 fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test "$gt_use_preinstalled_gnugettext" != "yes"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then CATOBJEXT=.gmo fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 if test "$USE_NLS" = "yes"; then echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6 if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6 fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6 for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi nls_cv_header_intl= nls_cv_header_libgt= DATADIRNAME=share INSTOBJEXT=.mo GENCAT=gencat INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi INTL_LIBTOOL_SUFFIX_PREFIX= INTLLIBS="$LIBINTL" if test "x${sysconfdir}" = 'x${prefix}/etc'; then if test "x${prefix}" = "xNONE"; then pbb_sysconfdir="${ac_default_prefix}/etc" else pbb_sysconfdir="${prefix}/etc" fi else pbb_sysconfdir=${sysconfdir} fi cat >>confdefs.h <<_ACEOF #define SYS_CONF_DIR "${pbb_sysconfdir}" _ACEOF if test "x${datadir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then pbb_datadir="${ac_default_prefix}/share" else pbb_datadir="${prefix}/share" fi else pbb_datadir=${datadir} fi cat >>confdefs.h <<_ACEOF #define PACKAGE_DATA_DIR "${pbb_datadir}" _ACEOF pbb_localedir="${pbb_datadir}/locale" cat >>confdefs.h <<_ACEOF #define PACKAGE_LOCALE_DIR "${pbb_localedir}" _ACEOF ac_config_files="$ac_config_files Makefile src/Makefile po/Makefile.in po/Makefile libpbbipc/Makefile pbbcmd/Makefile intl/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po/Makefile" ) CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; "libpbbipc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libpbbipc/Makefile" ;; "pbbcmd/Makefile" ) CONFIG_FILES="$CONFIG_FILES pbbcmd/Makefile" ;; "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "default-2" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-2" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@AWK@,$AWK,;t t s,@LN_S@,$LN_S,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t s,@PACKAGE_CFLAGS@,$PACKAGE_CFLAGS,;t t s,@PACKAGE_LIBS@,$PACKAGE_LIBS,;t t s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t s,@ALSA_LIBS@,$ALSA_LIBS,;t t s,@DEBUG_TRUE@,$DEBUG_TRUE,;t t s,@DEBUG_FALSE@,$DEBUG_FALSE,;t t s,@PB_OBJECTS@,$PB_OBJECTS,;t t s,@PB_LIBS@,$PB_LIBS,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t s,@USE_NLS@,$USE_NLS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@XGETTEXT@,$XGETTEXT,;t t s,@MSGMERGE@,$MSGMERGE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@GLIBC2@,$GLIBC2,;t t s,@ALLOCA@,$ALLOCA,;t t s,@GLIBC21@,$GLIBC21,;t t s,@INTL_MACOSX_LIBS@,$INTL_MACOSX_LIBS,;t t s,@HAVE_POSIX_PRINTF@,$HAVE_POSIX_PRINTF,;t t s,@HAVE_ASPRINTF@,$HAVE_ASPRINTF,;t t s,@HAVE_SNPRINTF@,$HAVE_SNPRINTF,;t t s,@HAVE_WPRINTF@,$HAVE_WPRINTF,;t t s,@LIBICONV@,$LIBICONV,;t t s,@LTLIBICONV@,$LTLIBICONV,;t t s,@INTLBISON@,$INTLBISON,;t t s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t s,@CATOBJEXT@,$CATOBJEXT,;t t s,@DATADIRNAME@,$DATADIRNAME,;t t s,@INSTOBJEXT@,$INSTOBJEXT,;t t s,@GENCAT@,$GENCAT,;t t s,@INTLOBJS@,$INTLOBJS,;t t s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t s,@INTLLIBS@,$INTLLIBS,;t t s,@LIBINTL@,$LIBINTL,;t t s,@LTLIBINTL@,$LTLIBINTL,;t t s,@POSUB@,$POSUB,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;; default-2 ) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo -e "------------------------------------------------------" echo -e "PBButtonsd configuration summary\n" echo -e "System: $ac_laptop\n" echo -e "Options:" echo -n " pmud support " if test "$pbb_with_pmud" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " OSS support " if test "$pbb_with_oss" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " ALSA support " if test "$pbb_have_alsa" == "yes"; then echo "enabled" elif test "$pbb_with_alsa" == "yes"; then echo "not available (development files?)" else echo "disabled" fi echo -n " IBAM support " if test "$pbb_with_ibam" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " Debug mode " if test "$enable_debug" == "yes"; then echo "enabled" else echo "disabled" fi echo -e "\nPaths:" echo -e " config: $pbb_sysconfdir" echo -e " data: $pbb_datadir" echo -e " locale: $pbb_localedir" echo -e " batlog: /var/lib/pbbuttons (hardcoded)" echo -e " ibam: /var/lib/ibam (hardcoded)" echo -e "\nCompiler:" echo -e " CFLAGS: $CFLAGS" echo -e " CXXFLAGS: $CXXFLAGS" echo -e "------------------------------------------------------" pbbuttonsd-0.7.9/configure.in0000644000175000017500000001254410507656416013165 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) AM_INIT_AUTOMAKE(pbbuttonsd, 0.7.9) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl Checks for programs. AC_ISC_POSIX AC_PROG_CC AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_SUBST(localstatedir, "/var/lib") echo -n "checking for system: " ac_laptop=powerbook if test "x$laptop" != "x"; then ac_laptop=$laptop elif test "x$LAPTOP" != "x"; then ac_laptop=$LAPTOP fi case "$ac_laptop" in POWERBOOK | powerbook | pb | PB ) AC_DEFINE_UNQUOTED(SYS_POWERBOOK, "", [machine to build the package for]) ac_laptop="Apple PowerBook" ;; I386ACPI | i386acpi | acpi | ACPI ) AC_DEFINE_UNQUOTED(SYS_I386_ACPI, "", [machine to build the package for]) ac_laptop="Intel based laptop with ACPI" ;; I386 | i386) AC_DEFINE_UNQUOTED(SYS_I386_GENERIC, "", [machine to build the package for]) ac_laptop="Intel based laptop" ;; *) echo -e "\nOption 'laptop' not set or unknown. Please call 'configure laptop='" echo "Possible targets are: powerbook" AC_MSG_ERROR(unknown target system) ;; esac echo "$ac_laptop" dnl Checks for libraries. AC_CHECK_LIB([dl], [dlopen]) pkg_modules="glib-2.0 >= 2.0.0" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) PB_OBJECTS= PB_LIBS= pbb_with_pmud=no AC_ARG_WITH(pmud, [ --with-pmud use pmud as low level power manager (default=no)], pbb_with_pmud=$withval, ) if test "$pbb_with_pmud" == "yes"; then AC_DEFINE_UNQUOTED(WITH_PMUD, 1, [use pmud as basement]) PB_OBJECTS+="tcp.$OBJEXT" fi pbb_with_oss=yes AC_ARG_WITH(oss, [ --with-oss enable OSS support in pbbuttonsd (default=yes)], pbb_with_oss=$withval, ) if test "$pbb_with_oss" == "yes"; then AC_DEFINE_UNQUOTED(WITH_OSS, 1, [enable OSS support]) fi pbb_with_alsa=yes AC_ARG_WITH(alsa, [ --with-alsa enable ALSA support in pbbuttonsd (default=yes)], pbb_with_alsa=$withval, ) if test "$pbb_with_alsa" == "yes"; then AM_PATH_ALSA(1.0.0, [pbb_have_alsa=yes], [pbb_have_alsa=no]) if test "$pbb_have_alsa" == "yes"; then AC_DEFINE_UNQUOTED(WITH_ALSA, 1, [enable ALSA support]) fi fi pbb_with_ibam=yes AC_ARG_WITH(ibam, [ --with-ibam enable IBAM support in pbbuttonsd (default=yes)], pbb_with_ibam=$withval, ) if test "$pbb_with_ibam" == "yes"; then AC_DEFINE_UNQUOTED(WITH_IBAM, 1, [enable IBAM support]) PB_OBJECTS+=" ibam_stub.$OBJEXT" PB_LIBS+=" -lstdc++" fi AM_CONDITIONAL(DEBUG, test "$enable_debug" = yes) if test "$enable_debug" == "yes"; then PB_OBJECTS+=" module_peep.$OBJEXT" fi AC_SUBST([PB_OBJECTS]) AC_SUBST([PB_LIBS]) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([initreq.h alloca.h argz.h errno.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h unistd.h]) dnl defining some constants dnl Add the languages which your application supports here. ALL_LINGUAS="de ca es" AM_GNU_GETTEXT dnl hell, is that really what we have to do, when we want to support dnl gettext versions before autopoint was introduced to gettext (0.11.3)? dnl bastard autopoint script checks for "^AM_GNU_GETTEXT_VERSION(x.y.z)" ifdef(AM_GNU_GETTEXT_VERSION, AM_GNU_GETTEXT_VERSION(0.13.1) , ) dnl Set SYS_CONF_DIR in config.h. if test "x${sysconfdir}" = 'x${prefix}/etc'; then if test "x${prefix}" = "xNONE"; then pbb_sysconfdir="${ac_default_prefix}/etc" else pbb_sysconfdir="${prefix}/etc" fi else pbb_sysconfdir=${sysconfdir} fi AC_DEFINE_UNQUOTED(SYS_CONF_DIR, "${pbb_sysconfdir}", [place for configuration files]) dnl Set PACKAGE_DATA_DIR in config.h. if test "x${datadir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then pbb_datadir="${ac_default_prefix}/share" else pbb_datadir="${prefix}/share" fi else pbb_datadir=${datadir} fi AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${pbb_datadir}", [place for data files]) pbb_localedir="${pbb_datadir}/locale" AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${pbb_localedir}", [target dir for package]) AC_OUTPUT([ Makefile src/Makefile po/Makefile.in po/Makefile libpbbipc/Makefile pbbcmd/Makefile intl/Makefile ]) echo -e "------------------------------------------------------" echo -e "PBButtonsd configuration summary\n" echo -e "System: $ac_laptop\n" echo -e "Options:" echo -n " pmud support " if test "$pbb_with_pmud" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " OSS support " if test "$pbb_with_oss" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " ALSA support " if test "$pbb_have_alsa" == "yes"; then echo "enabled" elif test "$pbb_with_alsa" == "yes"; then echo "not available (development files?)" else echo "disabled" fi echo -n " IBAM support " if test "$pbb_with_ibam" == "yes"; then echo "enabled" else echo "disabled" fi echo -n " Debug mode " if test "$enable_debug" == "yes"; then echo "enabled" else echo "disabled" fi echo -e "\nPaths:" echo -e " config: $pbb_sysconfdir" echo -e " data: $pbb_datadir" echo -e " locale: $pbb_localedir" echo -e " batlog: /var/lib/pbbuttons (hardcoded)" echo -e " ibam: /var/lib/ibam (hardcoded)" echo -e "\nCompiler:" echo -e " CFLAGS: $CFLAGS" echo -e " CXXFLAGS: $CXXFLAGS" echo -e "------------------------------------------------------" pbbuttonsd-0.7.9/install-sh0000755000000000000000000001440610447341475012624 00000000000000#!/bin/sh # # install - install a program, script, or datafile # # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # 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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 pbbuttonsd-0.7.9/missing0000755000000000000000000001452010447341475012214 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. # Franc,ois Pinard , 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., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.in; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in -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 Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' 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 lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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 missing on your system. 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 missing on your system. 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 missing on your system. 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 ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. 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 prerequirements 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 pbbuttonsd-0.7.9/mkinstalldirs0000755000175000017500000000370410002313250013430 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here pbbuttonsd-0.7.9/autogen.sh0000755000175000017500000001134310451222261012632 00000000000000#!/bin/bash # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` PKG_NAME="the package." DIE=0 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed to." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz" echo "(or a newer version if it is available)" DIE=1 } } grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && { grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ (gettext --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`gettext' installed." echo "Get ftp://alpha.gnu.org/gnu/gettext-X.XX.XX.tar.gz" DIE=1 } } # gettext's autopoint script checks for AM_GNU_GETTEXT_VERSION at the # first row of the line, so there could be problems differentiating between # gettext version with and without this script, because prior versions # don't know the AM_GNU_GETTEXT_VERSION macro (autopoint --version) < /dev/null > /dev/null 2>&1 && { grep "^AM_GNU_GETTEXT_VERSION" $srcdir/configure.in >/dev/null || { echo echo "**Error**: Set AM_GNU_GETTEXT_VERSION(x.yy.zz) in configure.in" echo " when using autopoint from gettext version >0.11.4" DIE=1 AUTOPOINT=no } AUTOPOINT=yes } GETTEXTIZE_OPTIONS=" --force --copy" # check if gettextize understand all options (gettestize --intl --version) < /dev/null > /dev/null 2>&1 && { GETTEXTITE_OPTIONS="$GETTEXTIZE_OPTIONS --intl" } (gettestize --no-changelog --version) < /dev/null > /dev/null 2>&1 && { GETTEXTITE_OPTIONS="$GETTEXTIZE_OPTIONS --no-changelog" } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" echo "(or a newer version if it is available)" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" echo "(or a newer version if it is available)" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -name configure.in -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" for k in $macrodirs; do if test -d $k; then aclocalinclude="$aclocalinclude -I $k" ##else ## echo "**Warning**: No such directory \`$k'. Ignored." fi done if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then if grep "sed.*POTFILES" configure.in >/dev/null; then : do nothing -- we still have an old unmodified configure.in else echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 # use appropiate gettext infrastructure service if [ "$AUTOPOINT" == "yes" ]; then echo "Running autopoint... " autopoint --force else echo "Running gettextize... Ignore non-fatal messages." echo "no" | gettextize $GETTEXTIZE_OPTIONS fi echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi fi if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then echo "Running libtoolize..." libtoolize --force --copy fi echo "Running aclocal $aclocalinclude ..." echo $aclocalinclude aclocal $aclocalinclude if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile $PKG_NAME else echo Skipping configure process. fi pbbuttonsd-0.7.9/BUGS0000644000175000017500000000567010360313316011323 00000000000000 BUGS ==== - reload of configuration It is not possible to change the soundmodule on the fly. After changing the soundsystem in the configuration file the signal -HUP will break pbbuttonsd's soundsystem - debian run-parts - There is a small problem with the debian run-parts program used for the script system. Usually pbbuttonsd set a timeout for the PMCS script to run. If this timeout was exceeded pbbuttonsd would terminate the script and ideally all its childs. But this will only work if all child processes share the same process group. Unfortunately the program run-parts creates a new process group for each running child script so that pbbuttonsd can't terminate this scripts. Pbbuttonsd will work as usual after a script error but the faulty script might remain in memory. To be save run-parts needs to be patched. Remove the function call setsid() from the source (There is only one) and recompile. A bug-report was sent to debian. This problem will only occour if your script don't work correctly. Check pbbuttonsd lock file if some of your scripts have been killed by the server and in this case check those scripts for errors. - framebuffer with no backlight controller support - If the framebuffer didn't support the LCD backlight, reading the current brightness level would result in an error. This error switch pbbuttonsd in a special emergency mode and it tries to sustain basic support and inform all clients that LCD brightness is not available. Nevertheless pbbuttonsd could be configured to switch of the framebuffer display but the result might not as expected. Depending on how good the framebuffer driver controlls the LCD backlight this basic support may show some strange side effects. This could be a sleeping machine with still illuminated LCD showing nice color patterns or the backlight won't be switched off at all (also it seems so and the display is dark). Sometimes it helps calling 'pbbcmd config lcdbacklight 0' before triggering sleep but there is no guarantee. The behaviour wouldn't change if the kernel was configured not to support the LCD backlight. I have no solution for this problems other than to fix the framebuffer driver that it supports the LCD backlight and provides a backlight controller. If you have such a machine where the LCD and mostly suspend-to-RAM also is not well supported, configure pbbuttonsd carefully and don't expect any behaviour for sure. Check it carefully and if in doubt, disable the feature. Don't use 'suspend-to-RAM' and 'blank screen' in this case. --- Be warned --- - since pbbuttons have been ported to glib, memory failures will cause immediate program termination without a chance to clean up properly. - Failing to install one or more sighandlers is only worth a warning rather than an error message. I think this won't be a problem at all because sigaction() has no real reason to fail. --- If you find other bugs or problems regarding pbbuttons, please email me. pbbuttonsd-0.7.9/pbbcmd.10000644000175000017500000004770210507467354012172 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBCMD 1 "September 28, 2006" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbcmd \- command line tool to communicate with pbbuttonsd. .SH SYNOPSIS .B pbbcmd .RI [\-hvi]\ .br .B pbbcmd .RI [\-hvi]\ query\ .br .B pbbcmd .RI [\-hvi]\ config\ \ .SH DESCRIPTION \fBpbbcmd\fP is a tool to communicate with pbbuttonsd. It is possible to send single commands to the daemon or ask it for certain information. It is useful for scripts or for debugging and therefore the results of queries and arguments for config operations are very basic and raw. Pbbcmd won't interpret the results for you. .SH OPTIONS \fBpbbcmd\fP accepts the following options: .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of \fBpbbcmd\fP. .TP .B \-i, \-\-ignore With this option given pbbcmd will not wait for answers from the server after a config command has been sent. It returns immediately. .PP The command tells pbbcmd what should be done. Only the commands \'query\' and \'config\' needs additional arguments. All other stand for themselves. Pbbcmd supports following commands: .TP .B query .br Reads parameters from the server and print them to terminal. This command needs the name of the desired parameter as argument. Multiple names are possible. See chapter TAGS for possible parameter names. .TP .B config .br Change server options on the fly. This command needs the parameter name and the new value as command. Multiple parameters can be changed at once. See chapter TAGS for possible parameter names. .TP .B listclients .br Receiving this command pbbuttonsd will return a list of currently attached clients. Pbbcmd will print a table containg useful information of these clients. .TP .B saveconfig .br Save current configuration to disc. This works only if all security conditions were fulfilled and pbbuttond has config writing enabled. .TP .B reinit .br This command triggers reinitialization setting of hardware components under control of pbbuttonsd (for example the trackpad and keyboard on PowerBooks). The PMCS script to set the power policy will also be lauched after this command. .TP .B ejectcd .br Eject the CDROM. .TP .B sleep .br Suspend the machine to RAM. .TP .B hibernate .br Suspend the machine to Disk. This will trigger the kernel to write the memory and all necessary process data to swap space on disk and shut the machine down. After next reboot, the system should be restored in state the system had at the time this command was triggered. This might not work on all machines. Please read the kernel documentation for more details. .SH "TAGS to use with \'config\' or \'query\'" Not every tag could be used with \fIconfig\fP and \fIquery\fP operations. The 'List of Tags' below shows how each tag could be used. The structure of this list is described as follows: .TP .br .PP The field shows what sort of data is returned or expected. Following datatypes are defined: .TP .B command This tag is a command and the argument wouldn't be evaluated. Nevertheless the config operation expected one and 0 would be ok in this cases. .TP .B string String of characters. The string must be quoted if it contains white spaces. .TP .B integer 32-bit integer values. The description would say if the value range was restricted. .TP .B bool A boolean value. A '0' means false and a '1' means true. Any other values are invalid. .TP .B keycode A keycode is an 8-bit integer. Each keycode has it's equivalent key on the keyboard. Don't confuse this with ASCII code. You could get keycodes with the program \fIshowkey\fP. .TP .B modifier A modifier is an bit-field with one bit for each modifier key: Bit 0 = 1 = shift, bit 1 = 2 = alt and bit 2 = 4 = ctrl. The three modifiers cold be combined through adding their single values. In result we get an value between 0 and 7. .SH "LIST OF TAGS" for query and config .TP TAG_AUTORESCAN bool config/query .br Enable or disable periodically scan of event devices to detect new or lost keyboards automatically. .TP TAG_VERSION string query .br Get version string of the server .TP TAG_TIMEFORCMD integer config/query .br Get or set the timeout for launched scripts or helper programs. .TP TAG_TIMEREMAINING integer query .br Get the current time in seconds the battery will last. .TP TAG_CHARGETIME integer query .br Get the time until the batteries are fully charged. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_POWERSOURCE bool query .br Get the current power source the machine is running on. '0' represents battery and '1' stands for AC. .TP TAG_SLEEPSUPPORTED bool query .br Check if the machine supports sleep mode. The result is '0' if not. .TP TAG_PMUDEVICE string config/query .br Get or set the pmu device. This is only useful on Apple PowerBooks and compatible. .TP TAG_ADBDEVICE string config/query .br Get or Set the ADB device. This is only useful on Apple PowerBooks and compatible. .TP TAG_TPMODEUPKEY keycode config/query .br Get or set keycode used for trackpad mode up. .TP TAG_TPMODEUPMOD modifier config/query .br Get or Set modifier used with TPMODEUPKEY. .TP TAG_TPMODEDOWNKEY keycode config/query .br Get or set keycode used for trackpad mode down. .TP TAG_TPMODEDOWNMOD modifier config/query .br Get or set modifier used with TPMODEDOWNKEY. .TP TAG_TPMODE integer config/query .br Get or set trackpad mode. Supported modes are: 0=notap, 1=tap, 2=drag. All other values are invalid. .TP TAG_NOTAPTYPING bool config/query .br Enable or disable trackpad configuration while typing. Normally the trackpad would stay in it's current mode if key on the keyboard were hit. With this option enabled the trackpad will be configured to \'notap\' while the keyboard is used. .TP TAG_KBDMODE integer config/query .br Get or set the keyboard mode. Supported values are 0=disabled, 1=fkeyslast and 2=fkeysfirst. All other values are invalid. .PP .in +7 Fn can only be disabled on PowerBooks with an USB keyboard. If you own a machine with a ADB keyboard you have to choose 'fkeyslast' or 'fkeysfirst'. \fBPBButtonsd\fP will force this setting to 'fkeyslast' if necessary. .TP TAG_BATLOG integer config/query .br Get or set the battery logging mode. Supported values are 0=none, 1=cycle and 2=log. See pbbuttonsd.conf (5) man-page for detailed description. .TP TAG_BATCYCLE integer query .br Get the current battery cycle. A return value of \-1 shows that the battery cycle is not available. This happens if batlog has been disabled. .TP TAG_BATTERYPRESENT integer query .br Get the batteries currently present. The return value is bit-oriented. Bit 0 shows left battery and bit 1 shows the right battery. A value of 1 means only the left battery is plugged in, a value of 3 means both batteries are available. .TP TAG_LCDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing display brightness. .TP TAG_LCDILLUMUPMOD modifier config/query .br Get or set modifier used with LCDILLUMUPKEY. .TP TAG_LCDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing display brightness. .TP TAG_LCDILLUMDOWNMOD modifier config/query .br Get or set modifier used with LCDILLUMDOWNKEY. .TP TAG_LCDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_LCDAUTOADJUST bool config/query .br Enable or disable automatic brightness control for the display. .TP TAG_LCDAUTOADJMINBAT integer config/query .br Set minimum brightness limit for automatic adjustment, if running on battery. .TP TAG_LCDAUTOADJMAXBAT integer config/query .br Set maximum brightness limit for automatic adjustment, if running on battery. .TP TAG_LCDAUTOADJMINAC integer config/query .br Set minimum brightness limit for automatic adjustment, if running on AC. .TP TAG_LCDAUTOADJMAXAC integer config/query .br Set maximum brightness limit for automatic adjustment, if running on AC. .TP TAG_KBDILLUMUPKEY keycode config/query .br Get or set keycode used for increasing keyboard brightness. .TP TAG_KBDILLUMUPMOD modifier config/query .br Get or set modifier used with KBDILLUMUPKEY. .TP TAG_KBDILLUMDOWNKEY keycode config/query .br Get or set keycode used for decreasing keyboard brightness. .TP TAG_KBDILLUMDOWNMOD modifier config/query .br Get or set modifier used with KBDILLUMDOWNKEY. .TP TAG_KBDILLUMONKEY keycode config/query .br Get or set keycode used to switch keyboard illumination on or off. .TP TAG_KBDILLUMONMOD modifier config/query .br Get or set modifier used with KBDILLUMONKEY. .TP TAG_KBDBRIGHTNESS integer config/query .br Get or set current brightness level as percentage. .TP TAG_KBDONBRIGHTNESS integer config/query .br Get or set default ON status brightness level as percentage. .TP TAG_KBDAUTOADJUST bool config/query .br Enable or disable automatic brightness control for the keyboard illumination. .TP TAG_FRAMEBUFFERDEVICE string config/query .br Get or set the framebuffer device. .TP TAG_BLANKFRAMEBUFFER bool config/query .br Disable or enable framebuffer display blanking. If this option was enabled the framebuffer would be switched off when the backlight goes invisibly dark. .TP TAG_DIMFULLYDARK bool config/query .br Normally the display is dimmed down to minimum level. With this option set dimming goes down to complete darkness. .TP TAG_AMBIENTLIGHT integer query .br Get the value from the ambient light sensor in percent. This works only on machines that have an ambient light sensor. .TP TAG_AMBIENTTHRESHOLD integer config/query .br Get or set the threshold for ambient light to activate the keyboard illumination. .TP TAG_LCDFADINGSPEED integer config/query .br Set the time in miliseconds a full LCD backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_KBDFADINGSPEED integer config/query .br Set the time in miliseconds a full keyboard backlight dim (from lowest to highest brightness level) should last. Pbbuttonsd will adjust its internal timing accordingly. A value of '0' disables smooth brightness changes. .PP .in +7 If this option is queried, pbbuttonsd will return the current setting of the internal timing. This value may differ from the originally set value because the timer could only be programmed with limited precision. .TP TAG_MIXERDEVICE string config/query .br Get or set OSS sound mixer device. .TP TAG_MIXERCHANNELS string config/query .br Get or set a comma separated list of OSS mixer channels pbbuttonsd should control. Every channel combination is valid nevertheless the setting makes sense. .TP TAG_MIXERCARD string config/query .br Get or set ALSA sound card .TP TAG_MIXERELEMENTS string config/query .br Get or set a comma separated list of ALSA elements pbbuttonsd should control. For possible names ask amixer. .TP TAG_VOLUMEUPKEY keycode config/query .br Get or set keycode used for sound volume up. .TP TAG_VOLUMEUPMOD modifier config/query .br Get or set modifier used with VOLUMEUPKEY. .TP TAG_VOLUMEDOWNKEY keycode config/query .br Get or set keycode used for sound volume down. .TP TAG_VOLUMEDOWNMOD modifier config/query .br Get or set modifier used with VOLUMEDOWNKEY. .TP TAG_MUTEKEY keycode config/query .br Get or set keycode used for mute sound volume. .TP TAG_MUTEMOD modifier config/query .br Get or set modifier used with MUTEKEY. .TP TAG_MIXERINITDELAY bool config/query .br Disable or enable the soft start of the mixer. If this option was enabled the mixer device would be initialized with it's first use and not immediately after daemon's startup. .TP TAG_VOLUME integer config/query .br Get or set sound volume. The valid value range is from 0 (silent) to 100 (loud). Higher values will be clipped. .TP TAG_MUTE command config .br Mute/unmute the speakers. .TP TAG_CDROMDEVICE string config/query .br Get or set the CDROM device. .TP TAG_EJECTCDKEY keycode config/query .br Get or set keycode used for ejecting the CDROM. .TP TAG_EJECTCDMOD modifier config/query .br Get or set modifier used with EJECTCDKEY. .TP TAG_EJECTCDKEYDELAY bool config/query .br Disable or enable the eject key response delay. .TP TAG_SCRIPTPMCS string config/query .br Get or set the template for the script which would be called at certain events. This events are change of power policy, change of power source, change of suspend state and at emergency condition if battery is critically low. But the emergency call is only done, if configured. Up to two '%s' are allowed in the template and will be replaced by the action and the power source. .TP TAG_IBAMDATADIR string config/query .br Get or set the IBAM data directory where statistics about battery charge and discharge cycles are stored. .br This option would only be available, if pbbuttonsd was compiled with IBaM support. .TP TAG_SLEEPKEY keycode config/query .br Get or set the keycode used for triggering sleep mode. .TP TAG_SLEEPMOD modifier config/query .br Get or set the modifier used with SLEEPKEY .TP TAG_SLEEPKEYDELAY bool config/query .br Disable or enable the sleep key response delay. .TP TAG_BWLFIRST integer config/query .br Get or set time in seconds for the first battery warn level. .TP TAG_BWLSECOND integer config/query .br Get or set time in seconds for the second battery warn level. .TP TAG_BWLLAST integer config/query .br Get or set time in seconds for the last battery warn level. .TP TAG_CURRENTBWL integer query .br Get the current battery warn level. .TP TAG_CPULOADSLEEPLOCK bool config/query .br Disable or enable the CPU sleep lock. .TP TAG_CPULOADMIN integer config/query .br Get or set the minimum CPU load to activate the sleep lock. .TP TAG_CPULOADPERIOD integer config/query .br Get or set the time in seconds how long the CPU load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADSLEEPLOCK bool config/query .br Disable or enable the net sleep lock. .TP TAG_NETLOADMIN integer config/query .br Get or set the minimum net load to activate the sleep lock. .TP TAG_NETLOADPERIOD integer config/query .br Get or set the time in seconds how long the net load have to be dropped below the minimum until the lock will be released. .TP TAG_NETLOADDEV string config/query .br Get or set the network device to be supervised for the net sleeplock. .TP TAG_EMERGENCYACTION integer config/query .br Get or set the emergency action that should be performed if battery was running low. Three values are valid: 0=sleep, 1=signal to init and 2=command. All other values are invalid. .TP TAG_ONAC_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to AC. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONAC_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active AC profile. The timout value for this timer event could be set with TAG_ONAC_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active AC profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONAC_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if AC power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONAC_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if AC power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_ONBATT_POLICY integer config/query .br Get or set the power policy that should be activated if power source changes to BATTERY. Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_ONBATT_TIMERACTION integer config/query .br Get or set the action that should be performed if a timer event occurs with active BATTERY profile. The timout value for this timer event could be set with TAG_ONBATTERY_TIMESUSPEND. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_COVERACTION integer config/query .br Get or set the action that should be performed if the cover of the laptop was closed with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_KEYACTION integer config/query .br Get or set the action that should be performed if the sleepkey was triggered with active BATTERY profile. Following values are possible: 0=none, 1=suspend-to-ram, 2=suspend-to-disk, 3=blank screen .TP TAG_ONBATT_TIMESUSPEND integer config/query .br Get or set the time until suspend is triggered. This value will only be used if BATTERY power profile is active. Set this value to 0 and suspend timeout is disabled. .TP TAG_ONBATT_TIMEDIM integer config/query .br Get or set the time until the backlight would be dimmed. This value will only be used if BATTERY power profile is active. Set this value to 0 and screen dimming is disabled. .TP TAG_HEARTBEATBEEP boolean config/query .br Enable or disable the heartbeat beep if the computer is running with closed lid. 0=disable beep, 1=enable beep. .TP TAG_POLICY integer config/query .br Get or set the current power policy Following values are valid: 0=nochange, 1=powersave, 2=custom and 3=performance. .TP TAG_IDENTITY string query .br Get the machine's identity string. .SH "SEE ALSO" pbbuttons.conf (5), showkey (1) .SH AUTHOR Matthias Grimm . pbbuttonsd-0.7.9/pbbuttonsd.10000644000175000017500000005614610507722122013114 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBUTTONSD 1 "September 30, 2006" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbuttonsd \- daemon to support Laptop specific functions .SH SYNOPSIS .B pbbuttonsd .RI [ options ] .SH DESCRIPTION .ad b \fBPBButtonsd\fP is a daemon which brings support for many Laptop specific functions to Linux. Basically it was designed to support Apple iBooks, Powerbooks or TiBooks but since version 0.5 the design has been changed to support any Notebook. .PP For every supported Notebook a special module is necessary to do all the hardware dependent jobs. At the moment only Apple Computers will be fully supported but basic functions work also on Intel based machines. Help to build up support for more machines is always welcome. .PP Supported features: .PP Advanced Power Management: .ad l .in +2 .ti -2 \- puts the machine to sleep if idle to save energy, .ti -2 \- prevent the machine from entering sleep mode if CPU or Net is busy until the job is finished, .ti -2 \- send a warning if battery is running low, .ti -2 \- configurable emergency actions if battery is critically low, .ti -2 \- dims the display if user is passive to save energy .ti -2 \- puts machine to sleep if cover was closed, .ti -2 \- executes external scripts on certain power management events to allow most flexibility, .ti -2 \- is able to replace power management daemons like pmud, apmd, etc. .PP Support for laptop dependent hotkeys: .in +2 .ti -2 \- to adjust display brightness .ti -2 \- to adjust keyboard illumination, .ti -2 \- to adjust the sound volume, .ti -2 \- to mute/unmute the sound channels, .ti -2 \- to open/close the CDROM tray, .ti -2 \- to trigger sleep mode. .ti -2 \- to switch external video on/off .PP Support for laptop dependent specialities: .in +2 .ti -2 \- initializes trackpad and keyboard mode during startup, .ti -2 \- disables trackpad's mouse click emulation while typing on the keyboard .ti -2 \- keeps keyboard settings during sleep mode, .ti -2 \- cycles through the trackpad operating mode via hotkeys, .ti -2 \- supports PowerBook's ambient light sensor and automatic adjustment of LCD and keyboard brightness. .SH USER INTERFACE .ad b The main input to \fBPBButtonsd\fP works through key codes. Certain keys ensure appropriate actions. This keys are widely user configurable in the configuration file. In detail following keys are supported: .PP .nf Config Option Modifier Description LCD_IllumUpKey \-\- Increase display brightness. shift Increase display brightness to maximum value. The shift modifier here is hard coded and can't be configured. LCD_IllumDownKey \-\- Decrease display brightness until complete darkness. shift Decrease display brightness to minimum value. The shift modifier here is hard coded and can't be configured. KBD_IllumUpKey \-\- Increase keyboard illumination brightness. shift Increase keyboard illumination brightness to maximum value. The shift modifier here is hard coded and can't be configured. KBD_IllumDownKey \-\- Decrease keyboard illumination brightness until complete darkness. shift Decrease keyboard illumination brightness to minimum value. The shift modifier here is hard coded and can't be configured. KBD_IllumOnKey \-\- Switch keyboard illumination on/off. The level won't change. CRT_MirrorKey \-\- Enable/disable external video output. SleepKey \-\- Trigger configured sleep action. VolumeUpKey \-\- Increase volume of configured channels by ten percent. This works on all sound hardware the same way. shift Increase volume level in fine steps. This function uses the volume scale the hardware supports so that small volume adjustment might not result in audible volume change. OSS always handle the volume level in percent so that this function will change the volume level by one percent. The shift modifier here is hard coded and can't be configured. VolumeDownKey \-\- Decrease volume of configured channels by ten percent. shift Decrease volume level in small steps. Smallest hardware supported step with ALSA and one percent with OSS. The shift modifier here is hard coded and can't be configured. MuteKey \-\- Disable/enable sound output. The volume level won't change. Pressing any other volume con\- trol key will automaticaly enable sound out\- put again. EjectCDKey \-\- Ejects a CDROM from CDROM drive. If necessary the device will be unmounted before. This would fail if the device was busy. TPModeUpKey \-\- Cycle trackpad mode forward (notap, tap, drag or lock). TPModeDownKey \-\- Cycle trackpad mode backward (lock, drag, tap or notap). .fi .PP .ad b Not all of this keys must work on your system. Most of them are hardware dependent and if your notebook doesn't have the required hardware the related function will not work. Read your notebook's manual and pbbuttonsd.conf (5) to figure out what you could expect. .PP .SH COMMANDS AND SIGNALS \fBPBButtonsd\fP has an IPC interface (Inter Process Communication) and you could send commands to the server to trigger certain actions. Use the command line tool 'pbbcmd' with following syntax to send commands: .PP .ad c pbbcmd .PP .ad l Following commands are understood: .PP .in +15 .ti -15 SAVECONFIG saves the configuration if enabled by pbbuttonsd's security checks (see 'configuration file' section below) and you have the right permission. .br .ti -15 EJECTCD unmount and ejects the CDROM or closes the tray again, if already open. .br .ti -15 SLEEP puts the machine to sleep (also known as suspend to RAM) if possible. If sleep was not supported on this machine the screen will be blanked. Sleep is a kernel function and will only be triggered by pbbuttonsd. .br .ti -15 HIBERNATE saves the memory and the process information to disk (also known as suspend to Disk or Hibernate) if possible. If hibernate was not supported on this machine nothing will happen. Hibernate is a kernel function and will only be triggered by pbbuttonsd through a PMCS script usually placed in /etc/power/. .br .ti -15 REINIT This command triggers reinitialization of hardware under control of pbbuttonsd (for example trackpad and keyboard on powerbooks). The PMCS script to reinitialize the power policy will also be launched after receiving this command. This could be helpful when after a 'suspend to disc' all the hardware needs to be reinitialized. .PP Beside the IPC interface pbbuttonsd understands some signals: .PP .in +12 .ti -12 SIGHUP 1 pbbuttonsd reloads its configuration and scans for input devices (see 'connecting/disconnecting new keyboards' section below). .br .ti -12 SIGINT 2 usually emitted by CTRL-C. pbbuttonsd will clean up used resources and terminates .ti -12 SIGUSR1 10 pbbuttonsd reinitializes hardware components under its control (for example trackpad and keyboard on powerbooks). Sending this signal is the same as sending the command REINIT except that IPC will not be used. This is for the complete paranoid guys ;-) .ti -12 SIGTERM 15 pbbuttonsd will clean up its resources and terminates .PP .SH KERNEL CONFIGURATION .ad b In kernels before 2.4.18-rc2-benh the brightness of the display was handled by the kernel itself. The brightness hotkeys were blocked by the kernel and there was no chance for a user space daemon like \fBPBButtonsd\fP to get the necessary information. .PP Nevertheless to get the brightness keys work with older kernels, a special kernel patch could be applied. Without this patch the daemon work as well with the little limitation not to control the display brightness. This is done by the kernel, so a possibly attached client wouldn't be informed on brightness level changes. .PP With kernel >= 2.6.18 a new SysFS interface to the backlight controller has been introduced. Unfortunately the kernel configuration become very confusing and misunderstanding. The Kernel has two options regarding the backlight in section "Device Drivers -> Macintosh Device Drivers": .PP .in +4 .ti -4 .B "Backlight control for LCD screens" .br .RI ( CONF_PMU_BACKLIGHT ) .PP .in +4 The help text says that this option enables generic backlight code. In fact without this option you won't get any backlight interface running, neither SysFS nor PMU, so say YES here. .PP .in +4 Unfortunately this option enables also code to control display brightness for older PowerBooks. That means the kernel itself controls the backlight brightness and interfere with any user space daemmon. The reference in the help text to use a user space daemon like pbbuttonsd is very kind, but The user space daemon is helpless if the kernel itself do the job. Nevertheless say \fBYES\fP to this option. .PP .in +4 .ti -4 .B "Provide legacy ioctl's on /dev/pmu for the backlight" .br .RI ( CONF_PMU_BACKLIGHT_LEGACY ) .PP .in +4 This option apears if backlight control has been enabled. This option adds some code to read and write the backlight level via the pmu driver (/dev/pmu). This interface was used by pbbuttonsd in the past and normaly it isn't needed any longer because the SysFS interface should make it redundant. .PP .in +4 Unfortunately the function to disable the direct kernel control of the backlight (for old PowerBooks, you remenber?) is part of the code added by this option. That means if you say YES to PMAC_BACKLIGHT but say NO to PMAC_BACKLIGHT_LEGACY, backlight will work but pbbuttonsd will never get the chance to gain control over the backlight controller. Kernel and user space daemon will interfere with eachother in an unacceptable way and that leads to unwanted results. .PP .in +4 This mixture of related but independent functions make it necessary to say \fBYES\fP to this option as well until the Kernel guys cleaned up this mess. .PP Finally your Kernel 2.6.18 configuration should look like this: .PP .ad l .in +4 [*] \fBB\fPacklight control for LCD screens .br .in +6 [*] \fBP\fProvide legacy ioctl's on /dev/pmu for the backlight .ad b .PP \fBPBButtonsd\fP will then automatically detect the best suited interface and use it. .SH GENERAL To get visual feedback from the adjustments a user made, a SystemV IPC interface is implemented to exchange messages with a client which for example displays the brightness and volume levels on a X Desktop. .PP If battery level is critically low pbbuttonsd has multiple mechanism to react on. The default behavior is to put the machine to sleep. Alternatively it is possible to send the init process the SIGPWR signal or to shut the machine down directly by a configurable script. Everything could be done to bring the machine down in a controlled way before the power management unit will switch the machine off the hard way due to lack of energy. This would prevent data losses and other problems. .PP To be able to shut down the machine pbbuttonsd must be running as 'root' because only the superuser is allowed to call the shutdown program or could send init requests to the init process. .PP .SH POWER POLICIES Since version 0.6 \fBPBButtonsd\fP supports so called power policies. With this policies the user can roughly define how the machine should handle the current load condition. If low current consumption, maximum performance or anything in between is most important at this time. Three policies are supported: 'powersave', 'custom' and 'performance'. .PP Each power source can be connected to a policy that becomes active as soon as the power source changes. Sometimes it may not desirable that the policy changes as soon as the power source changes. For this case the policy connected to this power source can be set to 'nochange'. .PP The pmcs script is responsible to put the set policy into practice. \fBPBButtonsd\fP will call this script among others every time the policy changes or has to be reset after periods of sleep or suspend. .PP .SH PBButtonsd AND SLEEP MODE (Suspend to RAM) \fBPBButtonsd\fP can't suspend the machine by its own. It uses kernel API functions for that. This means pbbuttonsd only asks the kernel: "Please suspend the machine". If the kernel do so and what happens after the request is up to the kernel. .PP Problems in this stage often occour due to old device drivers which don't support the suspend mode very well. The kernel API changed a lot here and it took a lot of time to adapt all the device drivers to the new interface. A solution could be to unload problematic device drivers before triggering sleep and reload them after wake up. \fBPBButtonsd\fP would support that via its Power Management Control Scripts (see /etc/power/). .PP The machine went to sleep after the main CPU has been switched off. Now, the computer is only controlled by the PMU which is a small (mostly 8bit) microprocessor with ROM (Read Only Memory) code. After the occourence of a dedicated event the PMU reactivates the main CPU and the machine wake up again. Those events could be: .PP .ad l .in +2 .ti -2 \- trigger a key on the keyboard .ti -2 \- open the cover (closing the cover doesn't wake up the machine) .ti -2 \- insert or remove an USB device .ti -2 \- timer .ti -2 \- other computers address the sleeping computer via LAN .ad b .PP The PMU needs to know which events should trigger a wake up procedure. The first two are explicitly enabled by the kernel before putting the machine to sleep. The third seems to be not maskable by the PMU, that means it will always wake up the computer. And the last two weren't supported at all yet on Linux. .PP While the key trigger event will unconditionally wake up the machine, the cover open event could be configured via the /proc/pmu/options interface. The following command will prevent your machine from waking up after the cover has been opened: .br .ad c echo > "lid_wakeup=0" > /proc/pmu/options .br .ad b .PP And the following command enable the wake up on "cover open" again: .br .ad c echo > "lid_wakeup=1" > /proc/pmu/options .br .ad b .PP Other wake up options are not foreseen by the kernel but may be added in the future. \fBPBButtonsd\fP is completely out of control until the kernel has finished its wake up procedure and gives control back to user space. .SH IBaM (Intelligent Battery Monitoring) IBaM is an advanced battery monitoring method, which uses statistical and adaptive linear methods to provide accurate estimations of battery time remaining or of the time needed until full recharge. .PP If IBaM is compiled into \fBpbbuttonsd\fP all internal time calculations based on kernel battery information would be replaced. Through the IPC signal TimeRemaining \fBpbbuttonsd\fP clients could benefit from accurate time estimations too. .PP Once started \fBPbbuttonsd\fP will collect battery data and saves them to disk for statistical analysis. The more data \fBpbbuttonsd\fP have to analyse the more accurate the time estimations will be. .PP Because at the very beginning \fBpbbuttonsd\fP has no data to analyse it is recommended to perform the initial procedure described below to fill the database with real data. If \fBpbbuttonsd\fP has to initialize IBaM's database during normal usage with arbitrary charge and discharge cycles, it might take longer to get reliable time predictions and accurate battery warnings. .SH IBaM INITIAL PROCEDURE This step is not necessary if you only update \fBPBButtonsd\fP. The updated version will continue to use the existing data. .PP At the very beginnig \fBpbbuttonsd\fP has no data to analyse and all estimations based on default values that won't be better than the kernel battery data. Therefore it is recommended to do one complete battery discharge/charge cycle after installing this version of \fBpbbuttonsd\fP with integrated IBaM to initially fill the database with real data. .PP Unplug AC power from your laptop. IBaM will now save the time intervals between changes in battery status. \fBPBButtonsd\fP will already use the data in this early stage and the battery warnings might be unreliable or won't occur at all. This is normal behaviour and will only happen during initial discharge cycle. .PP The most important time of a battery discharge cycle is the last minutes. During the last, let's say 20 minutes of battery time it is most important to get reliable and accurate battery warnings. But this aim could only be reached if the IBaM database contains data about the last minutes on battery. It is very important that the battery will be completely drained during the initial discharge cycle (until \fBpbbuttonsd\fP triggers sleep or the hardware switch off hardly, prepare for the second case to prevent data losses). .PP After your battery is completely drained, plug in your AC connector and continue working as usual. .PP IBaM is fully initialized now and it's prepared to show its full power and benefit. Depending on your load cases the time estimations will fluctuating a bit the first time. But after roundabout three battery charge/discharge cycles the predicted time and the battery warnings will be rather stable and reliable. .PP The database is updated continously so that any aging of the battery is taken into account. When \fBpbbuttons\fP tells you now, you still have 10 minutes left on battery, then you \fBwill\fP have 10 minutes left even if your battery is growing old and the capacity decreases. .SH IBaM and multiple batteries Currently IBaM is not able to handle multiple batteries seperatly. It always sums up all batteries in system and calculates with the result. Therefore the IBaM statistics will be influenced if you change your battery configuration (adding or removing batteries). .PP Battery warnings will be slightly inaccurate after changing the battery configuration. If you run a long time with a unchanged configuration this changes would hardly be significant or not seen at all. The scenario described in the paragraph below is only likely if you did only a few charge/discharge cycles. .PP After plugging in an additional battery pbbuttonsd might show low battery warnings too early and vica versa after you removed your second battery. Especially after you decreased overall battery capacity by removing a second battery, \fBpbbuttonsd\fP might get aware of low battery condition too late. As result the machine will switch off the hard way. To prevent data losses in this case you should not wait for the last warning before you plug in the AC connector. IBaM will resync itself automatically during the next charge/discharge cycles. .PP IBaM works best if you use always the same battery configuration (one or two batteries). .SH CONFIGURATION FILE \fBPBButtonsd\fP uses a configuration file for setting up all it's features. This file is usually located in \fIetc\fP. From version 0.5.4 on \fBPBButtonsd\fP is also able to write the current configuration to a file. .PP To make this solution as secure as possible a batch of security checks will be performed until configuration writing would be allowed: .PP .ad l .in +3 .ti -3 1. The owner of the writable configuration file must be the same as the owner of pbbuttonsd process. .ti -3 2. The configuration file is only writable by the owner. .ad b .PP If any of this conditions failed, writing of the configuration file would be disabled. .PP .SH CONNECTING / DISCONNECTING NEW INPUT DEVICES \fBPBButtonsd\fP uses for its input the event hander in /dev/input/event%, which handles also hot-plugable devices such as USB or ADB (Mac only) input devices. \fBPBButtonsd\fP scanns those devices at start time and work with the found devices. .PP Before Hotplug, the only way for pbbuttonsd to realize newly connected devices is to regularly scan the event devices. Unfortunately there is no summary keyboard device as there is for mice and hotplug isn't available for kernel 2.4 and before. Because external USB input devices become quite common, the autorescan feature is enabled by default. .PP If your hard disk is prevented from spinning down due to the regular event device scans, you might want to disable this feature. This could be done in the configuration file. In this case you have to trigger a rescan manually after connecting new input devices. Scanning is initiated by sending the HUP signal to the server: .PP .ad c kill \-HUP \`cat /var/run/pbbuttonsd.pid\` .PP .ad b Be aware that the configuration file will also be reloaded in this case. .PP .SH OPTIONS \fBPBButtonsd\fP accepts the following options: .TP \fB\-c\fR, \fB\-\-configfile\fR=\fICONFIGFILE\fR Use an alternative configuration file, default is /etc/pbbuttonsd.conf. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of \fBPBButtonsd\fP. .TP .B \-q, \-\-quiet Suppress the welcome message. Some startup scripts want to have full control about their output. .TP \fB\-d\fR, \fB\-\-detach\fR[=\fIPIDFILE\fR] Start \fBPBButtonsd\fP as background process. optional an alternative pidfile. The daemon writes it's pid into this file. .br In this mode we can't assume to have a valid terminal so all outputs will be blocked and no error message will be printed. .TP .in +7 If you don't use this flag and start \fBPBButtonsd\fP as background process by adding a \'&\' to the command line, please redirect \'stdout\' and \'stderr\' to a valid file as well (or at least to /dev/null if you don't need error output). If you don't do so \fBPBButtonsd\fP may be stopped by the shell because of using invalid file descriptors. .SH "SEE ALSO" pbbuttonsd.conf (5), gtkpbbuttons (1) .SH AUTHOR Matthias Grimm. pbbuttonsd-0.7.9/pbbuttonsd.conf.50000644000175000017500000010767210507663312014052 00000000000000.\" hey, Emacs: -*- nroff -*- .\" pbbuttons is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" .TH PBBUTTONSD.CONF 5 "September 28, 2006" .\" Please update the above date whenever this man page is modified. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins (default) .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pbbuttonsd.conf \- configuration file for pbbuttonsd. .SH DESCRIPTION \fBpbbuttonsd.conf\fP tells pbbuttonsd how the user wants it to work and is usually found as /etc/pbbuttons.conf. .PP The structure is always: .PP \fBkeyword\fR = \fIvalue\fR [;|# comment] .PP Empty lines and lines starting with a number-sign (#) will be ignored. They could be used to make the configuration file easily readable and to store comments. .PP All keywords and options are case insensitive and will internally be converted to lower case. In some cases like pathnames this behavior could be obstructive so quoting will impede it. Quoted strings will be taken as they are. .PP If the argument contains spaces it has to be enclosed in quotation marks. Both single and double quotation marks are allowed but don't mix them up. For example if you start quoting with a single quotation mark you must also end with one. In this case double quotation marks will also be quoted. .PP It isn't necessary to define every option or a configfile at all because there are useful default's built into the program. .PP The config file is optically split up into sections to group options which belong together. The section headlines are corresponding to the pbbuttonsd modules and are simple comments. They are for readers help only. Each module has a config file section. The available options depends on the modules functionality. .SH KEYCODE DEFINITIONS Some of the options need \fBkey\fP definitions. A \fBkey\fP could be defined as follows. .PP The key definition could have multiple parts. The first is the keycode as it could be found in ..include/linux/input.h. This keycode at least must be given otherwise the built-in default value will be used. .PP The other parts are the optional modifiers that could be combined with the keycode to trigger the certain function. The \fIshift\fR, \fIalt\fR and \fIctrl\fR modifier are supported. They are added to the keycode with a plus-sign (+). The sequence doesn't matter. .PP .ad l .in +9 .ti -9 EXAMPLE: 225 + shift + ctrl .br This means the key 225 has to be pressed together with \fIshift\fR and \fIctrl\fR to trigger the function. .ad b .SH GENERAL .TP \fBuserallowed\fR = \fIusername\fR (default: none) Lets talk about security. PBButtonsd accepts messages through the kernel IPC-message protokoll without verification who sent the message. This doesn't seem to be a problem because IPC is only used locally and can't be accessed directly over network. Only those options which could be abused to get root rights were protected and could only be changed by the owner of pbbuttonsd's process. .PP .in +7 This didn't satisfy some users so I implemented this option to give those users more control who should be allowed to send messages to pbbuttonsd. If this option is set only the named user (only one possible at the moment) is allowed to change pbbuttonsd's options via the IPC-interface. Messages from all other users (root included) will be rejected. Query the current configuration is further possible for all users. .PP .in +7 To completely disable the possibility to change options via IPC name a user that doesn't exist. In this case no logged-in user is allowed to change options. Setting the option in the config file and 'kill \-HUP ' would then be the only way to change options on the fly then. .TP \fBautorescan\fR = \fI[yes | no]\fR (default: yes) \fBPBButtonsd\fP uses the kernel input layer and its event devices to get input from the keyboards and mice. This layer support all types of input devices also those which will be connected or removed later during operation. Normally \fBpbbuttonsd\fP scans the event devices once at startup and uses all keyboards and mice found at that time but most people wanted to be able to plug-in or remove external input devices at any time. .PP .in +7 With this option set to 'yes' \fBpbbuttonsd\fP would scan for new input devices on a regular time basis. Due to the continuous access to the /dev/input/event% device files, spin-down functions of hard disks might be influenced. If you have problems with this, you could disable this feature and trigger a rescan by hand when necessary. .PP .in +7 To initiate a rescan by hand send a HUP signal to the server after a new input device has been connected or removed: .PP .in +7 .ad c kill \-HUP \`cat /var/run/pbbuttonsd.pid\` .br .ad l .TP \fBCmdTimeout\fR = \fItime in seconds\fR (default = 8) \fBPbbuttonsd\fR is able to launch user defined scripts and it uses some external helper utilities. This scripts and utilities were started as separate processes with their own environment independent from \fBpbbuttonsd\fR's. During a helper process is active \fBpbbuttonsd\fR's process is blocked and waits for the child process to end. Without security mechanism this could lead into an knocked out \fBpbbuttonsd\fR due to a hanging script. To prevent such a situation \fBpbbuttonsd\fR has an eye on its child processes and if they consume too much time they will be killed by the parent process. .PP .in +7 It was very difficult in the past to define a correct timeout value because of a huge amount of different scripts written and used by users. With this option the individual timeout value in seconds can be defined. Be careful with high values because an error in your script can block \fBpbbuttonsd\fR for a long time. The minimum value is 1 second. values below this will force a one second timeout. .SH MODULE POWERSAVE This module does all the hardware independent power saving stuff. .PP \fBonAC_Policy\fR = \fIpolicy\fR (default: performance) .br \fBonBattery_Policy\fR = \fIpolicy\fR (default: powersave) .in +7 This options set the power management policies that should become active after power source has changed. following policies were supported: .PP .in +9 'nochange' current policy won't be changed .br 'powersave' minimum power consumption .br 'custom' user defined .br 'performance' maximum system performance .PP .in +7 The pmcs script does all actions needed to activate the options according the selected power policy. .PP \fBonAC_TimerAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_TimerAction\fR = \fIaction\fR (default: suspend-to-ram) .in +7 After some time without user action, so called idle time, the timer emits an event. Pbbuttonsd can connect an action to this event that would be executed when this event occours. Four actions are possible (see below). This option can independently configured for AC or battery power source. .PP .in +7 \fInone\fR .br Nothing will be done. If onXX_TimerAction was set to 'none' the timer event would be ignored. .PP .in +7 \fIsuspend-to-ram\fR .br This action suspends the machine and conserves the memory content in RAM. This mode is also known as 'sleep' and works only if it is supported by the hardware. .PP .in +7 \fIsuspend-to-disk\fR .br This action suspends the machine and save the memory content to hard disk. This mode is controlled by the kernel and is supported since kernel version 2.6. A backport for kernel 2.4 is also available. .PP .in +7 This action works a little bit different to suspend-to-ram. If the event suspend-to-ram occours the PMCS script will be executed to perform preliminary jobs. Suspend-to-ram is then triggered by pbbuttonsd. .PP .in +7 If the event suspend-to-disk occurs the PMCS script will also be executed but in contrast to suspend-to-ram it has also to initiate suspend mode after all preliminary jobs are done. Pbbuttonsd doesn't expect the script to return. .PP .in +7 \fIblankscreen\fR .br If this action was configured the screen would be switched off. The computer will continue to run. This could be helpful in some cases where for example the machine must be reachable over a network without anyone working with it directly. .PP .in +7 This mode is the fallback action if suspend-to-ram is not supported by the hardware. .PP .in +7 Attention: With a switched-off display you might not be able to see that the computer is still running but it continues to consume power. To give you a hint the computer will play a beep every 30 seconds as a reminder. .PP .in +7 \fIshutdown\fR .br This action triggers a machine shutdown. The PMCS script is called to initiate the shutdown. Usually this is done with the \'halt\' command. .PP \fBonAC_CoverAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_CoverAction\fR = \fIaction\fR (default: suspend-to-ram) .br .in +7 This options define the action to perform if cover has been closed or opened. For possible actions and it's description please see onXX_TimerAction. It could independently configured for AC or battery power source. .PP .in +7 This options will only work if \fBpbbuttonsd\fP was compiled without pmud support so that \fBpbbuttonsd\fP has control over the cover. .PP .in +7 Attention: With a switched-off display you might not be able to see that the computer is still running but it continues to consume power. To give you a hint the computer will play a beep every 30 seconds as a reminder. .PP \fBonAC_KeyAction\fR = \fIaction\fR (default: suspend-to-ram) .br \fBonBattery_KeyAction\fR = \fIaction\fR (default: suspend-to-ram) .br .in +7 This options define the action to perform after the sleepkey has been triggered. For possible actions and it's decription please see onXX_TimerAction. It could be independently configured for AC and battery power source. .PP \fBonAC_SuspendTime\fR = \fIvalue\fR (default: 3000 = 5 minutes) .br \fBonBattery_SuspendTime\fR = \fIvalue\fR (default: 3000 = 5 minutes) .br .in +7 This option sets the idle time in 1/100 seconds after the machine should be put to sleep or the display should be switched off. It could independently controlled for AC or battery power source. .PP .in +7 Set this value to 0 to disable sleep when idle. .PP \fBonAC_DimTime\fR = \fIvalue\fR (default: 600 = 1 minutes) .br \fBonBattery_DimTime\fR = \fIvalue\fR (default: 600 = 1 minutes) .br .in +7 This option sets the idle time in 1/100 seconds after the display should be dimmed to minimum level. It could independently controlled for AC or battery power source. .PP .in +7 Set this value to 0 to disable display dimming. The display brightness won't change automatically and keep its value for unlimited time. .TP \fBSleepKey\fR = \fIkey\fR (default: 116) Key to trigger sleep mode or blank the screen, corresponding to the current configuration and the machine's abilities. .TP \fBSleepKeyDelay\fR = \fItime in milliseconds\fR (default: 0) This option sets the delay time used for an additional validity check of the sleep key to prevent unwillingly triggered sleeps due to small keyboards. The key must be pressed for longer than the given time period to trigger sleep. The value must be given in milliseconds, for example to set a delay time of 2 seconds set the delay time to 2000. If the given value is zero, sleep mode would be entered immediately. .PP .in +7 This option might be dangerous if the power key is used to trigger sleep mode, because the power key has a second hard-wired meaning. If you press the power key for a long time, the machine will be switched off completely. This is an emergency feature of the Macintosh hardware. Therefore it could be very tricky to press the power key long enough to trigger sleep and release the key just before the hardware switched power off. Use this option with care. .PP \fBBWL_First\fR = \fIminutes\fR (default: 20) .br \fBBWL_Second\fR = \fIminutes\fR (default: 10) .br \fBBWL_Last\fR = \fIminutes\fR (default: 3) .br .in +7 This options set the battery warn levels in minutes. If the remaining time on battery falls below one of the above values the appropriate battery warning would be displayed (gtkpbbuttons or something similar must be running to see them). .PP .in +7 If the time remaining reaches 'zero' the non-configurable battery warnlevel 4 is entered, which causes the machine to shutdown immediately. The clients will be noticed by a message about the coming shutdown. .PP .in +7 Defining new warn levels be aware that you fulfill following conditions: .ad l .in +2 .ti -2 \- BWL_First > BWL_Second > BWM_Last > 0 .ti -2 \- the difference of two adjacent warnlevels must be greater than 6 minutes. .ad b .PP .in +7 Violation of this conditions will result in an error message and fall back to default values. .TP \fBEmergencyAction\fR = \fI[action]\fR (default: sleep) If the battery is critically low the machine have to be set into a safe state. This could be done on different ways. Which way is the right for your system could be configured with this option. There are three actions possible: .PP .in +7 \fIsleep\fR - The machine would be forced to sleep mode. This action gives security only for a short period because also in sleep mode the computer consumes power and continue to discharge the battery but slower. This gives you enough time to plug in the AC connector to recharge the battery and go on with your work. .br This action could only be chosen if the machine supports sleep mode. If not this action defaults to \fIsignal\fR. .PP .in +7 \fIsignal\fR - A SIGPWR signal would be sent to the INIT process. The further actions depend on your system configuration in /etc/inittab. Please check your installation to be sure the SIGPWR does what you want. Pbbuttonsd won't do anything else to prevent data losses due to battery voltage collapse. .br Pbbuttons tried first to send the init process the signal with the new init request through /dev/initctl. If that fails it tried the old method through /etc/powerstatus. If that fails too and the machine supports sleep mode this action defaults to \fIsleep\fR, otherwise it defaults to \fIcommand\fR. .PP .in +7 \fIcommand\fR - This is the former standard action in case of critically battery power. a command would be executed which usually shut down the computer safely. The \fIscript_pmcs\fR (see below) will be called with argument 'emergency' in this case. .TP \fBHeartbeatBeep\fR = \fI[yes | no]\fR (default: yes) \fBPbbuttonsd\fR can be configured to switch off the display instead of entering sleep mode even though the lid was closed. As configured in such a way the machine only to switch off its display after sleep timeout and continue running on full power. If in this situation also the hard disk spun down, no sign of computer's life would exist anymore and the machine looks like a switched off computer. .PP .in +7 This may lead to unexpectedly drained batteries or needlessly long idle runs because the computer looks like already switched-off and you may then forget to switch it off really. Due to \fBpbbuttonsd\fR's smart power management functions nothing harmful can happen to the computer or to your valuable data. So this is a convenience option. .PP .in +7 To have always a sign of life from the computer \fBpbbuttonsd\fR will play a beep every roundabout 30 seconds if the computer was still running with switched-off display. Someone will take the risk to get rid of this nice little beep (others called it annoying). For those this option was implemented. It will switch off the heartbeat beep if set to 'no'. .PP .in +7 Usual cases when the heartbeat beep will occur are using your PowerBook with closed lid connected to an external keyboard and monitor or access your computer remotely via the network. In the second case the heartbeat beep will first occur with delay of the configured sleep timeout. .TP \fBScript_PMCS\fR = \fIcommand\fR (default: none) This option sets the script name that should be called at following events: change of power policy, change of power source, change of suspend state and if configured at low battery (emergency). For security reasons this script should only be readable by the user who runs pbbuttonsd (usually root) and not be writable at all. .PP .in +7 Up to three '%s' could be placed in the command string. The first '%s' will be replaced with the action (see etc/power/README for action list), the second with the current powersource ('ac' or 'battery') and the third with an action depending option. (for example the action 'suspend' may get the option 'ram'. This means suspend-to-ram). .TP \fBIBAM_DataDir\fR = \fIdirectory\fR (default: /var/lib/ibam) This directory is used to store statistical data measured during battery charge and discharge time. This data is used by the new IBAM algorithm for reliable and accurate battery and charge time predictions. .PP .in +7 This option would only be available if pbbuttonsd was compiled with IBAM support. .TP \fBCPULoad_sleeplock\fR = \fI[yes | no]\fR (default: no) With option enabled high CPU loads prevent the machine from entering sleep mode. Every second the current CPU load will be calculated and compared with a minimum level. Is the current CPU load below this level for a certain period of time the sleep lock will be opened and the machine is allowed to enter sleep mode. Jumps the CPU load over the border line the sleep lock will be closed immediately and the time measurement starts from the beginning. .TP \fBCPULoad_min\fR = \fIpercent\fR (default: 20) With this Tag the minimum CPU load level could be set. .TP \fBCPULoad_period\fR = \fIseconds\fR (default: 20) With this option the period of low CPU load time in seconds could be set. .TP \fBNETLoad_sleeplock\fR = \fI[yes | no]\fR (default: no) With option enabled high net loads prevent the machine from entering sleep mode. Every second the current net load will be calculated and compared with a minimum level. Is the transfer rate in bytes per second below this level for a certain period of time the sleep lock will be opened and the machine is allowed to enter sleep mode. Jumps the net load over the border line the sleep lock will be closed immediately and the time measurement starts from the beginning. .TP \fBNETLoad_min\fR = \fItraffic\fR (default: 4096 Bytes/s) With this Tag the minimum transfer rate in bytes per second could be set. .TP \fBNETLoad_period\fR = \fIseconds\fR (default: 20) With this Tag the period of low net load time in seconds could be set. .TP \fBNETLoad_device\fR = \fInetdevice\fR (default: eth0) With this option the network device to observe could be defined. Up to now only one network device could be set and observed. .SH MODULE DISPLAY This module controls the light sources inside the laptop. Mostly this is the LCD backlight but recent computers come with an additionally keyboard illumination which is also controlled by this module. The module works hardware independently. .TP \fBLCD_Brightness\fR = \fIvalue\fR (default: none) With this option the initial brightness level of the LCD backlight in percent could be set. This value becomes active during \fBpbbuttonsds\fP start up phase. .PP .in +7 Was this option commented out, pbbuttonsd wouldn't change the LCD brightness during start up. The display stays as bright as it has been before pbbuttonsd was started. Comment this option out if you want this. .TP \fBLCD_FadingSpeed\fR = \fIvalue\fR (default: 0) \fBPBButtonsd\fP is able to dim and recover the display brightness smoothly. Set the value to zero, blending would be disabled. In this case \fBPBButtonsd\fP would work as used to. .PP .in +7 With a value greater than null fading will be activated. Fill in the time a full dim (from lowest to highest brightness level or vica versa) should last. \fBPBButtonsd\fP will take into account that some backlight controllers are not as fine grained controlable as others and adjusts its internal timing to fulfill your request as best as possible. .PP .in +7 The time value must be given in miliseconds (1/1000th of a second). .TP \fBLCD_AutoAdjust\fR = \fIbool\fR (default: yes) Enable automatic LCD brightness adjustment. The brightness of the LCD backlight will be automatically adjusted depending on ambient light. .br This option work only on laptops with an ambient light sensor as for eg. the 17" Aluminum PowerBook from Apple. If such a sensor isn't present this option will be ignored. .PP \fBLCD_AutoAdjMin_Bat\fR = \fIvalue\fR (default: 1) .br \fBLCD_AutoAdjMax_Bat\fR = \fIvalue\fR (default: 8) .br \fBLCD_AutoAdjMin_AC\fR = \fIvalue\fR (default: 1) .br \fBLCD_AutoAdjMax_AC\fR = \fIvalue\fR (default: 15) .br .in +7 If automatic brightness adjustment was enabled, this parameters could be used to limit the working range of the automatic regulator depending on the power source active. This could be used to prevent the automatic regulator to drive the display brighter than necessary to save power if running on battery. .TP \fBLCD_IllumUpKey\fR = \fIkey\fR (default: KEY_BRIGHTNESSUP) Use alternative key to increase LCD illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to maximum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition must not contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBLCD_IllumDownKey\fR = \fIkey\fR (default: KEY_BRIGHTNESSDOWN) Use alternative key to decrease LCD illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to minimum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBKBD_Brightness\fR = \fIvalue\fR (default: 0) With this option the initial brightness level of the keyboard illumination on percent could be set. The value becomes active during \fBpbbuttonsds\fP start up phase. Comment this option out if you don't want this. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_OnBrightness\fR = \fIvalue\fR (default: 6%) If you switched on your keyboard illumination with the foreseen on/off key the keyboard illumination level would switch to 6% by default. With this option you could set a different start value in percent. .PP .in +7 This value is only valid during startup because the level will follow all manual and automatic brightness changes during program runtime. So if you set this option to 50% and press the keyboard-illumination-up key twice the on/off key would switch beween 62% and 0 because you manually modified the start value. The same happens if the automatic adjustment algorithm changes the keyboard brightness. .br The initial value will only have an effect if automatic keyboard illumination adjustment is disabled. .TP \fBKBD_FadingSpeed\fR = \fIvalue\fR (default: 0) \fBPBButtonsd\fP is able to dim and recover the keyboard illumination smoothly. Set the value to zero, blending would be disabled. .PP .in +7 With a value greater than null fading will be activated. Fill in the time a full dim (from lowest to highest brightness level or vica versa) should last. \fBPBButtonsd\fP will take into account that some backlight controllers might not as fine grained controlable as others and adjusts its internal timing to fulfill your request as best as possible. .PP .in +7 The time value must be given in miliseconds (1/1000th of a second). .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_AutoAdjust\fR = \fIbool\fR (default: yes) Enable automatic keyboard brightness adjustment. The brightness of the keyboard illumination will be automatically adjusted depending on ambient light. .PP .in +7 This option work only on laptops with an ambient light sensor as for example the 17" Aluminum PowerBook from Apple. If such a sensor isn't present this option will be ignored. Also support for keyboard illumination is needed. .TP \fBKBD_IllumUpKey\fR = \fIkey\fR (default: KEY_KBDILLUMUP) Use alternative key to increase keyboard illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to maximum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition must not contain \fIshift\fR. It will be ignored, if mentioned. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_IllumDownKey\fR = \fIkey\fR (default: KEY_KBDILLUMDOWN) Use alternative key to decrease keyboard illumination level. .PP .in +7 In conjunction with \fIshift\fR the brightness will be set to minimum level. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBKBD_IllumOnKey\fR = \fIkey\fR (default: KEY_KBDILLUMTOGGLE) Use alternative key to switch keyboard illumination on/off. \fBPbbuttonsd\fR tried to remember the brightness level but on some machines the currently set level can't be evaluated so that the keyboard illumination may start with minimum level. .PP .in +7 This option work only on machines that support keyboard illumination. .TP \fBdev_framebuffer\fR = \fIdevice\fR (default: /dev/fb0) This option defines the framebuffer device to be used for blanking the screen. .TP \fBUseFBBlank\fR = \fI[yes | no]\fR (default: no) In the case only the display should be blanked instead of putting the machine into sleep mode, the framebuffer device could switch the whole display off. If you want that set this option to 'yes'. If not only the backlight will be switched off on blank. .PP .in +7 Recent kernel versions will do this automatically because the backlight controller is part of the framebuffer or graphics card driver. If you relialize any problems with the backlight, like the diplay remains dark after wakeup or cover open, set this option to \'no\'. .TP \fBDimFullyDark\fR = \fI[yes | no]\fR (default: no) Normally the display brightness will be dimmed to the lowest possible value if the machine is idle for some time. This will save a lot of power and keep the user able to loom what happened on the screen. .PP .in +7 With this option set to yes the display will be dimmed to fully darkness. This was requested by users who want to use this function as simple screensaver. .PP .in +7 Please keep in mind that switching the backlight of a laptop to often will decrease its lifetime so the author of pbbuttons doesn't recommend to use this option. Use it at your own risk. .PP \fBLCD_Threshold\fR = \fIvalue\fR (default: 94) .br \fBKBD_Threshold\fR = \fIvalue\fR (default: 28) .in +7 If there was an ambient light sensor available keyboard and LCD illumination levels could automatically adjusted. If enabled the automatic adjustment will work if the ambient light falls below a certain threshold. This threshold in percent can be defined with this options independently for LCD backlight and keyboard illumination. The sensors full range is always 100%. .PP .in +7 To avoid a negative feedback from the LCD backlight to the ambient light sensors don't set one of this values to 100%. .TP \fBCRT_MirrorKey\fR = \fIkey\fR (default: KEY_F7 + CTRL) Set the key to switch the external video output on/off. This will only work if the framebuffer device of the used graphics card support this feature. \fBPbbuttonsd\fR will only send an IOCTL to the framebuffer like m3mirror from Ben Herrenschmidt does. .SH MODULE MIXER This module controls a mixer device. .TP \fBSoundSystem\fR = \fIname\fR (default: OSS) If support for more than one soundsystem is compiled into pbbuttonsd this option decides which one is used. Currently two soundsystems are supported: .br \- Open Sound System (OSS) and .br \- Advanced Linux Sound Architecture (ALSA). .PP .ad l .in +12 .ti -5 \fInone\fR mixer control disabled. .PP .ad l .in +12 .ti -5 \fIauto\fR pbbuttonsd automatically detects the soundsystem to be used. First it will check for ALSA and if it couldn't be found it checks for OSS. .PP .ad l .in +12 .ti -5 \fIOSS\fR The OSS mixer module will be activated. This will also work for ALSA's OSS emulation mode. .PP .in +12 .ti -5 \fIALSA\fR The native ALSA mixer will be activated. .TP \fBOSS_Device\fR = \fIdevicename\fR (default: /dev/mixer) Use an alternative mixer device. This option will be ignored if soundsystem is set to ALSA. .PP .in +7 This device is used to control the sound volume or to mute/unmute the sound channels. .TP \fBOSS_Channels\fR = \flchannels\fR (default: volume) This option defines the OSS mixer channels which pbbuttonsd should control. Every combination is valid nevertheless if the combination makes sense or not. Valid channel names are: volume, bass, treble, synth, pcm, speaker, line, mic, cd, imix, altpcm, reclev, igain, ogain, line1, line2, line3, digital1, digital2, digital3, phonein, phoneout, video, radio and monitor. .PP .in +7 The first channel in the list is the master, all following are slaves. Only the volume level of the master channel is read back to adjust pbbuttonsd's internal volume reference. Slave channels will be set to master channel's volume on every volume change from pbbuttonsd. .TP \fBALSA_Card\fR = \fIcardname\fR (default: "default") Use an alternative sound card. This option will be ignored if soundsystem is set to OSS. .PP .in +7 This card is used to control the sound volume or to mute/unmute the sound channels or elements as they are called from ALSA. .TP \fBALSA_Elements\fR = \flelements\fR (default: Master) This option defines the ALSA mixer elements (ALSA) which pbbuttonsd should control. Every combination is valid nevertheless if the combination makes sense or not. Valid element names for ALSA could be queried from the program amixer. .PP .in +7 The first element in the list is the master (not to confuse with the ALSA element \'Master\'), all following are slaves. Only the volume level of the master element is read back to adjust pbbuttonsd's internal volume reference. Slave elements will be set to master element's volume on every volume change. .TP \fBVolume\fR = \fIvalue\fR (default: 50) With this option the initial volume level could be set. Every time \fBpbbuttonsd\fP was started the volume level would be set to this value. Comment this option out if you did't want that. .TP \fBSpeakers_muted\fR = \fI[yes | no]\fR (default: no) If set to 'yes' the speakers would be muted at startup. .TP \fBvolumeupkey\fR = \fIkey\fR (default: KEY_VOLUMEUP) Use alternative key to increase volume. .PP .in +7 In conjunction with \fIshift\fR the volume will be increased by 10. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBvolumedownkey\fR = \fIkey\fR (default: KEY_VOLUMEDOWN) Use alternative key to decrease volume. .PP .in +7 In conjunction with \fIshift\fR the volume will be decreased by 10. This second function is statically bound to the modifier \fIshift\fR so that the key definition mustn't contain \fIshift\fR. It will be ignored, if mentioned. .TP \fBmutekey\fR = \fIkey definition\fR (default: KEY_MUTE) Use alternative key to mute/unmute. .TP \fBmixerinitdelay\fR = \fI[yes | no]\fR (default: no) If this option was given, \fBpbbuttonsd\fP wouldn't setup the mixer at startup. That makes it possible to start \fBpbbuttonsd\fP without loaded sound module, which could save battery power on some machines. .PP .in +7 If any time later the sound module was loaded, it would be enough to press a volume hotkey and the mixer control will be initialized and ready to work. If any of the volume hotkeys were pressed without a working sound module, a kernel with the kernel module loader compiled in, would try to load the sound module automatically. If he succeeded, the volume control would work as usual, otherwise \fBpbbuttonsd\fP would try it again next time a volume hotkey is pressed. .PP .in +7 It is also safe to unload the sound module again. .SH MODULE CDROM This module controls a CDROM drive. .TP \fBdev_cdrom\fR = \fIdevicename\fR (default: /dev/cdrom) Use an alternative cdrom device. The device will be checked but no error would be reported if it did't exist because of a possibly not plugged-in CDROM drive. .TP \fBejectcdkey\fR = \fIkey\fR (default: KEY_EJECTCD) Use alternative key to eject a CDROM. .TP \fBejectcdkeydelay\fR = \fItime in milliseconds\fR (default: 0) This option sets the delay time used for an additional validity check of the eject key to prevent ejects of the CD by mistake due to small keyboards. The key must be pressed for longer than the given time period to eject the CDROM. The value must be given in milliseconds, for example to set a delay time of 2 seconds set the delay time to 2000. If the given value is zero, the CD-Drive reacts immediatly. .SH MODULE PMAC This module contains all the hardware dependent stuff for Apple PowerBooks. .TP \fBdev_adb\fR = \fIdevicename\fR (default: /dev/adb) Use an alternative ADB device. .PP .in +7 This device is used to read battery status and some other information. It is also used to control the keyboard and trackpad settings. .TP \fBdev_pmu\fR = \fIdevicename\fR (default: /dev/pmu) Use an alternative PMU device. .PP .in +7 This device is used to control sleep mode and the backlight device. .TP \fBTPModeUpKey\fR = \fIkey\fR (default: ALT+KEY_BRIGHTNESSUP) Use alternative key to cycle forward through the trackpad operating modes. These modes are: notap, tap, drag, lock. Please see your computer manual to learn what those modes mean and how they work. .TP \fBTPModeDownKey\fR = \fIkey\fR (default: ALT+KEY_BRIGHTNESSDOWN) Use alternative key to cycle backward through the trackpad operation modes. .TP \fBTPMode\fR = \fItrackpad mode\fR (default: none) If this option was set, the given trackpad mode will be setup during startup otherwise the current mode won't be changed. Following modes are supported: notap, tap, drag and lock. .TP \fBNoTapTyping\fR = \fI[yes | no]\fR (default: no) Usually the trackpad would stay in it's current mode if the keyboard was used. With this option set the trackpad would be configured in \'notap-mode\' as soon as the first key is hit. This will prevent cursor movement through accidently touching the trackpad while typing. .PP .in +7 \fBWARNING:\fR It was reported that computers using this option and recent kernels might freeze once and again. The reason is not known yet. Therefore please use this option with care. .PP .in +7 This option is only usefull if \fBmouseemu\fR is not running. \fBMouseemu\fR offer this and some more trackpad related functions. Set this option to \'no\', if you have \fBmouseemu\fR running. .TP \fBKBDMode\fR = \fIkeyboard mode\fR (default: none) If this option was set, the given keyboard mode will be setup during startup otherwise the current mode won't be changed. Following modes are supported: fkeysfirst and fkeyslast. .TP \fBbatlog\fR = \fIbattery log mode\fR (default: none) Setting this option to one of the following values activates some sort of battery data logging. .PP .ad l .in +13 .ti -6 \fBnone\fR disable battery data logging .PP .in +13 .ti -6 \fBcycle\fR Pbbuttonsd counts the battery cycles so that it would be possible to estimate batteries lifetime. Usually Li-Ion batteries allow 500 charge/discharge cycles. .PP .in +13 .ti -6 \fBlog\fR Pbbuttonsd writes detailed battery data like current charge, voltage, time remaining, etc. on a regularly time basis to a log file. Also charge/discharge cycles will be counted and displayed. Each charge/discharge cycle gets its own battery log file. This data should allow investigation of a battery ageing. This option includes the \fBcycle\fR option. .SH "SEE ALSO" pbbuttonsd (1) .SH AUTHOR Matthias Grimm. pbbuttonsd-0.7.9/pbbuttonsd.conf0000644000175000017500000000707710506743040013701 00000000000000# Configuration file for PBButtonsd >= Version 0.5 # for complete list of options please see pbbuttonsd.conf man-page # [SYSTEM] #userallowed = "paranoid" ; user who is allowed to use IPC autorescan = yes ; automatic rescan of event devices CmdTimeout = 8 # [MODULE POWERSAVE] onAC_policy = performance ; nochange, performance, custom or powersave onAC_TimerAction = none ; none, suspend-to-ram, suspend-to-disk, blankscreen onAC_CoverAction = suspend-to-ram onAC_KeyAction = suspend-to-ram ; SleepKey onAC_SuspendTime = 0 ; time in 1/10 seconds onAC_DimTime = 0 ; time in 1/10 seconds onBattery_policy = powersave onBattery_TimerAction = suspend-to-ram ; none, suspend-to-ram, suspend-to-disk, blankscreen onBattery_CoverAction = suspend-to-ram onBattery_KeyAction = suspend-to-ram ; SleepKey onBattery_SuspendTime = 3000 ; time in 1/10 seconds onBattery_DimTime = 600 ; time in 1/10 seconds SleepKey = 116 SleepKeyDelay = 0 ; values > 0 may be dangerous, if the power key is used to trigger sleep BWL_first = 22 ; first battery warnlevel, time in minutes BWL_second = 10 ; second battery warnlevel, time in minutes BWL_last = 3 ; last battery warnlevel, time in minutes Script_PMCS = "/etc/power/pmcs-pbbuttonsd %s %s %s" EmergencyAction = sleep ; action, if battery is critically low HeartbeatBeep = no ; beep, if nothing else showed that the computer lives CPULoad_sleeplock = yes CPULoad_min = 20 ; value in percent CPULoad_period = 20 ; time in seconds NETLoad_sleeplock = yes NETLoad_min = 4096 ; traffic in Bytes/s NETLoad_period = 20 ; time in seconds NETLoad_device = "eth0" # [MODULE DISPLAY] #LCD_Brightness = 75 ; initial LCD brightness level in percent LCD_FadingSpeed = 0 ; 0 = no smooth fading LCD_AutoAdjust = yes ; only on Aluminum PowerBooks LCD_IllumUpKey = 225 LCD_IllumDownKey = 224 LCD_Threshold = 94 LCD_AutoAdjMin_Bat = 2 ; autoadjust parameter LCD_AutoAdjMax_Bat = 7 LCD_AutoAdjMin_AC = 1 LCD_AutoAdjMax_AC = 15 #KBD_Brightness = 0 ; initial keyboard illumination level in percent KBD_OnBrightness = 35 ; initial level in percent if KBD on/off key is pressed KBD_FadingSpeed = 0 ; 0 = no smooth fading KBD_AutoAdjust = yes ; only on Aluminum PowerBooks KBD_IllumUpKey = 230 KBD_IllumDownKey = 229 KBD_IllumOnKey = 228 KBD_Threshold = 28 ; only on Aluminum PowerBooks dev_FrameBuffer = "/dev/fb0" UseFBBlank = no DimFullyDark = no CRT_MirrorKey = 65 + ctrl # [MODULE MIXER] SoundSystem = auto ; none, auto, OSS or ALSA #Volume = 50 ; initial volume level in percent Speakers_muted = no ; mute after startup? VolumeUpKey = 115 VolumeDownKey = 114 MuteKey = 113 OSS_Mixer = "/dev/mixer" ; settings for OSS OSS_Channels = "volume, speaker" ALSA_Card = "default" ; settings for ALSA ALSA_Elements = "Master, 'PC Speaker'" MixerInitDelay = no # [MODULE CDROM] dev_CDROM = "/dev/cdrom" EjectCDKey = 161 EjectCDKeyDelay = 0 # [MODULE PMAC] dev_PMU = "/dev/pmu" dev_ADB = "/dev/adb" TPModeUpKey = 225 + alt TPModeDownKey = 224 + alt TPMode = drag KBDMode = fkeysfirst Batlog = none NoTapTyping = no pbbuttonsd-0.7.9/config.rpath0000755000175000017500000003521310002313243013134 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2003 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 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 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $CC in icc|ecc) wl='-Wl,' ;; ccc) wl='-Wl,' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then hardcode_direct=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi4*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; netbsd*) ;; newsos6) ;; nto-qnx) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < * Version 0.13.1 released. pbbuttonsd-0.7.9/intl/Makefile.in0000644000175000017500000003762610463223131013660 00000000000000# Makefile for directory with message catalog handling library of GNU gettext # Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. VPATH = $(srcdir) prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \ -Dset_relocation_prefix=libintl_set_relocation_prefix \ -Drelocate=libintl_relocate \ -DDEPENDS_ON_LIBICONV=1 @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = \ gmo.h \ gettextP.h \ hash-string.h \ loadinfo.h \ plural-exp.h \ eval-plural.h \ localcharset.h \ relocatable.h \ xsize.h \ printf-args.h printf-args.c \ printf-parse.h wprintf-parse.h printf-parse.c \ vasnprintf.h vasnwprintf.h vasnprintf.c \ os2compat.h \ libgnuintl.h.in SOURCES = \ bindtextdom.c \ dcgettext.c \ dgettext.c \ gettext.c \ finddomain.c \ loadmsgcat.c \ localealias.c \ textdomain.c \ l10nflist.c \ explodename.c \ dcigettext.c \ dcngettext.c \ dngettext.c \ ngettext.c \ plural.y \ plural-exp.c \ localcharset.c \ relocatable.c \ localename.c \ log.c \ printf.c \ osdep.c \ os2compat.c \ intl-compat.c OBJECTS = \ bindtextdom.$lo \ dcgettext.$lo \ dgettext.$lo \ gettext.$lo \ finddomain.$lo \ loadmsgcat.$lo \ localealias.$lo \ textdomain.$lo \ l10nflist.$lo \ explodename.$lo \ dcigettext.$lo \ dcngettext.$lo \ dngettext.$lo \ ngettext.$lo \ plural.$lo \ plural-exp.$lo \ localcharset.$lo \ relocatable.$lo \ localename.$lo \ log.$lo \ printf.$lo \ osdep.$lo \ intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \ libgnuintl.h_vms Makefile.vms \ libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ libintl.la libgnuintl.la: $(OBJECTS) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined # Libtool's library version information for libintl. # Before making a gettext release, the gettext maintainer must change this # according to the libtool documentation, section "Library interface versions". # Maintainers of other packages that include the intl directory must *not* # change these values. LTV_CURRENT=6 LTV_REVISION=1 LTV_AGE=4 .SUFFIXES: .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< .y.c: $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h bindtextdom.lo: $(srcdir)/bindtextdom.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c dcgettext.lo: $(srcdir)/dcgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c dgettext.lo: $(srcdir)/dgettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c gettext.lo: $(srcdir)/gettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c finddomain.lo: $(srcdir)/finddomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c loadmsgcat.lo: $(srcdir)/loadmsgcat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c localealias.lo: $(srcdir)/localealias.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c textdomain.lo: $(srcdir)/textdomain.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c l10nflist.lo: $(srcdir)/l10nflist.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c explodename.lo: $(srcdir)/explodename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c dcigettext.lo: $(srcdir)/dcigettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c dcngettext.lo: $(srcdir)/dcngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c dngettext.lo: $(srcdir)/dngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c ngettext.lo: $(srcdir)/ngettext.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c plural.lo: $(srcdir)/plural.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c plural-exp.lo: $(srcdir)/plural-exp.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c localcharset.lo: $(srcdir)/localcharset.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c relocatable.lo: $(srcdir)/relocatable.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c localename.lo: $(srcdir)/localename.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c log.lo: $(srcdir)/log.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c printf.lo: $(srcdir)/printf.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c osdep.lo: $(srcdir)/osdep.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c intl-compat.lo: $(srcdir)/intl-compat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c ref-add.sed: $(srcdir)/ref-add.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed mv t-ref-add.sed ref-add.sed ref-del.sed: $(srcdir)/ref-del.sin sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed mv t-ref-del.sed ref-del.sed INCLUDES = -I. -I$(srcdir) -I.. libgnuintl.h: $(srcdir)/libgnuintl.h.in sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ < $(srcdir)/libgnuintl.h.in > libgnuintl.h libintl.h: libgnuintl.h cp libgnuintl.h libintl.h charset.alias: $(srcdir)/config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ if test "@RELOCATABLE@" = yes; then \ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \ if test -n "$$dependencies"; then \ rm -f $(DESTDIR)$(libdir)/libintl.la; \ fi; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no; then \ $(mkinstalldirs) $(DESTDIR)$(libdir); \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ orig=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ if test @GLIBC21@ = no; then \ orig=charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ fi; \ fi; \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ test -f $(DESTDIR)$(localedir)/locale.alias \ && orig=$(DESTDIR)$(localedir)/locale.alias \ || orig=$(srcdir)/locale.alias; \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ : ; \ fi install-data: all if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ dists="$(DISTFILES.generated)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ $(INSTALL_DATA) $$dir/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ dists="$(DISTFILES.obsolete)"; \ for file in $$dists; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-strip: install installdirs: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no; then \ $(mkinstalldirs) $(DESTDIR)$(libdir); \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ && test '@USE_INCLUDED_LIBINTL@' = yes; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools" \ && test '@USE_INCLUDED_LIBINTL@' = no; then \ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ if test -f $(DESTDIR)$(localedir)/locale.alias; then \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext-tools"; then \ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi info dvi ps pdf html: $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h dcigettext.$lo: $(srcdir)/eval-plural.h localcharset.$lo: $(srcdir)/localcharset.h localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.obj *.lo core core.* rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ fi maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." # GNU gettext needs not contain the file `VERSION' but contains some # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile if test "$(PACKAGE)" = "gettext-tools"; then \ : ; \ else \ if test "$(PACKAGE)" = "gettext-runtime"; then \ additional="$(DISTFILES.gettext)"; \ else \ additional="$(DISTFILES.normal)"; \ fi; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ cp -p $$dir/$$file $(distdir); \ done; \ fi Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status # This would be more efficient, but doesn't work any more with autoconf-2.57, # when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used. # cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.7.9/intl/config.charset0000755000175000017500000004136610463223131014432 00000000000000#! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # # The table consists of lines of the form # ALIAS CANONICAL # # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". # ALIAS is compared in a case sensitive way. # # CANONICAL is the GNU canonical name for this character encoding. # It must be an encoding supported by libiconv. Support by GNU libc is # also desirable. CANONICAL is case insensitive. Usually an upper case # MIME charset name is preferred. # The current list of GNU canonical charset names is as follows. # # name used by which systems a MIME name? # ASCII, ANSI_X3.4-1968 glibc solaris freebsd # ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-3 glibc solaris yes # ISO-8859-4 osf solaris freebsd yes # ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-6 glibc aix hpux solaris yes # ISO-8859-7 glibc aix hpux irix osf solaris yes # ISO-8859-8 glibc aix hpux osf solaris yes # ISO-8859-9 glibc aix hpux irix osf solaris yes # ISO-8859-13 glibc # ISO-8859-14 glibc # ISO-8859-15 glibc aix osf solaris freebsd # KOI8-R glibc solaris freebsd yes # KOI8-U glibc freebsd yes # KOI8-T glibc # CP437 dos # CP775 dos # CP850 aix osf dos # CP852 dos # CP855 dos # CP856 aix # CP857 dos # CP861 dos # CP862 dos # CP864 dos # CP865 dos # CP866 freebsd dos # CP869 dos # CP874 woe32 dos # CP922 aix # CP932 aix woe32 dos # CP943 aix # CP949 osf woe32 dos # CP950 woe32 dos # CP1046 aix # CP1124 aix # CP1125 dos # CP1129 aix # CP1250 woe32 # CP1251 glibc solaris woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 # CP1255 glibc woe32 # CP1256 woe32 # CP1257 woe32 # GB2312 glibc aix hpux irix solaris freebsd yes # EUC-JP glibc aix hpux irix osf solaris freebsd yes # EUC-KR glibc aix hpux irix osf solaris freebsd yes # EUC-TW glibc aix hpux irix osf solaris # BIG5 glibc aix hpux osf solaris freebsd yes # BIG5-HKSCS glibc solaris # GBK glibc aix osf solaris woe32 dos # GB18030 glibc solaris # SHIFT_JIS hpux osf solaris freebsd yes # JOHAB glibc solaris woe32 # TIS-620 glibc aix hpux osf solaris # VISCII glibc yes # TCVN5712-1 glibc # GEORGIAN-PS glibc # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux # HP-HEBREW8 hpux # HP-TURKISH8 hpux # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf # UTF-8 glibc aix hpux osf solaris yes # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). # # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications # must understand both names and treat them as equivalent. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM host="$1" os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` echo "# This file contains a table of character encoding aliases," echo "# suitable for operating system '${os}'." echo "# It was automatically generated from config.charset." # List of references, updated during installation: echo "# Packages using this file: " case "$os" in linux-gnulibc1*) # Linux libc5 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" echo "POSIX ASCII" for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ sv_FI sv_SE; do echo "$l ISO-8859-1" echo "$l.iso-8859-1 ISO-8859-1" echo "$l.iso-8859-15 ISO-8859-15" echo "$l.iso-8859-15@euro ISO-8859-15" echo "$l@euro ISO-8859-15" echo "$l.cp-437 CP437" echo "$l.cp-850 CP850" echo "$l.cp-1252 CP1252" echo "$l.cp-1252@euro CP1252" #echo "$l.atari-st ATARI-ST" # not a commonly used encoding echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ sl_SI sr sr_CS sr_YU; do echo "$l ISO-8859-2" echo "$l.iso-8859-2 ISO-8859-2" echo "$l.cp-852 CP852" echo "$l.cp-1250 CP1250" echo "$l.utf-8 UTF-8" done for l in mk mk_MK ru ru_RU; do echo "$l ISO-8859-5" echo "$l.iso-8859-5 ISO-8859-5" echo "$l.koi8-r KOI8-R" echo "$l.cp-866 CP866" echo "$l.cp-1251 CP1251" echo "$l.utf-8 UTF-8" done for l in ar ar_SA; do echo "$l ISO-8859-6" echo "$l.iso-8859-6 ISO-8859-6" echo "$l.cp-864 CP864" #echo "$l.cp-868 CP868" # not a commonly used encoding echo "$l.cp-1256 CP1256" echo "$l.utf-8 UTF-8" done for l in el el_GR gr gr_GR; do echo "$l ISO-8859-7" echo "$l.iso-8859-7 ISO-8859-7" echo "$l.cp-869 CP869" echo "$l.cp-1253 CP1253" echo "$l.cp-1253@euro CP1253" echo "$l.utf-8 UTF-8" echo "$l.utf-8@euro UTF-8" done for l in he he_IL iw iw_IL; do echo "$l ISO-8859-8" echo "$l.iso-8859-8 ISO-8859-8" echo "$l.cp-862 CP862" echo "$l.cp-1255 CP1255" echo "$l.utf-8 UTF-8" done for l in tr tr_TR; do echo "$l ISO-8859-9" echo "$l.iso-8859-9 ISO-8859-9" echo "$l.cp-857 CP857" echo "$l.cp-1254 CP1254" echo "$l.utf-8 UTF-8" done for l in lt lt_LT lv lv_LV; do #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name echo "$l ISO-8859-13" done for l in ru_UA uk uk_UA; do echo "$l KOI8-U" done for l in zh zh_CN; do #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name echo "$l GB2312" done for l in ja ja_JP ja_JP.EUC; do echo "$l EUC-JP" done for l in ko ko_KR; do echo "$l EUC-KR" done for l in th th_TH; do echo "$l TIS-620" done for l in fa fa_IR; do #echo "$l ISIRI-3342" # a broken encoding echo "$l.utf-8 UTF-8" done ;; linux* | *-gnu*) # With glibc-2.1 or newer, we don't need any canonicalization, # because glibc has iconv and both glibc and libiconv support all # GNU canonical names directly. Therefore, the Makefile does not # need to install the alias file at all. # The following applies only to glibc-2.0.x and older libcs. echo "ISO_646.IRV:1983 ASCII" ;; aix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "IBM-850 CP850" echo "IBM-856 CP856" echo "IBM-921 ISO-8859-13" echo "IBM-922 CP922" echo "IBM-932 CP932" echo "IBM-943 CP943" echo "IBM-1046 CP1046" echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" echo "big5 BIG5" echo "GBK GBK" echo "TIS-620 TIS-620" echo "UTF-8 UTF-8" ;; hpux*) echo "iso88591 ISO-8859-1" echo "iso88592 ISO-8859-2" echo "iso88595 ISO-8859-5" echo "iso88596 ISO-8859-6" echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" echo "hebrew8 HP-HEBREW8" echo "turkish8 HP-TURKISH8" echo "kana8 HP-KANA8" echo "tis620 TIS-620" echo "big5 BIG5" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SHIFT_JIS" echo "utf8 UTF-8" ;; irix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "cp850 CP850" echo "big5 BIG5" echo "dechanyu DEC-HANYU" echo "dechanzi GB2312" echo "deckanji DEC-KANJI" echo "deckorean EUC-KR" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "GBK GBK" echo "KSC5601 CP949" echo "sdeckanji EUC-JP" echo "SJIS SHIFT_JIS" echo "TACTIS TIS-620" echo "UTF-8 UTF-8" ;; solaris*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-3 ISO-8859-3" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "ansi-1251 CP1251" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" echo "GBK GBK" echo "GB18030 GB18030" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "ko_KR.johap92 JOHAB" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; freebsd* | os2*) # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just # reuse FreeBSD's locale data for OS/2. echo "C ASCII" echo "US-ASCII ASCII" for l in la_LN lt_LN; do echo "$l.ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do echo "$l.ISO_8859-1 ISO-8859-1" echo "$l.DIS_8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do echo "$l.ISO_8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO_8859-4 ISO-8859-4" done for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO_8859-5 ISO-8859-5" echo "$l.CP866 CP866" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; netbsd*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-15 ISO-8859-15" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "BIG5 BIG5" echo "SJIS SHIFT_JIS" ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "#" echo "# The encodings given here may not all be correct." echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages echo "ca CP850" echo "ca_ES CP850" echo "da CP865" # not CP850 ?? echo "da_DK CP865" # not CP850 ?? echo "de CP850" echo "de_AT CP850" echo "de_CH CP850" echo "de_DE CP850" echo "en CP850" echo "en_AU CP850" # not CP437 ?? echo "en_CA CP850" echo "en_GB CP850" echo "en_NZ CP437" echo "en_US CP437" echo "en_ZA CP850" # not CP437 ?? echo "es CP850" echo "es_AR CP850" echo "es_BO CP850" echo "es_CL CP850" echo "es_CO CP850" echo "es_CR CP850" echo "es_CU CP850" echo "es_DO CP850" echo "es_EC CP850" echo "es_ES CP850" echo "es_GT CP850" echo "es_HN CP850" echo "es_MX CP850" echo "es_NI CP850" echo "es_PA CP850" echo "es_PY CP850" echo "es_PE CP850" echo "es_SV CP850" echo "es_UY CP850" echo "es_VE CP850" echo "et CP850" echo "et_EE CP850" echo "eu CP850" echo "eu_ES CP850" echo "fi CP850" echo "fi_FI CP850" echo "fr CP850" echo "fr_BE CP850" echo "fr_CA CP850" echo "fr_CH CP850" echo "fr_FR CP850" echo "ga CP850" echo "ga_IE CP850" echo "gd CP850" echo "gd_GB CP850" echo "gl CP850" echo "gl_ES CP850" echo "id CP850" # not CP437 ?? echo "id_ID CP850" # not CP437 ?? echo "is CP861" # not CP850 ?? echo "is_IS CP861" # not CP850 ?? echo "it CP850" echo "it_CH CP850" echo "it_IT CP850" echo "lt CP775" echo "lt_LT CP775" echo "lv CP775" echo "lv_LV CP775" echo "nb CP865" # not CP850 ?? echo "nb_NO CP865" # not CP850 ?? echo "nl CP850" echo "nl_BE CP850" echo "nl_NL CP850" echo "nn CP865" # not CP850 ?? echo "nn_NO CP865" # not CP850 ?? echo "no CP865" # not CP850 ?? echo "no_NO CP865" # not CP850 ?? echo "pt CP850" echo "pt_BR CP850" echo "pt_PT CP850" echo "sv CP850" echo "sv_SE CP850" # ISO-8859-2 languages echo "cs CP852" echo "cs_CZ CP852" echo "hr CP852" echo "hr_HR CP852" echo "hu CP852" echo "hu_HU CP852" echo "pl CP852" echo "pl_PL CP852" echo "ro CP852" echo "ro_RO CP852" echo "sk CP852" echo "sk_SK CP852" echo "sl CP852" echo "sl_SI CP852" echo "sq CP852" echo "sq_AL CP852" echo "sr CP852" # CP852 or CP866 or CP855 ?? echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? # ISO-8859-3 languages echo "mt CP850" echo "mt_MT CP850" # ISO-8859-5 languages echo "be CP866" echo "be_BE CP866" echo "bg CP866" # not CP855 ?? echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? echo "ru CP866" echo "ru_RU CP866" echo "uk CP1125" echo "uk_UA CP1125" # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" echo "ar_DZ CP864" echo "ar_EG CP864" echo "ar_IQ CP864" echo "ar_IR CP864" echo "ar_JO CP864" echo "ar_KW CP864" echo "ar_MA CP864" echo "ar_OM CP864" echo "ar_QA CP864" echo "ar_SA CP864" echo "ar_SY CP864" # ISO-8859-7 languages echo "el CP869" echo "el_GR CP869" # ISO-8859-8 languages echo "he CP862" echo "he_IL CP862" # ISO-8859-9 languages echo "tr CP857" echo "tr_TR CP857" # Japanese echo "ja CP932" echo "ja_JP CP932" # Chinese echo "zh_CN GBK" echo "zh_TW CP950" # not CP938 ?? # Korean echo "kr CP949" # not CP934 ?? echo "kr_KR CP949" # not CP934 ?? # Thai echo "th CP874" echo "th_TH CP874" # Other echo "eo CP850" echo "eo_EO CP850" ;; esac pbbuttonsd-0.7.9/intl/locale.alias0000644000175000017500000000514110463223134014053 00000000000000# Locale name alias data base. # Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. # Packages using this file: bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 français fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatski hr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japanese ja_JP.eucJP japanese.euc ja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 nb_NO no_NO.ISO-8859-1 nb_NO.ISO-8859-1 no_NO.ISO-8859-1 norwegian no_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanian ro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 pbbuttonsd-0.7.9/intl/ref-add.sin0000644000175000017500000000210110463223136013611 00000000000000# Add this package to a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// ta :a s/ @PACKAGE@ / @PACKAGE@ / tb s/ $/ @PACKAGE@ / :b s/^/# Packages using this file:/ } pbbuttonsd-0.7.9/intl/ref-del.sin0000644000175000017500000000202410463223136013631 00000000000000# Remove this package from a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } pbbuttonsd-0.7.9/intl/gmo.h0000644000175000017500000001125710463223133012540 00000000000000/* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #include /* @@ end of prolog @@ */ /* The magic number of the GNU message catalog format. */ #define _MAGIC 0x950412de #define _MAGIC_SWAPPED 0xde120495 /* Revision number of the currently used .mo (binary) file format. */ #define MO_REVISION_NUMBER 0 /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work when cross-compiling. */ #if __STDC__ # define UINT_MAX_32_BITS 4294967295U #else # define UINT_MAX_32_BITS 0xFFFFFFFF #endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ #ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS #endif #if UINT_MAX == UINT_MAX_32_BITS typedef unsigned nls_uint32; #else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short nls_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long nls_uint32; # else /* The following line is intended to throw an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif #endif /* Header for binary .mo file format. */ struct mo_file_header { /* The magic number. */ nls_uint32 magic; /* The revision number of the file format. */ nls_uint32 revision; /* The following are only used in .mo files with major revision 0. */ /* The number of strings pairs. */ nls_uint32 nstrings; /* Offset of table with start offsets of original strings. */ nls_uint32 orig_tab_offset; /* Offset of table with start offsets of translated strings. */ nls_uint32 trans_tab_offset; /* Size of hash table. */ nls_uint32 hash_tab_size; /* Offset of first hash table entry. */ nls_uint32 hash_tab_offset; /* The following are only used in .mo files with minor revision >= 1. */ /* The number of system dependent segments. */ nls_uint32 n_sysdep_segments; /* Offset of table describing system dependent segments. */ nls_uint32 sysdep_segments_offset; /* The number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Offset of table with start offsets of original sysdep strings. */ nls_uint32 orig_sysdep_tab_offset; /* Offset of table with start offsets of translated sysdep strings. */ nls_uint32 trans_sysdep_tab_offset; }; /* Descriptor for static string contained in the binary .mo file. */ struct string_desc { /* Length of addressed string, not including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* The following are only used in .mo files with minor revision >= 1. */ /* Descriptor for system dependent string segment. */ struct sysdep_segment { /* Length of addressed string, including the trailing NUL. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* Descriptor for system dependent string. */ struct sysdep_string { /* Offset of static string segments in file. */ nls_uint32 offset; /* Alternating sequence of static and system dependent segments. The last segment is a static segment, including the trailing NUL. */ struct segment_pair { /* Size of static segment. */ nls_uint32 segsize; /* Reference to system dependent string segment, or ~0 at the end. */ nls_uint32 sysdepref; } segments[1]; }; /* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF, regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */ #define SEGMENTS_END ((nls_uint32) ~0) /* @@ begin of epilog @@ */ #endif /* gettext.h */ pbbuttonsd-0.7.9/intl/gettextP.h0000644000175000017500000001453010463223133013557 00000000000000/* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H #include /* Get size_t. */ #ifdef _LIBC # include "../iconv/gconv_int.h" #else # if HAVE_ICONV # include # endif #endif #include "loadinfo.h" #include "gmo.h" /* Get nls_uint32. */ /* @@ end of prolog @@ */ #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif #ifdef _LIBC # include # define SWAP(i) bswap_32 (i) #else static inline nls_uint32 SWAP (i) nls_uint32 i; { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } #endif /* In-memory representation of system dependent string. */ struct sysdep_string_desc { /* Length of addressed string, including the trailing NUL. */ size_t length; /* Pointer to addressed string. */ const char *pointer; }; /* The representation of an opened message catalog. */ struct loaded_domain { /* Pointer to memory containing the .mo file. */ const char *data; /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */ int use_mmap; /* Size of mmap()ed memory. */ size_t mmap_size; /* 1 if the .mo file uses a different endianness than this machine. */ int must_swap; /* Pointer to additional malloc()ed memory. */ void *malloced; /* Number of static strings pairs. */ nls_uint32 nstrings; /* Pointer to descriptors of original strings in the file. */ const struct string_desc *orig_tab; /* Pointer to descriptors of translated strings in the file. */ const struct string_desc *trans_tab; /* Number of system dependent strings pairs. */ nls_uint32 n_sysdep_strings; /* Pointer to descriptors of original sysdep strings. */ const struct sysdep_string_desc *orig_sysdep_tab; /* Pointer to descriptors of translated sysdep strings. */ const struct sysdep_string_desc *trans_sysdep_tab; /* Size of hash table. */ nls_uint32 hash_size; /* Pointer to hash table. */ const nls_uint32 *hash_tab; /* 1 if the hash table uses a different endianness than this machine. */ int must_swap_hash_tab; int codeset_cntr; #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif char **conv_tab; struct expression *plural; unsigned long int nplurals; }; /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ #ifdef __GNUC__ # define ZERO 0 #else # define ZERO 1 #endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding { struct binding *next; char *dirname; int codeset_cntr; /* Incremented each time codeset changes. */ char *codeset; char domainname[ZERO]; }; /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ extern int _nl_msg_cat_cntr; #ifndef _LIBC const char *_nl_locale_name (int category, const char *categoryname); #endif struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale, const char *__domainname, struct binding *__domainbinding) internal_function; void _nl_load_domain (struct loaded_l10nfile *__domain, struct binding *__domainbinding) internal_function; void _nl_unload_domain (struct loaded_domain *__domain) internal_function; const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file, struct loaded_domain *__domain, struct binding *__domainbinding) internal_function; void _nl_free_domain_conv (struct loaded_domain *__domain) internal_function; char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp) internal_function; #ifdef _LIBC extern char *__gettext (const char *__msgid); extern char *__dgettext (const char *__domainname, const char *__msgid); extern char *__dcgettext (const char *__domainname, const char *__msgid, int __category); extern char *__ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n); extern char *__dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int n); extern char *__dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category); extern char *__dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); extern char *__textdomain (const char *__domainname); extern char *__bindtextdomain (const char *__domainname, const char *__dirname); extern char *__bind_textdomain_codeset (const char *__domainname, const char *__codeset); #else /* Declare the exported libintl_* functions, in a way that allows us to call them under their real name. */ # undef _INTL_REDIRECT_INLINE # undef _INTL_REDIRECT_MACROS # define _INTL_REDIRECT_MACROS # include "libgnuintl.h" extern char *libintl_dcigettext (const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category); #endif /* @@ begin of epilog @@ */ #endif /* gettextP.h */ pbbuttonsd-0.7.9/intl/hash-string.h0000644000175000017500000000314110463223133014176 00000000000000/* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @@ end of prolog @@ */ /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ static inline unsigned long int hash_string (const char *str_param) { unsigned long int hval, g; const char *str = str_param; /* Compute the hash value for the given string. */ hval = 0; while (*str != '\0') { hval <<= 4; hval += (unsigned char) *str++; g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } pbbuttonsd-0.7.9/intl/loadinfo.h0000644000175000017500000001332210463223133013544 00000000000000/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LOADINFO_H #define _LOADINFO_H 1 /* Declarations of locale dependent catalog lookup functions. Implemented in localealias.c Possibly replace a locale name by another. explodename.c Split a locale name into its various fields. l10nflist.c Generate a list of filenames of possible message catalogs. finddomain.c Find and open the relevant message catalogs. The main function _nl_find_domain() in finddomain.c is declared in gettextP.h. */ #ifndef internal_function # define internal_function #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif /* Separator in PATH like lists of pathnames. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_NORM_CODESET 8 #define XPG_CODESET 16 #define TERRITORY 32 #define CEN_AUDIENCE 64 #define XPG_MODIFIER 128 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ extern const char *_nl_normalize_codeset (const char *codeset, size_t name_len); /* Lookup a locale dependent file. *L10NFILE_LIST denotes a pool of lookup results of locale dependent files of the same kind, sorted in decreasing order of ->filename. DIRLIST and DIRLIST_LEN are an argz list of directories in which to look, containing at least one directory (i.e. DIRLIST_LEN > 0). MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER, SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as produced by _nl_explode_name(). FILENAME is the filename suffix. The return value is the lookup result, either found in *L10NFILE_LIST, or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL. If the return value is non-NULL, it is added to *L10NFILE_LIST, and its ->next field denotes the chaining inside *L10NFILE_LIST, and furthermore its ->successor[] field contains a list of other lookup results from which this lookup result inherits. */ extern struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *filename, int do_allocate); /* Lookup the real locale name for a locale alias NAME, or NULL if NAME is not a locale alias (but possibly a real locale name). The return value is statically allocated and must not be freed. */ extern const char *_nl_expand_alias (const char *name); /* Split a locale name NAME into its pieces: language, modifier, territory, codeset, special, sponsor, revision. NAME gets destructively modified: NUL bytes are inserted here and there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY, *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a pointer into the old NAME string, or NULL. *NORMALIZED_CODESET gets assigned the expanded *CODESET, if it is different from *CODESET; this one is dynamically allocated and has to be freed by the caller. The return value is a bitmask, where each bit corresponds to one filled-in value: XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER, TERRITORY for *TERRITORY, XPG_CODESET for *CODESET, XPG_NORM_CODESET for *NORMALIZED_CODESET, CEN_SPECIAL for *SPECIAL, CEN_SPONSOR for *SPONSOR, CEN_REVISION for *REVISION. */ extern int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision); /* Split a locale name NAME into a leading language part and all the rest. Return a pointer to the first character after the language, i.e. to the first byte of the rest. */ extern char *_nl_find_language (const char *name); #endif /* loadinfo.h */ pbbuttonsd-0.7.9/intl/plural-exp.h0000644000175000017500000000773310463223135014055 00000000000000/* Expression parsing and evaluation for plural form selection. Copyright (C) 2000-2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H #ifndef internal_function # define internal_function #endif #ifndef attribute_hidden # define attribute_hidden #endif /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum operator { /* Without arguments: */ var, /* The variable "n". */ num, /* Decimal number. */ /* Unary operators: */ lnot, /* Logical NOT. */ /* Binary operators: */ mult, /* Multiplication. */ divide, /* Division. */ module, /* Modulo operation. */ plus, /* Addition. */ minus, /* Subtraction. */ less_than, /* Comparison. */ greater_than, /* Comparison. */ less_or_equal, /* Comparison. */ greater_or_equal, /* Comparison. */ equal, /* Comparison for equality. */ not_equal, /* Comparison for inequality. */ land, /* Logical AND. */ lor, /* Logical OR. */ /* Ternary operators: */ qmop /* Question mark operator. */ } operation; union { unsigned long int num; /* Number value for `num'. */ struct expression *args[3]; /* Up to three arguments. */ } val; }; /* This is the data structure to pass information to the parser and get the result in a thread-safe way. */ struct parse_args { const char *cp; struct expression *res; }; /* Names for the libintl functions are a problem. This source code is used 1. in the GNU C Library library, 2. in the GNU libintl library, 3. in the GNU gettext tools. The function names in each situation must be different, to allow for binary incompatible changes in 'struct expression'. Furthermore, 1. in the GNU C Library library, the names have a __ prefix, 2.+3. in the GNU libintl library and in the GNU gettext tools, the names must follow ANSI C and not start with __. So we have to distinguish the three cases. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp # define PLURAL_PARSE __gettextparse # define GERMANIC_PLURAL __gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural #elif defined (IN_LIBINTL) # define FREE_EXPRESSION libintl_gettext_free_exp # define PLURAL_PARSE libintl_gettextparse # define GERMANIC_PLURAL libintl_gettext_germanic_plural # define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural #else # define FREE_EXPRESSION free_plural_expression # define PLURAL_PARSE parse_plural_expression # define GERMANIC_PLURAL germanic_plural # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression #endif extern void FREE_EXPRESSION (struct expression *exp) internal_function; extern int PLURAL_PARSE (void *arg); extern struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp, unsigned long int *npluralsp) internal_function; #if !defined (_LIBC) && !defined (IN_LIBINTL) extern unsigned long int plural_eval (struct expression *pexp, unsigned long int n); #endif #endif /* _PLURAL_EXP_H */ pbbuttonsd-0.7.9/intl/eval-plural.h0000644000175000017500000000532210463223132014175 00000000000000/* Plural expression evaluation. Copyright (C) 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef STATIC #define STATIC static #endif /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int internal_function plural_eval (struct expression *pexp, unsigned long int n) { switch (pexp->nargs) { case 0: switch (pexp->operation) { case var: return n; case num: return pexp->val.num; default: break; } /* NOTREACHED */ break; case 1: { /* pexp->operation must be lnot. */ unsigned long int arg = plural_eval (pexp->val.args[0], n); return ! arg; } case 2: { unsigned long int leftarg = plural_eval (pexp->val.args[0], n); if (pexp->operation == lor) return leftarg || plural_eval (pexp->val.args[1], n); else if (pexp->operation == land) return leftarg && plural_eval (pexp->val.args[1], n); else { unsigned long int rightarg = plural_eval (pexp->val.args[1], n); switch (pexp->operation) { case mult: return leftarg * rightarg; case divide: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg / rightarg; case module: #if !INTDIV0_RAISES_SIGFPE if (rightarg == 0) raise (SIGFPE); #endif return leftarg % rightarg; case plus: return leftarg + rightarg; case minus: return leftarg - rightarg; case less_than: return leftarg < rightarg; case greater_than: return leftarg > rightarg; case less_or_equal: return leftarg <= rightarg; case greater_or_equal: return leftarg >= rightarg; case equal: return leftarg == rightarg; case not_equal: return leftarg != rightarg; default: break; } } /* NOTREACHED */ break; } case 3: { /* pexp->operation must be qmop. */ unsigned long int boolarg = plural_eval (pexp->val.args[0], n); return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); } } /* NOTREACHED */ return 0; } pbbuttonsd-0.7.9/intl/localcharset.h0000644000175000017500000000255710463223134014426 00000000000000/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2003 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LOCALCHARSET_H #define _LOCALCHARSET_H #ifdef __cplusplus extern "C" { #endif /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); #ifdef __cplusplus } #endif #endif /* _LOCALCHARSET_H */ pbbuttonsd-0.7.9/intl/relocatable.h0000644000175000017500000000523510463223136014235 00000000000000/* Provide relocatable packages. Copyright (C) 2003 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H #ifdef __cplusplus extern "C" { #endif /* This can be enabled through the configure --enable-relocatable option. */ #if ENABLE_RELOCATABLE /* When building a DLL, we must export some functions. Note that because this is a private .h file, we don't need to use __declspec(dllimport) in any case. */ #if defined _MSC_VER && BUILDING_DLL # define RELOCATABLE_DLL_EXPORTED __declspec(dllexport) #else # define RELOCATABLE_DLL_EXPORTED #endif /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ extern RELOCATABLE_DLL_EXPORTED void set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); /* Returns the pathname, relocated according to the current installation directory. */ extern const char * relocate (const char *pathname); /* Memory management: relocate() leaks memory, because it has to construct a fresh pathname. If this is a problem because your program calls relocate() frequently, think about caching the result. */ /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ extern const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname); #else /* By default, we use the hardwired pathnames. */ #define relocate(pathname) (pathname) #endif #ifdef __cplusplus } #endif #endif /* _RELOCATABLE_H */ pbbuttonsd-0.7.9/intl/xsize.h0000644000175000017500000000672210463223137013125 00000000000000/* xsize.h -- Checked size_t computations. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _XSIZE_H #define _XSIZE_H /* Get size_t. */ #include /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). These computations can lead to overflow. When this happens, malloc() returns a piece of memory that is way too small, and the program then crashes while attempting to fill the memory. To avoid this, the functions and macros in this file check for overflow. The convention is that SIZE_MAX represents overflow. malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc implementation that uses mmap --, it's recommended to use size_overflow_p() or size_in_bounds_p() before invoking malloc(). The example thus becomes: size_t size = xsum (header_size, xtimes (n, element_size)); void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); */ /* Convert an arbitrary value >= 0 to type size_t. */ #define xcast_size_t(N) \ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : SIZE_MAX); } /* Sum of three sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ return (size1 >= size2 ? size1 : size2); } /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even when N is of a wider tupe and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) /* Check for overflow. */ #define size_overflow_p(SIZE) \ ((SIZE) == SIZE_MAX) /* Check against overflow. */ #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) #endif /* _XSIZE_H */ pbbuttonsd-0.7.9/intl/printf-args.h0000644000175000017500000000550210463223135014210 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* Get size_t. */ #include /* Get wchar_t. */ #ifdef HAVE_WCHAR_T # include #endif /* Get wint_t. */ #ifdef HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #ifdef HAVE_LONG_LONG TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, #ifdef HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, #ifdef HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #ifdef HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #ifdef HAVE_LONG_LONG , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #ifdef HAVE_LONG_LONG long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; #ifdef HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; #ifdef HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #ifdef HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #ifdef HAVE_LONG_LONG long long int * a_count_longlongint_pointer; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ pbbuttonsd-0.7.9/intl/printf-args.c0000644000175000017500000000625310463223135014207 00000000000000/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "printf-args.h" #ifdef STATIC STATIC #endif int printf_fetchargs (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; #endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: ap->a.a_wide_char = va_arg (args, wint_t); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif default: /* Unknown type. */ return -1; } return 0; } pbbuttonsd-0.7.9/intl/printf-parse.h0000644000175000017500000000420710463223136014370 00000000000000/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const char* dir_start; const char* dir_end; int flags; const char* width_start; const char* width_end; size_t width_arg_index; const char* precision_start; const char* precision_end; size_t precision_arg_index; char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } char_directive; /* A parsed format string. */ typedef struct { size_t count; char_directive *dir; size_t max_width_length; size_t max_precision_length; } char_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ pbbuttonsd-0.7.9/intl/wprintf-parse.h0000644000175000017500000000425710463223137014565 00000000000000/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _WPRINTF_PARSE_H #define _WPRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const wchar_t* dir_start; const wchar_t* dir_end; int flags; const wchar_t* width_start; const wchar_t* width_end; size_t width_arg_index; const wchar_t* precision_start; const wchar_t* precision_end; size_t precision_arg_index; wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } wchar_t_directive; /* A parsed format string. */ typedef struct { size_t count; wchar_t_directive *dir; size_t max_width_length; size_t max_precision_length; } wchar_t_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a); #endif /* _WPRINTF_PARSE_H */ pbbuttonsd-0.7.9/intl/printf-parse.c0000644000175000017500000002733310463223136014370 00000000000000/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif /* malloc(), realloc(), free(). */ #include /* Checked size_t computations. */ #include "xsize.h" #if WIDE_CHAR_VERSION # define PRINTF_PARSE wprintf_parse # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives #else # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ return -1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto error; \ memory = (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto error; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } #ifdef HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } #endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': #ifdef HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else #endif type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #ifdef HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #ifdef HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #ifdef HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #ifdef HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto error; memory = realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto error; d->dir = memory; } } } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); return -1; } #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef PRINTF_PARSE pbbuttonsd-0.7.9/intl/vasnprintf.h0000644000175000017500000000436010463223137014151 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H /* Get va_list. */ #include /* Get size_t. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus } #endif #endif /* _VASNPRINTF_H */ pbbuttonsd-0.7.9/intl/vasnwprintf.h0000644000175000017500000000330210477546077014353 00000000000000/* vswprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _VASNWPRINTF_H #define _VASNWPRINTF_H /* Get va_list. */ #include /* Get wchar_t, size_t. */ #include #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. */ extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...); extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args); #ifdef __cplusplus } #endif #endif /* _VASNWPRINTF_H */ pbbuttonsd-0.7.9/intl/vasnprintf.c0000644000175000017500000005304410463223136014146 00000000000000/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #ifndef IN_LIBINTL # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "vasnwprintf.h" #else # include "vasnprintf.h" #endif #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Checked size_t computations. */ #include "xsize.h" #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif #if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else # define VASNPRINTF vasnprintf # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf # endif #endif CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) { errno = EINVAL; return NULL; } #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (printf_fetchargs (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; CHAR_T *buf; CHAR_T *buf_malloced; const CHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ CHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (CHAR_T)) { buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (CHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ CHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (CHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (CHAR_T *) malloc (memory_size); \ else \ memory = (CHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ memcpy (memory, result, length * sizeof (CHAR_T)); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); memcpy (result + length, cp, n * sizeof (CHAR_T)); length = augmented_length; } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } else { arg_type type = a.arg[dp->arg_index].type; CHAR_T *p; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; CHAR_T tmpbuf[700]; CHAR_T *tmp; /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { size_t width; size_t precision; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; width = (arg < 0 ? (unsigned int) (-arg) : arg); } else { const CHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } } precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; precision = (arg < 0 ? 0 : arg); } else { const CHAR_T *digitp = dp->precision_start + 1; precision = 0; do precision = xsum (xtimes (precision, 10), *digitp++ - '0'); while (digitp != dp->precision_end); } } switch (dp->conversion) { case 'd': case 'i': case 'u': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'o': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'x': case 'X': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ break; case 'f': case 'F': # ifdef HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else # endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'c': # if defined HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # ifdef HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (CHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Construct the format string for calling snprintf or sprintf. */ p = buf; *p++ = '%'; if (dp->flags & FLAG_GROUP) *p++ = '\''; if (dp->flags & FLAG_LEFT) *p++ = '-'; if (dp->flags & FLAG_SHOWSIGN) *p++ = '+'; if (dp->flags & FLAG_SPACE) *p++ = ' '; if (dp->flags & FLAG_ALT) *p++ = '#'; if (dp->flags & FLAG_ZERO) *p++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; memcpy (p, dp->width_start, n * sizeof (CHAR_T)); p += n; } if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); p += n; } switch (type) { #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; /*FALLTHROUGH*/ #endif case TYPE_LONGINT: case TYPE_ULONGINT: #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; #endif default: break; } *p = dp->conversion; #if USE_SNPRINTF p[1] = '%'; p[2] = 'n'; p[3] = '\0'; #else p[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; #endif for (;;) { size_t maxlen; int count; int retcount; maxlen = allocated - length; count = -1; retcount = 0; #if USE_SNPRINTF # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF (result + length, maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; #endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && result[length + count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (p[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ p[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Make room for the result. */ if (count >= maxlen) { /* Need at least count bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); #if USE_SNPRINTF continue; #endif } #if USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (CHAR_T)); if (tmp != tmpbuf) free (tmp); #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ CHAR_T *memory; memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; return result; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef SNPRINTF #undef USE_SNPRINTF #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef VASNPRINTF pbbuttonsd-0.7.9/intl/os2compat.h0000644000175000017500000000302210463223135013656 00000000000000/* OS/2 compatibility defines. This file is intended to be included from config.h Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* When included from os2compat.h we need all the original definitions */ #ifndef OS2_AWARE #undef LIBDIR #define LIBDIR _nlos2_libdir extern char *_nlos2_libdir; #undef LOCALEDIR #define LOCALEDIR _nlos2_localedir extern char *_nlos2_localedir; #undef LOCALE_ALIAS_PATH #define LOCALE_ALIAS_PATH _nlos2_localealiaspath extern char *_nlos2_localealiaspath; #endif #undef HAVE_STRCASECMP #define HAVE_STRCASECMP 1 #define strcasecmp stricmp #define strncasecmp strnicmp /* We have our own getenv() which works even if library is compiled as DLL */ #define getenv _nl_getenv /* Older versions of gettext used -1 as the value of LC_MESSAGES */ #define LC_MESSAGES_COMPAT (-1) pbbuttonsd-0.7.9/intl/libgnuintl.h.in0000644000175000017500000003114610463223133014531 00000000000000/* Message catalogs for internationalization. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include /* The LC_MESSAGES locale category is the category used by the functions gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. On systems that don't define it, use an arbitrary value instead. On Solaris, defines __LOCALE_H (or _LOCALE_H in Solaris 2.5) then includes (i.e. this file!) and then only defines LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES in this case. */ #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun)) # define LC_MESSAGES 1729 #endif /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Provide information about the supported file formats. Returns the maximum minor revision number supported for a given major revision. */ #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \ ((major) == 0 ? 1 : -1) /* Resolve a platform specific conflict on DJGPP. GNU gettext takes precedence over _conio_gettext. */ #ifdef __DJGPP__ # undef gettext #endif #ifdef __cplusplus extern "C" { #endif /* We redirect the functions to those prefixed with "libintl_". This is necessary, because some systems define gettext/textdomain/... in the C library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer). If we used the unprefixed names, there would be cases where the definition in the C library would override the one in the libintl.so shared library. Recall that on ELF systems, the symbols are looked up in the following order: 1. in the executable, 2. in the shared libraries specified on the link command line, in order, 3. in the dependencies of the shared libraries specified on the link command line, 4. in the dlopen()ed shared libraries, in the order in which they were dlopen()ed. The definition in the C library would override the one in libintl.so if either * -lc is given on the link command line and -lintl isn't, or * -lc is given on the link command line before -lintl, or * libintl.so is a dependency of a dlopen()ed shared library but not linked to the executable at link time. Since Solaris gettext() behaves differently than GNU gettext(), this would be unacceptable. The redirection happens by default through macros in C, so that &gettext is independent of the compilation unit, but through inline functions in C++, in order not to interfere with the name mangling of class fields or class methods called 'gettext'. */ /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS. If he doesn't, we choose the method. A third possible method is _INTL_REDIRECT_ASM, supported only by GCC. */ #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) # if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus # define _INTL_REDIRECT_INLINE # else # define _INTL_REDIRECT_MACROS # endif # endif #endif /* Auxiliary macros. */ #ifdef _INTL_REDIRECT_ASM # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname)) # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring # define _INTL_STRINGIFY(prefix) #prefix #else # define _INTL_ASM(cname) #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_gettext (const char *__msgid); static inline char *gettext (const char *__msgid) { return libintl_gettext (__msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define gettext libintl_gettext #endif extern char *gettext (const char *__msgid) _INTL_ASM (libintl_gettext); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dgettext (const char *__domainname, const char *__msgid); static inline char *dgettext (const char *__domainname, const char *__msgid) { return libintl_dgettext (__domainname, __msgid); } #else #ifdef _INTL_REDIRECT_MACROS # define dgettext libintl_dgettext #endif extern char *dgettext (const char *__domainname, const char *__msgid) _INTL_ASM (libintl_dgettext); #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcgettext (const char *__domainname, const char *__msgid, int __category); static inline char *dcgettext (const char *__domainname, const char *__msgid, int __category) { return libintl_dcgettext (__domainname, __msgid, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcgettext libintl_dcgettext #endif extern char *dcgettext (const char *__domainname, const char *__msgid, int __category) _INTL_ASM (libintl_dcgettext); #endif /* Similar to `gettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n); static inline char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_ngettext (__msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define ngettext libintl_ngettext #endif extern char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_ngettext); #endif /* Similar to `dgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n); static inline char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) { return libintl_dngettext (__domainname, __msgid1, __msgid2, __n); } #else #ifdef _INTL_REDIRECT_MACROS # define dngettext libintl_dngettext #endif extern char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n) _INTL_ASM (libintl_dngettext); #endif /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category); static inline char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) { return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category); } #else #ifdef _INTL_REDIRECT_MACROS # define dcngettext libintl_dcngettext #endif extern char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category) _INTL_ASM (libintl_dcngettext); #endif /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_textdomain (const char *__domainname); static inline char *textdomain (const char *__domainname) { return libintl_textdomain (__domainname); } #else #ifdef _INTL_REDIRECT_MACROS # define textdomain libintl_textdomain #endif extern char *textdomain (const char *__domainname) _INTL_ASM (libintl_textdomain); #endif /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bindtextdomain (const char *__domainname, const char *__dirname); static inline char *bindtextdomain (const char *__domainname, const char *__dirname) { return libintl_bindtextdomain (__domainname, __dirname); } #else #ifdef _INTL_REDIRECT_MACROS # define bindtextdomain libintl_bindtextdomain #endif extern char *bindtextdomain (const char *__domainname, const char *__dirname) _INTL_ASM (libintl_bindtextdomain); #endif /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ #ifdef _INTL_REDIRECT_INLINE extern char *libintl_bind_textdomain_codeset (const char *__domainname, const char *__codeset); static inline char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) { return libintl_bind_textdomain_codeset (__domainname, __codeset); } #else #ifdef _INTL_REDIRECT_MACROS # define bind_textdomain_codeset libintl_bind_textdomain_codeset #endif extern char *bind_textdomain_codeset (const char *__domainname, const char *__codeset) _INTL_ASM (libintl_bind_textdomain_codeset); #endif /* Support for format strings with positions in *printf(), following the POSIX/XSI specification. Note: These replacements for the *printf() functions are visible only in source files that #include or #include "gettext.h". Packages that use *printf() in source files that don't refer to _() or gettext() but for which the format string could be the return value of _() or gettext() need to add this #include. Oh well. */ #if !@HAVE_POSIX_PRINTF@ #include #include /* Get va_list. */ #if __STDC__ || defined __cplusplus || defined _MSC_VER # include #else # include #endif #undef fprintf #define fprintf libintl_fprintf extern int fprintf (FILE *, const char *, ...); #undef vfprintf #define vfprintf libintl_vfprintf extern int vfprintf (FILE *, const char *, va_list); #undef printf #define printf libintl_printf extern int printf (const char *, ...); #undef vprintf #define vprintf libintl_vprintf extern int vprintf (const char *, va_list); #undef sprintf #define sprintf libintl_sprintf extern int sprintf (char *, const char *, ...); #undef vsprintf #define vsprintf libintl_vsprintf extern int vsprintf (char *, const char *, va_list); #if @HAVE_SNPRINTF@ #undef snprintf #define snprintf libintl_snprintf extern int snprintf (char *, size_t, const char *, ...); #undef vsnprintf #define vsnprintf libintl_vsnprintf extern int vsnprintf (char *, size_t, const char *, va_list); #endif #if @HAVE_ASPRINTF@ #undef asprintf #define asprintf libintl_asprintf extern int asprintf (char **, const char *, ...); #undef vasprintf #define vasprintf libintl_vasprintf extern int vasprintf (char **, const char *, va_list); #endif #if @HAVE_WPRINTF@ #undef fwprintf #define fwprintf libintl_fwprintf extern int fwprintf (FILE *, const wchar_t *, ...); #undef vfwprintf #define vfwprintf libintl_vfwprintf extern int vfwprintf (FILE *, const wchar_t *, va_list); #undef wprintf #define wprintf libintl_wprintf extern int wprintf (const wchar_t *, ...); #undef vwprintf #define vwprintf libintl_vwprintf extern int vwprintf (const wchar_t *, va_list); #undef swprintf #define swprintf libintl_swprintf extern int swprintf (wchar_t *, size_t, const wchar_t *, ...); #undef vswprintf #define vswprintf libintl_vswprintf extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); #endif #endif /* Support for relocatable packages. */ /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ #define libintl_set_relocation_prefix libintl_set_relocation_prefix extern void libintl_set_relocation_prefix (const char *orig_prefix, const char *curr_prefix); #ifdef __cplusplus } #endif #endif /* libintl.h */ pbbuttonsd-0.7.9/intl/bindtextdom.c0000644000175000017500000002312010463223131014260 00000000000000/* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; #ifdef _LIBC extern const char _nl_default_dirname_internal[] attribute_hidden; #else # define INTUSE(name) name #endif /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define BINDTEXTDOMAIN libintl_bindtextdomain # define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset #endif /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not modified, only the current value is returned. If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither modified nor returned. */ static void set_binding_values (const char *domainname, const char **dirnamep, const char **codesetp) { struct binding *binding; int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') { if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; return; } __libc_rwlock_wrlock (_nl_state_lock); modified = 0; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding != NULL) { if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The current binding has be to returned. */ *dirnamep = binding->dirname; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->dirname; if (strcmp (dirname, result) != 0) { if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) result = (char *) INTUSE(_nl_default_dirname); else { #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, dirname, len); #endif } if (__builtin_expect (result != NULL, 1)) { if (binding->dirname != INTUSE(_nl_default_dirname)) free (binding->dirname); binding->dirname = result; modified = 1; } } *dirnamep = result; } } if (codesetp) { const char *codeset = *codesetp; if (codeset == NULL) /* The current binding has be to returned. */ *codesetp = binding->codeset; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->codeset; if (result == NULL || strcmp (codeset, result) != 0) { #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, codeset, len); #endif if (__builtin_expect (result != NULL, 1)) { if (binding->codeset != NULL) free (binding->codeset); binding->codeset = result; binding->codeset_cntr++; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = INTUSE(_nl_default_dirname); if (codesetp) *codesetp = NULL; } else { /* We have to create a new binding. */ size_t len = strlen (domainname) + 1; struct binding *new_binding = (struct binding *) malloc (offsetof (struct binding, domainname) + len); if (__builtin_expect (new_binding == NULL, 0)) goto failed; memcpy (new_binding->domainname, domainname, len); if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The default value. */ dirname = INTUSE(_nl_default_dirname); else { if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0) dirname = INTUSE(_nl_default_dirname); else { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; memcpy (result, dirname, len); #endif dirname = result; } } *dirnamep = dirname; new_binding->dirname = (char *) dirname; } else /* The default value. */ new_binding->dirname = (char *) INTUSE(_nl_default_dirname); new_binding->codeset_cntr = 0; if (codesetp) { const char *codeset = *codesetp; if (codeset != NULL) { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; memcpy (result, codeset, len); #endif codeset = result; new_binding->codeset_cntr++; } *codesetp = codeset; new_binding->codeset = (char *) codeset; } else new_binding->codeset = NULL; /* Now enqueue it. */ if (_nl_domain_bindings == NULL || strcmp (domainname, _nl_domain_bindings->domainname) < 0) { new_binding->next = _nl_domain_bindings; _nl_domain_bindings = new_binding; } else { binding = _nl_domain_bindings; while (binding->next != NULL && strcmp (domainname, binding->next->domainname) > 0) binding = binding->next; new_binding->next = binding->next; binding->next = new_binding; } modified = 1; /* Here we deal with memory allocation failures. */ if (0) { failed_codeset: if (new_binding->dirname != INTUSE(_nl_default_dirname)) free (new_binding->dirname); failed_dirname: free (new_binding); failed: if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; } } /* If we modified any binding, we flush the caches. */ if (modified) ++_nl_msg_cat_cntr; __libc_rwlock_unlock (_nl_state_lock); } /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (const char *domainname, const char *dirname) { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ char * BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset) { set_binding_values (domainname, NULL, &codeset); return (char *) codeset; } #ifdef _LIBC /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif pbbuttonsd-0.7.9/intl/dcgettext.c0000644000175000017500000000341510463223131013737 00000000000000/* Implementation of the dcgettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCGETTEXT __dcgettext # define DCIGETTEXT __dcigettext #else # define DCGETTEXT libintl_dcgettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (const char *domainname, const char *msgid, int category) { return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ INTDEF(__dcgettext) weak_alias (__dcgettext, dcgettext); #endif pbbuttonsd-0.7.9/intl/dgettext.c0000644000175000017500000000336510463223132013601 00000000000000/* Implementation of the dgettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DGETTEXT __dgettext # define DCGETTEXT INTUSE(__dcgettext) #else # define DGETTEXT libintl_dgettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (const char *domainname, const char *msgid) { return DCGETTEXT (domainname, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dgettext, dgettext); #endif pbbuttonsd-0.7.9/intl/gettext.c0000644000175000017500000000355010463223132013431 00000000000000/* Implementation of gettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define GETTEXT __gettext # define DCGETTEXT INTUSE(__dcgettext) #else # define GETTEXT libintl_gettext # define DCGETTEXT libintl_dcgettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * GETTEXT (const char *msgid) { return DCGETTEXT (NULL, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif pbbuttonsd-0.7.9/intl/finddomain.c0000644000175000017500000001274310463223132014061 00000000000000/* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_l10nfile * internal_function _nl_find_domain (const char *dirname, char *locale, const char *domainname, struct binding *domainbinding) { struct loaded_l10nfile *retval; const char *language; const char *modifier; const char *territory; const char *codeset; const char *normalized_codeset; const char *special; const char *sponsor; const char *revision; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory[.codeset]][@modifier] and six parts for the CEN syntax: language[_territory][+audience][+special][,[sponsor][_revision]] Beside the first part all of them are allowed to be missing. If the full specified locale is not found, the less specific one are looked for. The various parts will be stripped off according to the following order: (1) revision (2) sponsor (3) special (4) codeset (5) normalized codeset (6) territory (7) audience/modifier */ /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, NULL, NULL, NULL, domainname, 0); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data != NULL) return retval; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } return cnt >= 0 ? retval : NULL; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { #if defined _LIBC || defined HAVE_STRDUP locale = strdup (alias_value); if (locale == NULL) return NULL; #else size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); #endif } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset, &special, &sponsor, &revision); /* Create all possible locale entries which might be interested in generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, domainname, 1); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data == NULL) { int cnt; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC libc_freeres_fn (free_mem) { struct loaded_l10nfile *runp = _nl_loaded_domains; while (runp != NULL) { struct loaded_l10nfile *here = runp; if (runp->data != NULL) _nl_unload_domain ((struct loaded_domain *) runp->data); runp = runp->next; free ((char *) here->filename); free (here); } } #endif pbbuttonsd-0.7.9/intl/loadmsgcat.c0000644000175000017500000010260210463223134014063 00000000000000/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #ifdef _LIBC # include # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES) # include # undef HAVE_MMAP # define HAVE_MMAP 1 #else # undef HAVE_MMAP #endif #if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC # include #endif #if defined HAVE_INTTYPES_H || defined _LIBC # include #endif #include "gmo.h" #include "gettextP.h" #include "hash-string.h" #include "plural-exp.h" #ifdef _LIBC # include "../locale/localeinfo.h" #endif /* Provide fallback values for macros that ought to be defined in . Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */ #if !defined PRId8 || PRI_MACROS_BROKEN # undef PRId8 # define PRId8 "d" #endif #if !defined PRIi8 || PRI_MACROS_BROKEN # undef PRIi8 # define PRIi8 "i" #endif #if !defined PRIo8 || PRI_MACROS_BROKEN # undef PRIo8 # define PRIo8 "o" #endif #if !defined PRIu8 || PRI_MACROS_BROKEN # undef PRIu8 # define PRIu8 "u" #endif #if !defined PRIx8 || PRI_MACROS_BROKEN # undef PRIx8 # define PRIx8 "x" #endif #if !defined PRIX8 || PRI_MACROS_BROKEN # undef PRIX8 # define PRIX8 "X" #endif #if !defined PRId16 || PRI_MACROS_BROKEN # undef PRId16 # define PRId16 "d" #endif #if !defined PRIi16 || PRI_MACROS_BROKEN # undef PRIi16 # define PRIi16 "i" #endif #if !defined PRIo16 || PRI_MACROS_BROKEN # undef PRIo16 # define PRIo16 "o" #endif #if !defined PRIu16 || PRI_MACROS_BROKEN # undef PRIu16 # define PRIu16 "u" #endif #if !defined PRIx16 || PRI_MACROS_BROKEN # undef PRIx16 # define PRIx16 "x" #endif #if !defined PRIX16 || PRI_MACROS_BROKEN # undef PRIX16 # define PRIX16 "X" #endif #if !defined PRId32 || PRI_MACROS_BROKEN # undef PRId32 # define PRId32 "d" #endif #if !defined PRIi32 || PRI_MACROS_BROKEN # undef PRIi32 # define PRIi32 "i" #endif #if !defined PRIo32 || PRI_MACROS_BROKEN # undef PRIo32 # define PRIo32 "o" #endif #if !defined PRIu32 || PRI_MACROS_BROKEN # undef PRIu32 # define PRIu32 "u" #endif #if !defined PRIx32 || PRI_MACROS_BROKEN # undef PRIx32 # define PRIx32 "x" #endif #if !defined PRIX32 || PRI_MACROS_BROKEN # undef PRIX32 # define PRIX32 "X" #endif #if !defined PRId64 || PRI_MACROS_BROKEN # undef PRId64 # define PRId64 (sizeof (long) == 8 ? "ld" : "lld") #endif #if !defined PRIi64 || PRI_MACROS_BROKEN # undef PRIi64 # define PRIi64 (sizeof (long) == 8 ? "li" : "lli") #endif #if !defined PRIo64 || PRI_MACROS_BROKEN # undef PRIo64 # define PRIo64 (sizeof (long) == 8 ? "lo" : "llo") #endif #if !defined PRIu64 || PRI_MACROS_BROKEN # undef PRIu64 # define PRIu64 (sizeof (long) == 8 ? "lu" : "llu") #endif #if !defined PRIx64 || PRI_MACROS_BROKEN # undef PRIx64 # define PRIx64 (sizeof (long) == 8 ? "lx" : "llx") #endif #if !defined PRIX64 || PRI_MACROS_BROKEN # undef PRIX64 # define PRIX64 (sizeof (long) == 8 ? "lX" : "llX") #endif #if !defined PRIdLEAST8 || PRI_MACROS_BROKEN # undef PRIdLEAST8 # define PRIdLEAST8 "d" #endif #if !defined PRIiLEAST8 || PRI_MACROS_BROKEN # undef PRIiLEAST8 # define PRIiLEAST8 "i" #endif #if !defined PRIoLEAST8 || PRI_MACROS_BROKEN # undef PRIoLEAST8 # define PRIoLEAST8 "o" #endif #if !defined PRIuLEAST8 || PRI_MACROS_BROKEN # undef PRIuLEAST8 # define PRIuLEAST8 "u" #endif #if !defined PRIxLEAST8 || PRI_MACROS_BROKEN # undef PRIxLEAST8 # define PRIxLEAST8 "x" #endif #if !defined PRIXLEAST8 || PRI_MACROS_BROKEN # undef PRIXLEAST8 # define PRIXLEAST8 "X" #endif #if !defined PRIdLEAST16 || PRI_MACROS_BROKEN # undef PRIdLEAST16 # define PRIdLEAST16 "d" #endif #if !defined PRIiLEAST16 || PRI_MACROS_BROKEN # undef PRIiLEAST16 # define PRIiLEAST16 "i" #endif #if !defined PRIoLEAST16 || PRI_MACROS_BROKEN # undef PRIoLEAST16 # define PRIoLEAST16 "o" #endif #if !defined PRIuLEAST16 || PRI_MACROS_BROKEN # undef PRIuLEAST16 # define PRIuLEAST16 "u" #endif #if !defined PRIxLEAST16 || PRI_MACROS_BROKEN # undef PRIxLEAST16 # define PRIxLEAST16 "x" #endif #if !defined PRIXLEAST16 || PRI_MACROS_BROKEN # undef PRIXLEAST16 # define PRIXLEAST16 "X" #endif #if !defined PRIdLEAST32 || PRI_MACROS_BROKEN # undef PRIdLEAST32 # define PRIdLEAST32 "d" #endif #if !defined PRIiLEAST32 || PRI_MACROS_BROKEN # undef PRIiLEAST32 # define PRIiLEAST32 "i" #endif #if !defined PRIoLEAST32 || PRI_MACROS_BROKEN # undef PRIoLEAST32 # define PRIoLEAST32 "o" #endif #if !defined PRIuLEAST32 || PRI_MACROS_BROKEN # undef PRIuLEAST32 # define PRIuLEAST32 "u" #endif #if !defined PRIxLEAST32 || PRI_MACROS_BROKEN # undef PRIxLEAST32 # define PRIxLEAST32 "x" #endif #if !defined PRIXLEAST32 || PRI_MACROS_BROKEN # undef PRIXLEAST32 # define PRIXLEAST32 "X" #endif #if !defined PRIdLEAST64 || PRI_MACROS_BROKEN # undef PRIdLEAST64 # define PRIdLEAST64 PRId64 #endif #if !defined PRIiLEAST64 || PRI_MACROS_BROKEN # undef PRIiLEAST64 # define PRIiLEAST64 PRIi64 #endif #if !defined PRIoLEAST64 || PRI_MACROS_BROKEN # undef PRIoLEAST64 # define PRIoLEAST64 PRIo64 #endif #if !defined PRIuLEAST64 || PRI_MACROS_BROKEN # undef PRIuLEAST64 # define PRIuLEAST64 PRIu64 #endif #if !defined PRIxLEAST64 || PRI_MACROS_BROKEN # undef PRIxLEAST64 # define PRIxLEAST64 PRIx64 #endif #if !defined PRIXLEAST64 || PRI_MACROS_BROKEN # undef PRIXLEAST64 # define PRIXLEAST64 PRIX64 #endif #if !defined PRIdFAST8 || PRI_MACROS_BROKEN # undef PRIdFAST8 # define PRIdFAST8 "d" #endif #if !defined PRIiFAST8 || PRI_MACROS_BROKEN # undef PRIiFAST8 # define PRIiFAST8 "i" #endif #if !defined PRIoFAST8 || PRI_MACROS_BROKEN # undef PRIoFAST8 # define PRIoFAST8 "o" #endif #if !defined PRIuFAST8 || PRI_MACROS_BROKEN # undef PRIuFAST8 # define PRIuFAST8 "u" #endif #if !defined PRIxFAST8 || PRI_MACROS_BROKEN # undef PRIxFAST8 # define PRIxFAST8 "x" #endif #if !defined PRIXFAST8 || PRI_MACROS_BROKEN # undef PRIXFAST8 # define PRIXFAST8 "X" #endif #if !defined PRIdFAST16 || PRI_MACROS_BROKEN # undef PRIdFAST16 # define PRIdFAST16 "d" #endif #if !defined PRIiFAST16 || PRI_MACROS_BROKEN # undef PRIiFAST16 # define PRIiFAST16 "i" #endif #if !defined PRIoFAST16 || PRI_MACROS_BROKEN # undef PRIoFAST16 # define PRIoFAST16 "o" #endif #if !defined PRIuFAST16 || PRI_MACROS_BROKEN # undef PRIuFAST16 # define PRIuFAST16 "u" #endif #if !defined PRIxFAST16 || PRI_MACROS_BROKEN # undef PRIxFAST16 # define PRIxFAST16 "x" #endif #if !defined PRIXFAST16 || PRI_MACROS_BROKEN # undef PRIXFAST16 # define PRIXFAST16 "X" #endif #if !defined PRIdFAST32 || PRI_MACROS_BROKEN # undef PRIdFAST32 # define PRIdFAST32 "d" #endif #if !defined PRIiFAST32 || PRI_MACROS_BROKEN # undef PRIiFAST32 # define PRIiFAST32 "i" #endif #if !defined PRIoFAST32 || PRI_MACROS_BROKEN # undef PRIoFAST32 # define PRIoFAST32 "o" #endif #if !defined PRIuFAST32 || PRI_MACROS_BROKEN # undef PRIuFAST32 # define PRIuFAST32 "u" #endif #if !defined PRIxFAST32 || PRI_MACROS_BROKEN # undef PRIxFAST32 # define PRIxFAST32 "x" #endif #if !defined PRIXFAST32 || PRI_MACROS_BROKEN # undef PRIXFAST32 # define PRIXFAST32 "X" #endif #if !defined PRIdFAST64 || PRI_MACROS_BROKEN # undef PRIdFAST64 # define PRIdFAST64 PRId64 #endif #if !defined PRIiFAST64 || PRI_MACROS_BROKEN # undef PRIiFAST64 # define PRIiFAST64 PRIi64 #endif #if !defined PRIoFAST64 || PRI_MACROS_BROKEN # undef PRIoFAST64 # define PRIoFAST64 PRIo64 #endif #if !defined PRIuFAST64 || PRI_MACROS_BROKEN # undef PRIuFAST64 # define PRIuFAST64 PRIu64 #endif #if !defined PRIxFAST64 || PRI_MACROS_BROKEN # undef PRIxFAST64 # define PRIxFAST64 PRIx64 #endif #if !defined PRIXFAST64 || PRI_MACROS_BROKEN # undef PRIXFAST64 # define PRIXFAST64 PRIX64 #endif #if !defined PRIdMAX || PRI_MACROS_BROKEN # undef PRIdMAX # define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld") #endif #if !defined PRIiMAX || PRI_MACROS_BROKEN # undef PRIiMAX # define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli") #endif #if !defined PRIoMAX || PRI_MACROS_BROKEN # undef PRIoMAX # define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo") #endif #if !defined PRIuMAX || PRI_MACROS_BROKEN # undef PRIuMAX # define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu") #endif #if !defined PRIxMAX || PRI_MACROS_BROKEN # undef PRIxMAX # define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx") #endif #if !defined PRIXMAX || PRI_MACROS_BROKEN # undef PRIXMAX # define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX") #endif #if !defined PRIdPTR || PRI_MACROS_BROKEN # undef PRIdPTR # define PRIdPTR \ (sizeof (void *) == sizeof (long) ? "ld" : \ sizeof (void *) == sizeof (int) ? "d" : \ "lld") #endif #if !defined PRIiPTR || PRI_MACROS_BROKEN # undef PRIiPTR # define PRIiPTR \ (sizeof (void *) == sizeof (long) ? "li" : \ sizeof (void *) == sizeof (int) ? "i" : \ "lli") #endif #if !defined PRIoPTR || PRI_MACROS_BROKEN # undef PRIoPTR # define PRIoPTR \ (sizeof (void *) == sizeof (long) ? "lo" : \ sizeof (void *) == sizeof (int) ? "o" : \ "llo") #endif #if !defined PRIuPTR || PRI_MACROS_BROKEN # undef PRIuPTR # define PRIuPTR \ (sizeof (void *) == sizeof (long) ? "lu" : \ sizeof (void *) == sizeof (int) ? "u" : \ "llu") #endif #if !defined PRIxPTR || PRI_MACROS_BROKEN # undef PRIxPTR # define PRIxPTR \ (sizeof (void *) == sizeof (long) ? "lx" : \ sizeof (void *) == sizeof (int) ? "x" : \ "llx") #endif #if !defined PRIXPTR || PRI_MACROS_BROKEN # undef PRIXPTR # define PRIXPTR \ (sizeof (void *) == sizeof (long) ? "lX" : \ sizeof (void *) == sizeof (int) ? "X" : \ "llX") #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ISO C functions. This is required by the standard because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define open __open # define close __close # define read __read # define mmap __mmap # define munmap __munmap #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif /* On reasonable systems, binary I/O is the default. */ #ifndef O_BINARY # define O_BINARY 0 #endif /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ int _nl_msg_cat_cntr; /* Expand a system dependent string segment. Return NULL if unsupported. */ static const char * get_sysdep_segment_value (const char *name) { /* Test for an ISO C 99 section 7.8.1 format string directive. Syntax: P R I { d | i | o | u | x | X } { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */ /* We don't use a table of 14 times 6 'const char *' strings here, because data relocations cost startup time. */ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I') { if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u' || name[3] == 'x' || name[3] == 'X') { if (name[4] == '8' && name[5] == '\0') { if (name[3] == 'd') return PRId8; if (name[3] == 'i') return PRIi8; if (name[3] == 'o') return PRIo8; if (name[3] == 'u') return PRIu8; if (name[3] == 'x') return PRIx8; if (name[3] == 'X') return PRIX8; abort (); } if (name[4] == '1' && name[5] == '6' && name[6] == '\0') { if (name[3] == 'd') return PRId16; if (name[3] == 'i') return PRIi16; if (name[3] == 'o') return PRIo16; if (name[3] == 'u') return PRIu16; if (name[3] == 'x') return PRIx16; if (name[3] == 'X') return PRIX16; abort (); } if (name[4] == '3' && name[5] == '2' && name[6] == '\0') { if (name[3] == 'd') return PRId32; if (name[3] == 'i') return PRIi32; if (name[3] == 'o') return PRIo32; if (name[3] == 'u') return PRIu32; if (name[3] == 'x') return PRIx32; if (name[3] == 'X') return PRIX32; abort (); } if (name[4] == '6' && name[5] == '4' && name[6] == '\0') { if (name[3] == 'd') return PRId64; if (name[3] == 'i') return PRIi64; if (name[3] == 'o') return PRIo64; if (name[3] == 'u') return PRIu64; if (name[3] == 'x') return PRIx64; if (name[3] == 'X') return PRIX64; abort (); } if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A' && name[7] == 'S' && name[8] == 'T') { if (name[9] == '8' && name[10] == '\0') { if (name[3] == 'd') return PRIdLEAST8; if (name[3] == 'i') return PRIiLEAST8; if (name[3] == 'o') return PRIoLEAST8; if (name[3] == 'u') return PRIuLEAST8; if (name[3] == 'x') return PRIxLEAST8; if (name[3] == 'X') return PRIXLEAST8; abort (); } if (name[9] == '1' && name[10] == '6' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST16; if (name[3] == 'i') return PRIiLEAST16; if (name[3] == 'o') return PRIoLEAST16; if (name[3] == 'u') return PRIuLEAST16; if (name[3] == 'x') return PRIxLEAST16; if (name[3] == 'X') return PRIXLEAST16; abort (); } if (name[9] == '3' && name[10] == '2' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST32; if (name[3] == 'i') return PRIiLEAST32; if (name[3] == 'o') return PRIoLEAST32; if (name[3] == 'u') return PRIuLEAST32; if (name[3] == 'x') return PRIxLEAST32; if (name[3] == 'X') return PRIXLEAST32; abort (); } if (name[9] == '6' && name[10] == '4' && name[11] == '\0') { if (name[3] == 'd') return PRIdLEAST64; if (name[3] == 'i') return PRIiLEAST64; if (name[3] == 'o') return PRIoLEAST64; if (name[3] == 'u') return PRIuLEAST64; if (name[3] == 'x') return PRIxLEAST64; if (name[3] == 'X') return PRIXLEAST64; abort (); } } if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S' && name[7] == 'T') { if (name[8] == '8' && name[9] == '\0') { if (name[3] == 'd') return PRIdFAST8; if (name[3] == 'i') return PRIiFAST8; if (name[3] == 'o') return PRIoFAST8; if (name[3] == 'u') return PRIuFAST8; if (name[3] == 'x') return PRIxFAST8; if (name[3] == 'X') return PRIXFAST8; abort (); } if (name[8] == '1' && name[9] == '6' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST16; if (name[3] == 'i') return PRIiFAST16; if (name[3] == 'o') return PRIoFAST16; if (name[3] == 'u') return PRIuFAST16; if (name[3] == 'x') return PRIxFAST16; if (name[3] == 'X') return PRIXFAST16; abort (); } if (name[8] == '3' && name[9] == '2' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST32; if (name[3] == 'i') return PRIiFAST32; if (name[3] == 'o') return PRIoFAST32; if (name[3] == 'u') return PRIuFAST32; if (name[3] == 'x') return PRIxFAST32; if (name[3] == 'X') return PRIXFAST32; abort (); } if (name[8] == '6' && name[9] == '4' && name[10] == '\0') { if (name[3] == 'd') return PRIdFAST64; if (name[3] == 'i') return PRIiFAST64; if (name[3] == 'o') return PRIoFAST64; if (name[3] == 'u') return PRIuFAST64; if (name[3] == 'x') return PRIxFAST64; if (name[3] == 'X') return PRIXFAST64; abort (); } } if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X' && name[7] == '\0') { if (name[3] == 'd') return PRIdMAX; if (name[3] == 'i') return PRIiMAX; if (name[3] == 'o') return PRIoMAX; if (name[3] == 'u') return PRIuMAX; if (name[3] == 'x') return PRIxMAX; if (name[3] == 'X') return PRIXMAX; abort (); } if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R' && name[7] == '\0') { if (name[3] == 'd') return PRIdPTR; if (name[3] == 'i') return PRIiPTR; if (name[3] == 'o') return PRIoPTR; if (name[3] == 'u') return PRIuPTR; if (name[3] == 'x') return PRIxPTR; if (name[3] == 'X') return PRIXPTR; abort (); } } } /* Other system dependent strings are not valid. */ return NULL; } /* Initialize the codeset dependent parts of an opened message catalog. Return the header entry. */ const char * internal_function _nl_init_domain_conv (struct loaded_l10nfile *domain_file, struct loaded_domain *domain, struct binding *domainbinding) { /* Find out about the character set the file is encoded with. This can be found (in textual form) in the entry "". If this entry does not exist or if this does not contain the `charset=' information, we will assume the charset matches the one the current locale and we don't have to perform any conversion. */ char *nullentry; size_t nullentrylen; /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ domain->codeset_cntr = (domainbinding != NULL ? domainbinding->codeset_cntr : 0); #ifdef _LIBC domain->conv = (__gconv_t) -1; #else # if HAVE_ICONV domain->conv = (iconv_t) -1; # endif #endif domain->conv_tab = NULL; /* Get the header entry. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); if (nullentry != NULL) { #if defined _LIBC || HAVE_ICONV const char *charsetstr; charsetstr = strstr (nullentry, "charset="); if (charsetstr != NULL) { size_t len; char *charset; const char *outcharset; charsetstr += strlen ("charset="); len = strcspn (charsetstr, " \t\n"); charset = (char *) alloca (len + 1); # if defined _LIBC || HAVE_MEMPCPY *((char *) mempcpy (charset, charsetstr, len)) = '\0'; # else memcpy (charset, charsetstr, len); charset[len] = '\0'; # endif /* The output charset should normally be determined by the locale. But sometimes the locale is not used or not correctly set up, so we provide a possibility for the user to override this. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) outcharset = domainbinding->codeset; else { outcharset = getenv ("OUTPUT_CHARSET"); if (outcharset == NULL || outcharset[0] == '\0') { # ifdef _LIBC outcharset = _NL_CURRENT (LC_CTYPE, CODESET); # else # if HAVE_ICONV extern const char *locale_charset (void); outcharset = locale_charset (); # endif # endif } } # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, NULL); if (__gconv_open (outcharset, charset, &domain->conv, GCONV_AVOID_NOCONV) != __GCONV_OK) domain->conv = (__gconv_t) -1; # else # if HAVE_ICONV /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, we want to use transliteration. */ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ || _LIBICONV_VERSION >= 0x0105 if (strchr (outcharset, '/') == NULL) { char *tmp; len = strlen (outcharset); tmp = (char *) alloca (len + 10 + 1); memcpy (tmp, outcharset, len); memcpy (tmp + len, "//TRANSLIT", 10 + 1); outcharset = tmp; domain->conv = iconv_open (outcharset, charset); freea (outcharset); } else # endif domain->conv = iconv_open (outcharset, charset); # endif # endif freea (charset); } #endif /* _LIBC || HAVE_ICONV */ } return nullentry; } /* Frees the codeset dependent parts of an opened message catalog. */ void internal_function _nl_free_domain_conv (struct loaded_domain *domain) { if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) free (domain->conv_tab); #ifdef _LIBC if (domain->conv != (__gconv_t) -1) __gconv_close (domain->conv); #else # if HAVE_ICONV if (domain->conv != (iconv_t) -1) iconv_close (domain->conv); # endif #endif } /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void internal_function _nl_load_domain (struct loaded_l10nfile *domain_file, struct binding *domainbinding) { int fd; size_t size; #ifdef _LIBC struct stat64 st; #else struct stat st; #endif struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; int revision; const char *nullentry; domain_file->decided = 1; domain_file->data = NULL; /* Note that it would be useless to store domainbinding in domain_file because domainbinding might be == NULL now but != NULL later (after a call to bind_textdomain_codeset). */ /* If the record does not represent a valid locale the FILENAME might be NULL. This can happen when according to the given specification the locale file name is different for XPG and CEN syntax. */ if (domain_file->filename == NULL) return; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) return; /* We must know about the size of the file. */ if ( #ifdef _LIBC __builtin_expect (fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) { /* Something went wrong. */ close (fd); return; } #ifdef HAVE_MMAP /* Now we are ready to load the file. If mmap() is available we try this first. If not available or it failed we try to load it. */ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) { /* mmap() call was successful. */ close (fd); use_mmap = 1; } #endif /* If the data is not yet available (i.e. mmap'ed) we try to load it manually. */ if (data == (struct mo_file_header *) -1) { size_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (size); if (data == NULL) return; to_read = size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb <= 0) { #ifdef EINTR if (nb == -1 && errno == EINTR) continue; #endif close (fd); return; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); } /* Using the magic number we can test whether it really is a message catalog file. */ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) { /* The magic number is wrong: not a message catalog file. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); return; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) return; domain_file->data = domain; domain->data = (char *) data; domain->use_mmap = use_mmap; domain->mmap_size = size; domain->must_swap = data->magic != _MAGIC; domain->malloced = NULL; /* Fill in the information about the available tables. */ revision = W (domain->must_swap, data->revision); /* We support only the major revision 0. */ switch (revision >> 16) { case 0: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (const struct string_desc *) ((char *) data + W (domain->must_swap, data->trans_tab_offset)); domain->hash_size = W (domain->must_swap, data->hash_tab_size); domain->hash_tab = (domain->hash_size > 2 ? (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)) : NULL); domain->must_swap_hash_tab = domain->must_swap; /* Now dispatch on the minor revision. */ switch (revision & 0xffff) { case 0: domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; break; case 1: default: { nls_uint32 n_sysdep_strings; if (domain->hash_tab == NULL) /* This is invalid. These minor revisions need a hash table. */ goto invalid; n_sysdep_strings = W (domain->must_swap, data->n_sysdep_strings); if (n_sysdep_strings > 0) { nls_uint32 n_sysdep_segments; const struct sysdep_segment *sysdep_segments; const char **sysdep_segment_values; const nls_uint32 *orig_sysdep_tab; const nls_uint32 *trans_sysdep_tab; size_t memneed; char *mem; struct sysdep_string_desc *inmem_orig_sysdep_tab; struct sysdep_string_desc *inmem_trans_sysdep_tab; nls_uint32 *inmem_hash_tab; unsigned int i; /* Get the values of the system dependent segments. */ n_sysdep_segments = W (domain->must_swap, data->n_sysdep_segments); sysdep_segments = (const struct sysdep_segment *) ((char *) data + W (domain->must_swap, data->sysdep_segments_offset)); sysdep_segment_values = alloca (n_sysdep_segments * sizeof (const char *)); for (i = 0; i < n_sysdep_segments; i++) { const char *name = (char *) data + W (domain->must_swap, sysdep_segments[i].offset); nls_uint32 namelen = W (domain->must_swap, sysdep_segments[i].length); if (!(namelen > 0 && name[namelen - 1] == '\0')) { freea (sysdep_segment_values); goto invalid; } sysdep_segment_values[i] = get_sysdep_segment_value (name); } orig_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->orig_sysdep_tab_offset)); trans_sysdep_tab = (const nls_uint32 *) ((char *) data + W (domain->must_swap, data->trans_sysdep_tab_offset)); /* Compute the amount of additional memory needed for the system dependent strings and the augmented hash table. */ memneed = 2 * n_sysdep_strings * sizeof (struct sysdep_string_desc) + domain->hash_size * sizeof (nls_uint32); for (i = 0; i < 2 * n_sysdep_strings; i++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, i < n_sysdep_strings ? orig_sysdep_tab[i] : trans_sysdep_tab[i - n_sysdep_strings])); size_t need = 0; const struct segment_pair *p = sysdep_string->segments; if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END) for (p = sysdep_string->segments;; p++) { nls_uint32 sysdepref; need += W (domain->must_swap, p->segsize); sysdepref = W (domain->must_swap, p->sysdepref); if (sysdepref == SEGMENTS_END) break; if (sysdepref >= n_sysdep_segments) { /* Invalid. */ freea (sysdep_segment_values); goto invalid; } need += strlen (sysdep_segment_values[sysdepref]); } memneed += need; } /* Allocate additional memory. */ mem = (char *) malloc (memneed); if (mem == NULL) goto invalid; domain->malloced = mem; inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem; mem += n_sysdep_strings * sizeof (struct sysdep_string_desc); inmem_hash_tab = (nls_uint32 *) mem; mem += domain->hash_size * sizeof (nls_uint32); /* Compute the system dependent strings. */ for (i = 0; i < 2 * n_sysdep_strings; i++) { const struct sysdep_string *sysdep_string = (const struct sysdep_string *) ((char *) data + W (domain->must_swap, i < n_sysdep_strings ? orig_sysdep_tab[i] : trans_sysdep_tab[i - n_sysdep_strings])); const char *static_segments = (char *) data + W (domain->must_swap, sysdep_string->offset); const struct segment_pair *p = sysdep_string->segments; /* Concatenate the segments, and fill inmem_orig_sysdep_tab[i] (for i < n_sysdep_strings) and inmem_trans_sysdep_tab[i-n_sysdep_strings] (for i >= n_sysdep_strings). */ if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END) { /* Only one static segment. */ inmem_orig_sysdep_tab[i].length = W (domain->must_swap, p->segsize); inmem_orig_sysdep_tab[i].pointer = static_segments; } else { inmem_orig_sysdep_tab[i].pointer = mem; for (p = sysdep_string->segments;; p++) { nls_uint32 segsize = W (domain->must_swap, p->segsize); nls_uint32 sysdepref = W (domain->must_swap, p->sysdepref); size_t n; if (segsize > 0) { memcpy (mem, static_segments, segsize); mem += segsize; static_segments += segsize; } if (sysdepref == SEGMENTS_END) break; n = strlen (sysdep_segment_values[sysdepref]); memcpy (mem, sysdep_segment_values[sysdepref], n); mem += n; } inmem_orig_sysdep_tab[i].length = mem - inmem_orig_sysdep_tab[i].pointer; } } /* Compute the augmented hash table. */ for (i = 0; i < domain->hash_size; i++) inmem_hash_tab[i] = W (domain->must_swap_hash_tab, domain->hash_tab[i]); for (i = 0; i < n_sysdep_strings; i++) { const char *msgid = inmem_orig_sysdep_tab[i].pointer; nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); for (;;) { if (inmem_hash_tab[idx] == 0) { /* Hash table entry is empty. Use it. */ inmem_hash_tab[idx] = 1 + domain->nstrings + i; break; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } } freea (sysdep_segment_values); domain->n_sysdep_strings = n_sysdep_strings; domain->orig_sysdep_tab = inmem_orig_sysdep_tab; domain->trans_sysdep_tab = inmem_trans_sysdep_tab; domain->hash_tab = inmem_hash_tab; domain->must_swap_hash_tab = 0; } else { domain->n_sysdep_strings = 0; domain->orig_sysdep_tab = NULL; domain->trans_sysdep_tab = NULL; } } break; } break; default: /* This is an invalid revision. */ invalid: /* This is an invalid .mo file. */ if (domain->malloced) free (domain->malloced); #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); free (domain); domain_file->data = NULL; return; } /* Now initialize the character set converter from the character set the file is encoded with (found in the header entry) to the domain's specified character set or the locale's character set. */ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); /* Also look for a plural specification. */ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); } #ifdef _LIBC void internal_function _nl_unload_domain (struct loaded_domain *domain) { if (domain->plural != &__gettext_germanic_plural) __gettext_free_exp (domain->plural); _nl_free_domain_conv (domain); if (domain->malloced) free (domain->malloced); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap) munmap ((caddr_t) domain->data, domain->mmap_size); else # endif /* _POSIX_MAPPED_FILES */ free ((void *) domain->data); free (domain); } #endif pbbuttonsd-0.7.9/intl/localealias.c0000644000175000017500000002334010463223134014217 00000000000000/* Handle aliases for locale names. Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _LIBC || defined HAVE___FSETLOCKING # include #endif #include #ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #include #include "gettextP.h" #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define strcasecmp __strcasecmp # ifndef mempcpy # define mempcpy __mempcpy # endif # define HAVE_MEMPCPY 1 # define HAVE___FSETLOCKING 1 /* We need locking here since we can be called from different places. */ # include __libc_lock_define_initialized (static, lock); #endif #ifndef internal_function # define internal_function #endif /* Some optimizations for glibc. */ #ifdef _LIBC # define FEOF(fp) feof_unlocked (fp) # define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp) #else # define FEOF(fp) feof (fp) # define FGETS(buf, n, fp) fgets (buf, n, fp) #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED # undef fgets # define fgets(buf, len, s) fgets_unlocked (buf, len, s) #endif #if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED # undef feof # define feof(s) feof_unlocked (s) #endif struct alias_map { const char *alias; const char *value; }; #ifndef _LIBC # define libc_freeres_ptr(decl) decl #endif libc_freeres_ptr (static char *string_space); static size_t string_space_act; static size_t string_space_max; libc_freeres_ptr (static struct alias_map *map); static size_t nmap; static size_t maxmap; /* Prototypes for local functions. */ static size_t read_alias_file (const char *fname, int fname_len) internal_function; static int extend_alias_table (void); static int alias_compare (const struct alias_map *map1, const struct alias_map *map2); const char * _nl_expand_alias (const char *name) { static const char *locale_alias_path; struct alias_map *retval; const char *result = NULL; size_t added; #ifdef _LIBC __libc_lock_lock (lock); #endif if (locale_alias_path == NULL) locale_alias_path = LOCALE_ALIAS_PATH; do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) (const void *, const void *) ) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) { result = retval->value; break; } /* Perhaps we can find another alias file. */ added = 0; while (added == 0 && locale_alias_path[0] != '\0') { const char *start; while (locale_alias_path[0] == PATH_SEPARATOR) ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR) ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); #ifdef _LIBC __libc_lock_unlock (lock); #endif return result; } static size_t internal_function read_alias_file (const char *fname, int fname_len) { FILE *fp; char *full_fname; size_t added; static const char aliasfile[] = "/locale.alias"; full_fname = (char *) alloca (fname_len + sizeof aliasfile); #ifdef HAVE_MEMPCPY mempcpy (mempcpy (full_fname, fname, fname_len), aliasfile, sizeof aliasfile); #else memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif fp = fopen (relocate (full_fname), "r"); freea (full_fname); if (fp == NULL) return 0; #ifdef HAVE___FSETLOCKING /* No threads present. */ __fsetlocking (fp, FSETLOCKING_BYCALLER); #endif added = 0; while (!FEOF (fp)) { /* It is a reasonable approach to use a fix buffer here because a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long We avoid a multi-kilobyte buffer here since this would use up stack space which we might not have if the program ran out of memory. */ char buf[400]; char *alias; char *value; char *cp; if (FGETS (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; cp = buf; /* Ignore leading white space. */ while (isspace ((unsigned char) cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace ((unsigned char) cp[0])) ++cp; if (cp[0] != '\0') { size_t alias_len; size_t value_len; value = cp++; while (cp[0] != '\0' && !isspace ((unsigned char) cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') { /* This has to be done to make the following test for the end of line possible. We are looking for the terminating '\n' which do not overwrite here. */ *cp++ = '\0'; *cp = '\n'; } else if (cp[0] != '\0') *cp++ = '\0'; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) return added; alias_len = strlen (alias) + 1; value_len = strlen (value) + 1; if (string_space_act + alias_len + value_len > string_space_max) { /* Increase size of memory pool. */ size_t new_size = (string_space_max + (alias_len + value_len > 1024 ? alias_len + value_len : 1024)); char *new_pool = (char *) realloc (string_space, new_size); if (new_pool == NULL) return added; if (__builtin_expect (string_space != new_pool, 0)) { size_t i; for (i = 0; i < nmap; i++) { map[i].alias += new_pool - string_space; map[i].value += new_pool - string_space; } } string_space = new_pool; string_space_max = new_size; } map[nmap].alias = memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = memcpy (&string_space[string_space_act], value, value_len); string_space_act += value_len; ++nmap; ++added; } } /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ while (strchr (buf, '\n') == NULL) if (FGETS (buf, sizeof buf, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; } /* Should we test for ferror()? I think we have to silently ignore errors. --drepper */ fclose (fp); if (added > 0) qsort (map, nmap, sizeof (struct alias_map), (int (*) (const void *, const void *)) alias_compare); return added; } static int extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) realloc (map, (new_size * sizeof (struct alias_map))); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return -1; map = new_map; maxmap = new_size; return 0; } static int alias_compare (const struct alias_map *map1, const struct alias_map *map2) { #if defined _LIBC || defined HAVE_STRCASECMP return strcasecmp (map1->alias, map2->alias); #else const unsigned char *p1 = (const unsigned char *) map1->alias; const unsigned char *p2 = (const unsigned char *) map2->alias; unsigned char c1, c2; if (p1 == p2) return 0; do { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ c1 = isupper (*p1) ? tolower (*p1) : *p1; c2 = isupper (*p2) ? tolower (*p2) : *p2; if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); return c1 - c2; #endif } pbbuttonsd-0.7.9/intl/textdomain.c0000644000175000017500000001066010463223136014125 00000000000000/* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain #endif /* @@ end of prolog @@ */ /* Name of the default text domain. */ extern const char _nl_default_default_domain[] attribute_hidden; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain attribute_hidden; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define TEXTDOMAIN libintl_textdomain #endif /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden) /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ char * TEXTDOMAIN (const char *domainname) { char *new_domain; char *old_domain; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; __libc_rwlock_wrlock (_nl_state_lock); old_domain = (char *) _nl_current_default_domain; /* If domain name is the null string set to default domain "messages". */ if (domainname[0] == '\0' || strcmp (domainname, _nl_default_default_domain) == 0) { _nl_current_default_domain = _nl_default_default_domain; new_domain = (char *) _nl_current_default_domain; } else if (strcmp (domainname, old_domain) == 0) /* This can happen and people will use it to signal that some environment variable changed. */ new_domain = old_domain; else { /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ #if defined _LIBC || defined HAVE_STRDUP new_domain = strdup (domainname); #else size_t len = strlen (domainname) + 1; new_domain = (char *) malloc (len); if (new_domain != NULL) memcpy (new_domain, domainname, len); #endif if (new_domain != NULL) _nl_current_default_domain = new_domain; } /* We use this possibility to signal a change of the loaded catalogs since this is most likely the case and there is no other easy we to do it. Do it only when the call was successful. */ if (new_domain != NULL) { ++_nl_msg_cat_cntr; if (old_domain != new_domain && old_domain != _nl_default_default_domain) free (old_domain); } __libc_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif pbbuttonsd-0.7.9/intl/l10nflist.c0000644000175000017500000002733010463223133013564 00000000000000/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for stpcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #if defined _LIBC || defined HAVE_ARGZ_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # ifndef stpcpy # define stpcpy(dest, src) __stpcpy(dest, src) # endif #else # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) #endif /* Define function which are usually not available. */ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT /* Returns the number of strings in ARGZ. */ static size_t argz_count__ (const char *argz, size_t len) { size_t count = 0; while (len > 0) { size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; } return count; } # undef __argz_count # define __argz_count(argz, len) argz_count__ (argz, len) #else # ifdef _LIBC # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) # endif #endif /* !_LIBC && !HAVE___ARGZ_COUNT */ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ static void argz_stringify__ (char *argz, size_t len, int sep) { while (len > 0) { size_t part_len = strlen (argz); argz += part_len; len -= part_len + 1; if (len > 0) *argz++ = sep; } } # undef __argz_stringify # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) #else # ifdef _LIBC # define __argz_stringify(argz, len, sep) \ INTUSE(__argz_stringify) (argz, len, sep) # endif #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT static char * argz_next__ (char *argz, size_t argz_len, const char *entry) { if (entry) { if (entry < argz + argz_len) entry = strchr (entry, '\0') + 1; return entry >= argz + argz_len ? NULL : (char *) entry; } else if (argz_len > 0) return argz; else return 0; } # undef __argz_next # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) #endif /* !_LIBC && !HAVE___ARGZ_NEXT */ /* Return number of bits set in X. */ static inline int pop (int x) { /* We assume that no more than 16 bits are used. */ x = ((x & ~0x5555) >> 1) + (x & 0x5555); x = ((x & ~0x3333) >> 2) + (x & 0x3333); x = ((x >> 4) + x) & 0x0f0f; x = ((x >> 8) + x) & 0xff; return x; } struct loaded_l10nfile * _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *filename, int do_allocate) { char *abs_filename; struct loaded_l10nfile **lastp; struct loaded_l10nfile *retval; char *cp; size_t dirlist_count; size_t entries; int cnt; /* If LANGUAGE contains an absolute directory specification, we ignore DIRLIST. */ if (IS_ABSOLUTE_PATH (language)) dirlist_len = 0; /* Allocate room for the full file name. */ abs_filename = (char *) malloc (dirlist_len + strlen (language) + ((mask & TERRITORY) != 0 ? strlen (territory) + 1 : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) + 1 : 0) + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + (((mask & XPG_MODIFIER) != 0 || (mask & CEN_AUDIENCE) != 0) ? strlen (modifier) + 1 : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) + 1 : 0) + (((mask & CEN_SPONSOR) != 0 || (mask & CEN_REVISION) != 0) ? (1 + ((mask & CEN_SPONSOR) != 0 ? strlen (sponsor) : 0) + ((mask & CEN_REVISION) != 0 ? strlen (revision) + 1 : 0)) : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) return NULL; /* Construct file name. */ cp = abs_filename; if (dirlist_len > 0) { memcpy (cp, dirlist, dirlist_len); __argz_stringify (cp, dirlist_len, PATH_SEPARATOR); cp += dirlist_len; cp[-1] = '/'; } cp = stpcpy (cp, language); if ((mask & TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & XPG_NORM_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, normalized_codeset); } if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) { /* This component can be part of both syntaces but has different leading characters. For CEN we use `+', else `@'. */ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; cp = stpcpy (cp, modifier); } if ((mask & CEN_SPECIAL) != 0) { *cp++ = '+'; cp = stpcpy (cp, special); } if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) { *cp++ = ','; if ((mask & CEN_SPONSOR) != 0) cp = stpcpy (cp, sponsor); if ((mask & CEN_REVISION) != 0) { *cp++ = '_'; cp = stpcpy (cp, revision); } } *cp++ = '/'; stpcpy (cp, filename); /* Look in list of already loaded domains whether it is already available. */ lastp = l10nfile_list; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } lastp = &retval->next; } if (retval != NULL || do_allocate == 0) { free (abs_filename); return retval; } dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1); /* Allocate a new loaded_l10nfile. */ retval = (struct loaded_l10nfile *) malloc (sizeof (*retval) + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0)) * sizeof (struct loaded_l10nfile *))); if (retval == NULL) return NULL; retval->filename = abs_filename; /* We set retval->data to NULL here; it is filled in later. Setting retval->decided to 1 here means that retval does not correspond to a real file (dirlist_count > 1) or is not worth looking up (if an unnormalized codeset was specified). */ retval->decided = (dirlist_count > 1 || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0)); retval->data = NULL; retval->next = *lastp; *lastp = retval; entries = 0; /* Recurse to fill the inheritance list of RETVAL. If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL entry does not correspond to a real file; retval->filename contains colons. In this case we loop across all elements of DIRLIST and across all bit patterns dominated by MASK. If the DIRLIST is a single directory or entirely redundant (i.e. DIRLIST_COUNT == 1), we loop across all bit patterns dominated by MASK, excluding MASK itself. In either case, we loop down from MASK to 0. This has the effect that the extra bits in the locale name are dropped in this order: first the modifier, then the territory, then the codeset, then the normalized_codeset. */ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt) if ((cnt & ~mask) == 0 && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) { if (dirlist_count > 1) { /* Iterate over all elements of the DIRLIST. */ char *dir = NULL; while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) != NULL) retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, 1); } else retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, 1); } retval->successor[entries] = NULL; return retval; } /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ const char * _nl_normalize_codeset (const char *codeset, size_t name_len) { int len = 0; int only_digit = 1; char *retval; char *wp; size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) if (isalnum ((unsigned char) codeset[cnt])) { ++len; if (isalpha ((unsigned char) codeset[cnt])) only_digit = 0; } retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); if (retval != NULL) { if (only_digit) wp = stpcpy (retval, "iso"); else wp = retval; for (cnt = 0; cnt < name_len; ++cnt) if (isalpha ((unsigned char) codeset[cnt])) *wp++ = tolower ((unsigned char) codeset[cnt]); else if (isdigit ((unsigned char) codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; } return (const char *) retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif pbbuttonsd-0.7.9/intl/explodename.c0000644000175000017500000001064310463223132014247 00000000000000/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ char * _nl_find_language (const char *name) { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '+' && name[0] != ',') ++name; return (char *) name; } int _nl_explode_name (char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision) { enum { undecided, xpg, cen } syntax; char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; *special = NULL; *sponsor = NULL; *revision = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = 0; syntax = undecided; *language = cp = name; cp = _nl_find_language (*language); if (*language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ cp = strchr (*language, '\0'); else if (cp[0] == '_') { /* Next is the territory. */ cp[0] = '\0'; *territory = ++cp; while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= TERRITORY; if (cp[0] == '.') { /* Next is the codeset. */ syntax = xpg; cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) { /* Next is the modifier. */ syntax = cp[0] == '@' ? xpg : cen; cp[0] = '\0'; *modifier = ++cp; while (syntax == cen && cp[0] != '\0' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= XPG_MODIFIER | CEN_AUDIENCE; } if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) { syntax = cen; if (cp[0] == '+') { /* Next is special application (CEN syntax). */ cp[0] = '\0'; *special = ++cp; while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= CEN_SPECIAL; } if (cp[0] == ',') { /* Next is sponsor (CEN syntax). */ cp[0] = '\0'; *sponsor = ++cp; while (cp[0] != '\0' && cp[0] != '_') ++cp; mask |= CEN_SPONSOR; } if (cp[0] == '_') { /* Next is revision (CEN syntax). */ cp[0] = '\0'; *revision = ++cp; mask |= CEN_REVISION; } } /* For CEN syntax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { if (*territory != NULL && (*territory)[0] == '\0') mask &= ~TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; if (*modifier != NULL && (*modifier)[0] == '\0') mask &= ~XPG_MODIFIER; } return mask; } pbbuttonsd-0.7.9/intl/dcigettext.c0000644000175000017500000010125310463223132014110 00000000000000/* Implementation of the internal dcigettext function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include #ifdef _LIBC /* Guess whether integer division by zero raises signal SIGFPE. Set to 1 only if you know for sure. In case of doubt, set to 0. */ # if defined __alpha__ || defined __arm__ || defined __i386__ \ || defined __m68k__ || defined __s390__ # define INTDIV0_RAISES_SIGFPE 1 # else # define INTDIV0_RAISES_SIGFPE 0 # endif #endif #if !INTDIV0_RAISES_SIGFPE # include #endif #if defined HAVE_SYS_PARAM_H || defined _LIBC # include #endif #include "gettextP.h" #include "plural-exp.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "hash-string.h" /* Thread safetyness. */ #ifdef _LIBC # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_lock_define_initialized(CLASS, NAME) # define __libc_lock_lock(NAME) # define __libc_lock_unlock(NAME) # define __libc_rwlock_define_initialized(CLASS, NAME) # define __libc_rwlock_rdlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* Alignment of types. */ #if defined __GNUC__ && __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain libintl_nl_default_default_domain # define _nl_current_default_domain libintl_nl_current_default_domain # define _nl_default_dirname libintl_nl_default_dirname # define _nl_domain_bindings libintl_nl_domain_bindings #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy # endif # define tfind __tfind #else # if !defined HAVE_GETCWD char *getwd (); # define getcwd(buf, max) getwd (buf) # else # if VMS # define getcwd(buf, max) (getcwd) (buf, max, 0) # else char *getcwd (); # endif # endif # ifndef HAVE_STPCPY static char *stpcpy (char *dest, const char *src); # endif # ifndef HAVE_MEMPCPY static void *mempcpy (void *dest, const void *src, size_t n); # endif #endif /* Amount to increase buffer size by in each try. */ #define PATH_INCR 32 /* The following is from pathmax.h. */ /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ #if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) # include #endif #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 255 #endif #if !defined PATH_MAX && defined _PC_PATH_MAX # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) #endif /* Don't include sys/param.h if it already has been. */ #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) #endif /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ char *domainname; /* The category. */ int category; /* State of the catalog counter at the point the string was found. */ int counter; /* Catalog where the string was found. */ struct loaded_l10nfile *domain; /* And finally the translation. */ const char *translation; size_t translation_length; /* Pointer to the string in question. */ char msgid[ZERO]; }; /* Root of the search tree with known translations. We can use this only if the system provides the `tsearch' function family. */ #if defined HAVE_TSEARCH || defined _LIBC # include static void *root; # ifdef _LIBC # define tsearch __tsearch # endif /* Function to compare two entries in the table of known translations. */ static int transcmp (const void *p1, const void *p2) { const struct known_translation_t *s1; const struct known_translation_t *s2; int result; s1 = (const struct known_translation_t *) p1; s2 = (const struct known_translation_t *) p2; result = strcmp (s1->msgid, s2->msgid); if (result == 0) { result = strcmp (s1->domainname, s2->domainname); if (result == 0) /* We compare the category last (though this is the cheapest operation) since it is hopefully always the same (namely LC_MESSAGES). */ result = s1->category - s2->category; } return result; } #endif #ifndef INTVARDEF # define INTVARDEF(name) #endif #ifndef INTUSE # define INTUSE(name) name #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] attribute_hidden = "messages"; /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain attribute_hidden = _nl_default_default_domain; /* Contains the default location of the message catalogs. */ #if defined __EMX__ extern const char _nl_default_dirname[]; #else const char _nl_default_dirname[] = LOCALEDIR; INTVARDEF (_nl_default_dirname) #endif /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; /* Prototypes for local functions. */ static char *plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) internal_function; static const char *guess_category_value (int category, const char *categoryname) internal_function; #ifdef _LIBC # include "../locale/localeinfo.h" # define category_to_name(category) _nl_category_names[category] #else static const char *category_to_name (int category) internal_function; #endif /* For those loosing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA /* Nothing has to be done. */ # define freea(p) /* nothing */ # define ADD_BLOCK(list, address) /* nothing */ # define FREE_BLOCKS(list) /* nothing */ #else struct block_list { void *address; struct block_list *next; }; # define ADD_BLOCK(list, addr) \ do { \ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ /* If we cannot get a free block we cannot add the new element to \ the list. */ \ if (newp != NULL) { \ newp->address = (addr); \ newp->next = (list); \ (list) = newp; \ } \ } while (0) # define FREE_BLOCKS(list) \ do { \ while (list != NULL) { \ struct block_list *old = list; \ list = list->next; \ free (old->address); \ free (old); \ } \ } while (0) # undef alloca # define alloca(size) (malloc (size)) # define freea(p) free (p) #endif /* have alloca */ #ifdef _LIBC /* List of blocks allocated for translations. */ typedef struct transmem_list { struct transmem_list *next; char data[ZERO]; } transmem_block_t; static struct transmem_list *transmem_list; #else typedef unsigned char transmem_block_t; #endif /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCIGETTEXT __dcigettext #else # define DCIGETTEXT libintl_dcigettext #endif /* Lock variable to protect the global data in the gettext implementation. */ #ifdef _LIBC __libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden) #endif /* Checking whether the binaries runs SUID must be done and glibc provides easier methods therefore we make a difference here. */ #ifdef _LIBC # define ENABLE_SECURE __libc_enable_secure # define DETERMINE_SECURE #else # ifndef HAVE_GETUID # define getuid() 0 # endif # ifndef HAVE_GETGID # define getgid() 0 # endif # ifndef HAVE_GETEUID # define geteuid() getuid() # endif # ifndef HAVE_GETEGID # define getegid() getgid() # endif static int enable_secure; # define ENABLE_SECURE (enable_secure == 1) # define DETERMINE_SECURE \ if (enable_secure == 0) \ { \ if (getuid () != geteuid () || getgid () != getegid ()) \ enable_secure = 1; \ else \ enable_secure = -1; \ } #endif /* Get the function to evaluate the plural expression. */ #include "eval-plural.h" /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale and, if PLURAL is nonzero, search over string depending on the plural form determined by N. */ char * DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, int plural, unsigned long int n, int category) { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; char *dirname, *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; #if defined HAVE_TSEARCH || defined _LIBC struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; #endif size_t domainname_len; /* If no real MSGID is given return NULL. */ if (msgid1 == NULL) return NULL; #ifdef _LIBC if (category < 0 || category >= __LC_LAST || category == LC_ALL) /* Bogus. */ return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); #endif __libc_rwlock_rdlock (_nl_state_lock); /* If DOMAINNAME is NULL, we are interested in the default domain. If CATEGORY is not LC_MESSAGES this might not make much sense but the definition left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; /* OS/2 specific: backward compatibility with older libintl versions */ #ifdef LC_MESSAGES_COMPAT if (category == LC_MESSAGES_COMPAT) category = LC_MESSAGES; #endif #if defined HAVE_TSEARCH || defined _LIBC msgid_len = strlen (msgid1) + 1; /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domainname = (char *) domainname; search->category = category; foundp = (struct known_translation_t **) tfind (search, &root, transcmp); freea (search); if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) { /* Now deal with plural. */ if (plural) retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, (*foundp)->translation_length); else retval = (char *) (*foundp)->translation; __libc_rwlock_unlock (_nl_state_lock); return retval; } #endif /* Preserve the `errno' value. */ saved_errno = errno; /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = (char *) INTUSE(_nl_default_dirname); else if (IS_ABSOLUTE_PATH (binding->dirname)) dirname = binding->dirname; else { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (binding->dirname) + 1; size_t path_max; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); __set_errno (0); ret = getcwd (dirname, path_max); if (ret != NULL || errno != ERANGE) break; path_max += path_max / 2; path_max += PATH_INCR; } if (ret == NULL) /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ goto return_untranslated; stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); } /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); categoryvalue = guess_category_value (category, categoryname); domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname, domainname_len), ".mo"); /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); ADD_BLOCK (block_list, single_locale); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for the translation. */ while (1) { /* Make CATEGORYVALUE point to the next element of the list. */ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ++categoryvalue; if (categoryvalue[0] == '\0') { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation by implicitly appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; } else { char *cp = single_locale; while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') *cp++ = *categoryvalue++; *cp = '\0'; /* When this is a SUID binary we must not allow accessing files outside the dedicated directories. */ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) /* Ingore this entry. */ continue; } /* If the current locale value is C (or POSIX) we don't load a domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) break; /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); if (domain != NULL) { retval = _nl_find_msg (domain, binding, msgid1, &retlen); if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, &retlen); if (retval != NULL) { domain = domain->successor[cnt]; break; } } } if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ struct known_translation_t *newp; newp = (struct known_translation_t *) malloc (offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1); if (newp != NULL) { newp->domainname = mempcpy (newp->msgid, msgid1, msgid_len); memcpy (newp->domainname, domainname, domainname_len + 1); newp->category = category; newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); if (foundp == NULL || __builtin_expect (*foundp != newp, 0)) /* The insert failed. */ free (newp); } } else { /* We can update the existing entry. */ (*foundp)->counter = _nl_msg_cat_cntr; (*foundp)->domain = domain; (*foundp)->translation = retval; (*foundp)->translation_length = retlen; } #endif __set_errno (saved_errno); /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); __libc_rwlock_unlock (_nl_state_lock); return retval; } } } return_untranslated: /* Return the untranslated MSGID. */ FREE_BLOCKS (block_list); __libc_rwlock_unlock (_nl_state_lock); #ifndef _LIBC if (!ENABLE_SECURE) { extern void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural); const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED"); if (logfilename != NULL && logfilename[0] != '\0') _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural); } #endif __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } char * internal_function _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp) { struct loaded_domain *domain; nls_uint32 nstrings; size_t act; char *result; size_t resultlen; if (domain_file->decided == 0) _nl_load_domain (domain_file, domainbinding); if (domain_file->data == NULL) return NULL; domain = (struct loaded_domain *) domain_file->data; nstrings = domain->nstrings; /* Locate the MSGID and its translation. */ if (domain->hash_tab != NULL) { /* Use the hashing table. */ nls_uint32 len = strlen (msgid); nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); while (1) { nls_uint32 nstr = W (domain->must_swap_hash_tab, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; nstr--; /* Compare msgid with the original string at index nstr. We compare the lengths with >=, not ==, because plural entries are represented by strings with an embedded NUL. */ if (nstr < nstrings ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len && (strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr].offset)) == 0) : domain->orig_sysdep_tab[nstr - nstrings].length > len && (strcmp (msgid, domain->orig_sysdep_tab[nstr - nstrings].pointer) == 0)) { act = nstr; goto found; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } /* NOTREACHED */ } else { /* Try the default method: binary search in the sorted array of messages. */ size_t top, bottom; bottom = 0; top = nstrings; while (bottom < top) { int cmp_val; act = (bottom + top) / 2; cmp_val = strcmp (msgid, (domain->data + W (domain->must_swap, domain->orig_tab[act].offset))); if (cmp_val < 0) top = act; else if (cmp_val > 0) bottom = act + 1; else goto found; } /* No translation was found. */ return NULL; } found: /* The translation was found at index ACT. If we have to convert the string to use a different character set, this is the time. */ if (act < nstrings) { result = (char *) (domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; } else { result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer; resultlen = domain->trans_sysdep_tab[act - nstrings].length; } #if defined _LIBC || HAVE_ICONV if (domain->codeset_cntr != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) { /* The domain's codeset has changed through bind_textdomain_codeset() since the message catalog was initialized or last accessed. We have to reinitialize the converter. */ _nl_free_domain_conv (domain); _nl_init_domain_conv (domain_file, domain, domainbinding); } if ( # ifdef _LIBC domain->conv != (__gconv_t) -1 # else # if HAVE_ICONV domain->conv != (iconv_t) -1 # endif # endif ) { /* We are supposed to do a conversion. First allocate an appropriate table with the same structure as the table of translations in the file, where we can put the pointers to the converted strings in. There is a slight complication with plural entries. They are represented by consecutive NUL terminated strings. We handle this case by converting RESULTLEN bytes, including NULs. */ if (domain->conv_tab == NULL && ((domain->conv_tab = (char **) calloc (nstrings + domain->n_sysdep_strings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ domain->conv_tab = (char **) -1; if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. */ goto converted; if (domain->conv_tab[act] == NULL) { /* We haven't used this string so far, so it is not translated yet. Do this now. */ /* We use a bit more efficient memory handling. We allocate always larger blocks which get used over time. This is faster than many small allocations. */ __libc_lock_define_initialized (static, lock) # define INITIAL_BLOCK_SIZE 4080 static unsigned char *freemem; static size_t freemem_size; const unsigned char *inbuf; unsigned char *outbuf; int malloc_count; # ifndef _LIBC transmem_block_t *transmem_list = NULL; # endif __libc_lock_lock (lock); inbuf = (const unsigned char *) result; outbuf = freemem + sizeof (size_t); malloc_count = 0; while (1) { transmem_block_t *newmem; # ifdef _LIBC size_t non_reversible; int res; if (freemem_size < sizeof (size_t)) goto resize_freemem; res = __gconv (domain->conv, &inbuf, inbuf + resultlen, &outbuf, outbuf + freemem_size - sizeof (size_t), &non_reversible); if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) break; if (res != __GCONV_FULL_OUTPUT) { __libc_lock_unlock (lock); goto converted; } inbuf = result; # else # if HAVE_ICONV const char *inptr = (const char *) inbuf; size_t inleft = resultlen; char *outptr = (char *) outbuf; size_t outleft; if (freemem_size < sizeof (size_t)) goto resize_freemem; outleft = freemem_size - sizeof (size_t); if (iconv (domain->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); goto converted; } # endif # endif resize_freemem: /* We must allocate a new buffer or resize the old one. */ if (malloc_count > 0) { ++malloc_count; freemem_size = malloc_count * INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) realloc (transmem_list, freemem_size); # ifdef _LIBC if (newmem != NULL) transmem_list = transmem_list->next; else { struct transmem_list *old = transmem_list; transmem_list = transmem_list->next; free (old); } # endif } else { malloc_count = 1; freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); } if (__builtin_expect (newmem == NULL, 0)) { freemem = NULL; freemem_size = 0; __libc_lock_unlock (lock); goto converted; } # ifdef _LIBC /* Add the block to the list of blocks we have to free at some point. */ newmem->next = transmem_list; transmem_list = newmem; freemem = newmem->data; freemem_size -= offsetof (struct transmem_list, data); # else transmem_list = newmem; freemem = newmem; # endif outbuf = freemem + sizeof (size_t); } /* We have now in our buffer a converted string. Put this into the table of conversions. */ *(size_t *) freemem = outbuf - freemem - sizeof (size_t); domain->conv_tab[act] = (char *) freemem; /* Shrink freemem, but keep it aligned. */ freemem_size -= outbuf - freemem; freemem = outbuf; freemem += freemem_size & (alignof (size_t) - 1); freemem_size = freemem_size & ~ (alignof (size_t) - 1); __libc_lock_unlock (lock); } /* Now domain->conv_tab[act] contains the translation of all the plural variants. */ result = domain->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) domain->conv_tab[act]; } converted: /* The result string is converted. */ #endif /* _LIBC || HAVE_ICONV */ *lengthp = resultlen; return result; } /* Look up a plural variant. */ static char * internal_function plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) { struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; unsigned long int index; const char *p; index = plural_eval (domaindata->plural, n); if (index >= domaindata->nplurals) /* This should never happen. It means the plural expression and the given maximum value do not match. */ index = 0; /* Skip INDEX strings at TRANSLATION. */ p = translation; while (index-- > 0) { #ifdef _LIBC p = __rawmemchr (p, '\0'); #else p = strchr (p, '\0'); #endif /* And skip over the NUL byte. */ p++; if (p >= translation + translation_len) /* This should never happen. It means the plural expression evaluated to a value larger than the number of variants available for MSGID1. */ return (char *) translation; } return (char *) p; } #ifndef _LIBC /* Return string representation of locale CATEGORY. */ static const char * internal_function category_to_name (int category) { const char *retval; switch (category) { #ifdef LC_COLLATE case LC_COLLATE: retval = "LC_COLLATE"; break; #endif #ifdef LC_CTYPE case LC_CTYPE: retval = "LC_CTYPE"; break; #endif #ifdef LC_MONETARY case LC_MONETARY: retval = "LC_MONETARY"; break; #endif #ifdef LC_NUMERIC case LC_NUMERIC: retval = "LC_NUMERIC"; break; #endif #ifdef LC_TIME case LC_TIME: retval = "LC_TIME"; break; #endif #ifdef LC_MESSAGES case LC_MESSAGES: retval = "LC_MESSAGES"; break; #endif #ifdef LC_RESPONSE case LC_RESPONSE: retval = "LC_RESPONSE"; break; #endif #ifdef LC_ALL case LC_ALL: /* This might not make sense but is perhaps better than any other value. */ retval = "LC_ALL"; break; #endif default: /* If you have a better idea for a default value let me know. */ retval = "LC_XXX"; } return retval; } #endif /* Guess value of current locale from value of the environment variables. */ static const char * internal_function guess_category_value (int category, const char *categoryname) { const char *language; const char *retval; /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently selected locale is the C locale. This is a GNU extension. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] == '\0') language = NULL; /* We have to proceed with the POSIX methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #ifdef _LIBC retval = __current_locale_name (category); #else retval = _nl_locale_name (category, categoryname); #endif /* Ignore LANGUAGE if the locale is set to "C" because 1. "C" locale usually uses the ASCII encoding, and most international messages use non-ASCII characters. These characters get displayed as question marks (if using glibc's iconv()) or as invalid 8-bit characters (because other iconv()s refuse to convert most non-ASCII characters to ASCII). In any case, the output is ugly. 2. The precise output of some programs in the "C" locale is specified by POSIX and should not depend on environment variables like "LANGUAGE". We allow such programs to use gettext(). */ return language != NULL && strcmp (retval, "C") != 0 ? language : retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (char *dest, const char *src) { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (void *dest, const void *src, size_t n) { return (void *) ((char *) memcpy (dest, src, n) + n); } #endif #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ libc_freeres_fn (free_mem) { void *old; while (_nl_domain_bindings != NULL) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; if (oldp->dirname != INTUSE(_nl_default_dirname)) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); free (oldp); } if (_nl_current_default_domain != _nl_default_default_domain) /* Yes, again a pointer comparison. */ free ((char *) _nl_current_default_domain); /* Remove the search tree with the known translations. */ __tdestroy (root, free); root = NULL; while (transmem_list != NULL) { old = transmem_list; transmem_list = transmem_list->next; free (old); } } #endif pbbuttonsd-0.7.9/intl/dcngettext.c0000644000175000017500000000347010463223132014117 00000000000000/* Implementation of the dcngettext(3) function. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCNGETTEXT __dcngettext # define DCIGETTEXT __dcigettext #else # define DCNGETTEXT libintl_dcngettext # define DCIGETTEXT libintl_dcigettext #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcngettext, dcngettext); #endif pbbuttonsd-0.7.9/intl/dngettext.c0000644000175000017500000000354210463223132013754 00000000000000/* Implementation of the dngettext(3) function. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DNGETTEXT __dngettext # define DCNGETTEXT __dcngettext #else # define DNGETTEXT libintl_dngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale and skip message according to the plural form. */ char * DNGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dngettext, dngettext); #endif pbbuttonsd-0.7.9/intl/ngettext.c0000644000175000017500000000367010463223134013614 00000000000000/* Implementation of ngettext(3) function. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define NGETTEXT __ngettext # define DCNGETTEXT __dcngettext #else # define NGETTEXT libintl_ngettext # define DCNGETTEXT libintl_dcngettext #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n) { return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__ngettext, ngettext); #endif pbbuttonsd-0.7.9/intl/plural.y0000644000175000017500000001627110463223135013301 00000000000000%{ /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg %} %pure_parser %expect 7 %union { unsigned long int num; enum operator op; struct expression *exp; } %{ /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } %} /* This declares that all operators have the same associativity and the precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. There is no unary minus and no bitwise operators. Operators with the same syntactic behaviour have been merged into a single token, to save space in the array generated by bison. */ %right '?' /* ? */ %left '|' /* || */ %left '&' /* && */ %left EQUOP2 /* == != */ %left CMPOP2 /* < > <= >= */ %left ADDOP2 /* + - */ %left MULOP2 /* * / % */ %right '!' /* ! */ %token EQUOP2 CMPOP2 ADDOP2 MULOP2 %token NUMBER %type exp %% start: exp { if ($1 == NULL) YYABORT; ((struct parse_args *) arg)->res = $1; } ; exp: exp '?' exp ':' exp { $$ = new_exp_3 (qmop, $1, $3, $5); } | exp '|' exp { $$ = new_exp_2 (lor, $1, $3); } | exp '&' exp { $$ = new_exp_2 (land, $1, $3); } | exp EQUOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp CMPOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp ADDOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp MULOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | '!' exp { $$ = new_exp_1 (lnot, $2); } | 'n' { $$ = new_exp_0 (var); } | NUMBER { if (($$ = new_exp_0 (num)) != NULL) $$->val.num = $1; } | '(' exp ')' { $$ = $2; } ; %% void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } pbbuttonsd-0.7.9/intl/plural-exp.c0000644000175000017500000000765110463223135014047 00000000000000/* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "plural-exp.h" #if (defined __GNUC__ && !defined __APPLE_CC__) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .nargs = 0, .operation = var, }; static const struct expression plone = { .nargs = 0, .operation = num, .val = { .num = 1 } }; struct expression GERMANIC_PLURAL = { .nargs = 2, .operation = not_equal, .val = { .args = { [0] = (struct expression *) &plvar, [1] = (struct expression *) &plone } } }; # define INIT_GERMANIC_PLURAL() #else /* For compilers without support for ISO C 99 struct/union initializers: Initialization at run-time. */ static struct expression plvar; static struct expression plone; struct expression GERMANIC_PLURAL; static void init_germanic_plural () { if (plone.val.num == 0) { plvar.nargs = 0; plvar.operation = var; plone.nargs = 0; plone.operation = num; plone.val.num = 1; GERMANIC_PLURAL.nargs = 2; GERMANIC_PLURAL.operation = not_equal; GERMANIC_PLURAL.val.args[0] = &plvar; GERMANIC_PLURAL.val.args[1] = &plone; } } # define INIT_GERMANIC_PLURAL() init_germanic_plural () #endif void internal_function EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp, unsigned long int *npluralsp) { if (nullentry != NULL) { const char *plural; const char *nplurals; plural = strstr (nullentry, "plural="); nplurals = strstr (nullentry, "nplurals="); if (plural == NULL || nplurals == NULL) goto no_plural; else { char *endp; unsigned long int n; struct parse_args args; /* First get the number. */ nplurals += 9; while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) ++nplurals; if (!(*nplurals >= '0' && *nplurals <= '9')) goto no_plural; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) n = n * 10 + (*endp - '0'); #endif if (nplurals == endp) goto no_plural; *npluralsp = n; /* Due to the restrictions bison imposes onto the interface of the scanner function we have to put the input string and the result passed up from the parser into the same structure which address is passed down to the parser. */ plural += 7; args.cp = plural; if (PLURAL_PARSE (&args) != 0) goto no_plural; *pluralp = args.res; } } else { /* By default we are using the Germanic form: singular form only for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: INIT_GERMANIC_PLURAL (); *pluralp = &GERMANIC_PLURAL; *npluralsp = 2; } } pbbuttonsd-0.7.9/intl/localcharset.c0000644000175000017500000002435710463223134014423 00000000000000/* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "localcharset.h" #if HAVE_STDDEF_H # include #endif #include #if HAVE_STRING_H # include #else # include #endif #if HAVE_STDLIB_H # include #endif #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #if defined __EMX__ /* Assume EMX program runs on OS/2, even if compiled under DOS. */ # define OS2 #endif #if !defined WIN32 # if HAVE_LANGINFO_CODESET # include # else # if HAVE_SETLOCALE # include # endif # endif #elif defined WIN32 # define WIN32_LEAN_AND_MEAN # include #endif #if defined OS2 # define INCL_DOS # include #endif #if ENABLE_RELOCATABLE # include "relocatable.h" #else # define relocate(pathname) (pathname) #endif #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) #endif #if HAVE_DECL_GETC_UNLOCKED # undef getc # define getc getc_unlocked #endif /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize 'charset_aliases' simultaneously, both will produce the same value, and everything will be ok if the two assignments to 'charset_aliases' are atomic. But I don't know what will happen if the two assignments mix. */ #if __STDC__ != 1 # define volatile /* empty */ #endif /* Pointer to the contents of the charset.alias file, if it has already been read, else NULL. Its format is: ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ static const char * volatile charset_aliases; /* Return a pointer to the contents of the charset.alias file. */ static const char * get_charset_aliases () { const char *cp; cp = charset_aliases; if (cp == NULL) { #if !(defined VMS || defined WIN32) FILE *fp; const char *dir = relocate (LIBDIR); const char *base = "charset.alias"; char *file_name; /* Concatenate dir and base into freshly allocated file_name. */ { size_t dir_len = strlen (dir); size_t base_len = strlen (base); int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); file_name = (char *) malloc (dir_len + add_slash + base_len + 1); if (file_name != NULL) { memcpy (file_name, dir, dir_len); if (add_slash) file_name[dir_len] = DIRECTORY_SEPARATOR; memcpy (file_name + dir_len + add_slash, base, base_len + 1); } } if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) /* Out of memory or file not found, treat it as empty. */ cp = ""; else { /* Parse the file's contents. */ int c; char buf1[50+1]; char buf2[50+1]; char *res_ptr = NULL; size_t res_size = 0; size_t l1, l2; for (;;) { c = getc (fp); if (c == EOF) break; if (c == '\n' || c == ' ' || c == '\t') continue; if (c == '#') { /* Skip comment, to end of line. */ do c = getc (fp); while (!(c == EOF || c == '\n')); if (c == EOF) break; continue; } ungetc (c, fp); if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) break; l1 = strlen (buf1); l2 = strlen (buf2); if (res_size == 0) { res_size = l1 + 1 + l2 + 1; res_ptr = (char *) malloc (res_size + 1); } else { res_size += l1 + 1 + l2 + 1; res_ptr = (char *) realloc (res_ptr, res_size + 1); } if (res_ptr == NULL) { /* Out of memory. */ res_size = 0; break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); strcpy (res_ptr + res_size - (l2 + 1), buf2); } fclose (fp); if (res_size == 0) cp = ""; else { *(res_ptr + res_size) = '\0'; cp = res_ptr; } } if (file_name != NULL) free (file_name); #else # if defined VMS /* To avoid the troubles of an extra file charset.alias_vms in the sources of many GNU packages, simply inline the aliases here. */ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation "Compaq C Run-Time Library Reference Manual for OpenVMS systems" section 10.7 "Handling Different Character Sets". */ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" "ISO8859-2" "\0" "ISO-8859-2" "\0" "ISO8859-5" "\0" "ISO-8859-5" "\0" "ISO8859-7" "\0" "ISO-8859-7" "\0" "ISO8859-8" "\0" "ISO-8859-8" "\0" "ISO8859-9" "\0" "ISO-8859-9" "\0" /* Japanese */ "eucJP" "\0" "EUC-JP" "\0" "SJIS" "\0" "SHIFT_JIS" "\0" "DECKANJI" "\0" "DEC-KANJI" "\0" "SDECKANJI" "\0" "EUC-JP" "\0" /* Chinese */ "eucTW" "\0" "EUC-TW" "\0" "DECHANYU" "\0" "DEC-HANYU" "\0" "DECHANZI" "\0" "GB2312" "\0" /* Korean */ "DECKOREAN" "\0" "EUC-KR" "\0"; # endif # if defined WIN32 /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" "CP20866" "\0" "KOI8-R" "\0" "CP21866" "\0" "KOI8-RU" "\0" "CP28591" "\0" "ISO-8859-1" "\0" "CP28592" "\0" "ISO-8859-2" "\0" "CP28593" "\0" "ISO-8859-3" "\0" "CP28594" "\0" "ISO-8859-4" "\0" "CP28595" "\0" "ISO-8859-5" "\0" "CP28596" "\0" "ISO-8859-6" "\0" "CP28597" "\0" "ISO-8859-7" "\0" "CP28598" "\0" "ISO-8859-8" "\0" "CP28599" "\0" "ISO-8859-9" "\0" "CP28605" "\0" "ISO-8859-15" "\0"; # endif #endif charset_aliases = cp; } return cp; } /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ #ifdef STATIC STATIC #endif const char * locale_charset () { const char *codeset; const char *aliases; #if !(defined WIN32 || defined OS2) # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # else /* On old systems which lack it, use setlocale or getenv. */ const char *locale = NULL; /* But most old systems don't have a complete set of locales. Some (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ # if HAVE_SETLOCALE && 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } } /* On some old systems, one used to set locale = "iso8859_1". On others, you set it to "language_COUNTRY.charset". In any case, we resolve it through the charset.alias file. */ codeset = locale; # endif #elif defined WIN32 static char buf[2 + 10 + 1]; /* Woe32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; #elif defined OS2 const char *locale; static char buf[2 + 10 + 1]; ULONG cp[3]; ULONG cplen; /* Allow user to override the codeset, as set in the operating system, with standard language environment variables. */ locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } if (locale != NULL && locale[0] != '\0') { /* If the locale name contains an encoding after the dot, return it. */ const char *dot = strchr (locale, '.'); if (dot != NULL) { const char *modifier; dot++; /* Look for the possible @... trailer and remove it, if any. */ modifier = strchr (dot, '@'); if (modifier == NULL) return dot; if (modifier - dot < sizeof (buf)) { memcpy (buf, dot, modifier - dot); buf [modifier - dot] = '\0'; return buf; } } /* Resolve through the charset.alias file. */ codeset = locale; } else { /* OS/2 has a function returning the locale's codepage as a number. */ if (DosQueryCp (sizeof (cp), cp, &cplen)) codeset = ""; else { sprintf (buf, "CP%u", cp[0]); codeset = buf; } } #endif if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; /* Resolve alias. */ for (aliases = get_charset_aliases (); *aliases != '\0'; aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) if (strcmp (codeset, aliases) == 0 || (aliases[0] == '*' && aliases[1] == '\0')) { codeset = aliases + strlen (aliases) + 1; break; } /* Don't return an empty string. GNU libc and GNU libiconv interpret the empty string as denoting "the locale's character encoding", thus GNU libiconv would call this function a second time. */ if (codeset[0] == '\0') codeset = "ASCII"; return codeset; } pbbuttonsd-0.7.9/intl/relocatable.c0000644000175000017500000003136010463223136014226 00000000000000/* Provide relocatable packages. Copyright (C) 2003 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Tell glibc's to provide a prototype for getline(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include "config.h" #endif /* Specification. */ #include "relocatable.h" #if ENABLE_RELOCATABLE #include #include #include #include #ifdef NO_XMALLOC # define xmalloc malloc #else # include "xalloc.h" #endif #if defined _WIN32 || defined __WIN32__ # define WIN32_LEAN_AND_MEAN # include #endif #if DEPENDS_ON_LIBCHARSET # include #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV # include #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS # include #endif /* Faked cheap 'bool'. */ #undef bool #undef false #undef true #define bool int #define false 0 #define true 1 /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) # define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) # define FILESYSTEM_PREFIX_LEN(P) 0 #endif /* Original installation prefix. */ static char *orig_prefix; static size_t orig_prefix_len; /* Current installation prefix. */ static char *curr_prefix; static size_t curr_prefix_len; /* These prefixes do not end in a slash. Anything that will be concatenated to them must start with a slash. */ /* Sets the original and the current installation prefix of this module. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ static void set_this_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { if (orig_prefix_arg != NULL && curr_prefix_arg != NULL /* Optimization: if orig_prefix and curr_prefix are equal, the relocation is a nop. */ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0) { /* Duplicate the argument strings. */ char *memory; orig_prefix_len = strlen (orig_prefix_arg); curr_prefix_len = strlen (curr_prefix_arg); memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1); #ifdef NO_XMALLOC if (memory != NULL) #endif { memcpy (memory, orig_prefix_arg, orig_prefix_len + 1); orig_prefix = memory; memory += orig_prefix_len + 1; memcpy (memory, curr_prefix_arg, curr_prefix_len + 1); curr_prefix = memory; return; } } orig_prefix = NULL; curr_prefix = NULL; /* Don't worry about wasted memory here - this function is usually only called once. */ } /* Sets the original and the current installation prefix of the package. Relocation simply replaces a pathname starting with the original prefix by the corresponding pathname with the current prefix instead. Both prefixes should be directory names without trailing slash (i.e. use "" instead of "/"). */ void set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg) { set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg); /* Now notify all dependent libraries. */ #if DEPENDS_ON_LIBCHARSET libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109 libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif #if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg); #endif } #if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR) /* Convenience function: Computes the current installation prefix, based on the original installation prefix, the original installation directory of a particular file, and the current pathname of this file. Returns NULL upon failure. */ #ifdef IN_LIBRARY #define compute_curr_prefix local_compute_curr_prefix static #endif const char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, const char *curr_pathname) { const char *curr_installdir; const char *rel_installdir; if (curr_pathname == NULL) return NULL; /* Determine the relative installation directory, relative to the prefix. This is simply the difference between orig_installprefix and orig_installdir. */ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix)) != 0) /* Shouldn't happen - nothing should be installed outside $(prefix). */ return NULL; rel_installdir = orig_installdir + strlen (orig_installprefix); /* Determine the current installation directory. */ { const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname); const char *p = curr_pathname + strlen (curr_pathname); char *q; while (p > p_base) { p--; if (ISSLASH (*p)) break; } q = (char *) xmalloc (p - curr_pathname + 1); #ifdef NO_XMALLOC if (q == NULL) return NULL; #endif memcpy (q, curr_pathname, p - curr_pathname); q[p - curr_pathname] = '\0'; curr_installdir = q; } /* Compute the current installation prefix by removing the trailing rel_installdir from it. */ { const char *rp = rel_installdir + strlen (rel_installdir); const char *cp = curr_installdir + strlen (curr_installdir); const char *cp_base = curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir); while (rp > rel_installdir && cp > cp_base) { bool same = false; const char *rpi = rp; const char *cpi = cp; while (rpi > rel_installdir && cpi > cp_base) { rpi--; cpi--; if (ISSLASH (*rpi) || ISSLASH (*cpi)) { if (ISSLASH (*rpi) && ISSLASH (*cpi)) same = true; break; } #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS - case insignificant filesystem */ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) break; #else if (*rpi != *cpi) break; #endif } if (!same) break; /* The last pathname component was the same. opi and cpi now point to the slash before it. */ rp = rpi; cp = cpi; } if (rp > rel_installdir) /* Unexpected: The curr_installdir does not end with rel_installdir. */ return NULL; { size_t curr_prefix_len = cp - curr_installdir; char *curr_prefix; curr_prefix = (char *) xmalloc (curr_prefix_len + 1); #ifdef NO_XMALLOC if (curr_prefix == NULL) return NULL; #endif memcpy (curr_prefix, curr_installdir, curr_prefix_len); curr_prefix[curr_prefix_len] = '\0'; return curr_prefix; } } } #endif /* !IN_LIBRARY || PIC */ #if defined PIC && defined INSTALLDIR /* Full pathname of shared library, or NULL. */ static char *shared_library_fullname; #if defined _WIN32 || defined __WIN32__ /* Determine the full pathname of the shared library when it is loaded. */ BOOL WINAPI DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved) { (void) reserved; if (event == DLL_PROCESS_ATTACH) { /* The DLL is being loaded into an application's address range. */ static char location[MAX_PATH]; if (!GetModuleFileName (module_handle, location, sizeof (location))) /* Shouldn't happen. */ return FALSE; if (!IS_PATH_WITH_DIR (location)) /* Shouldn't happen. */ return FALSE; shared_library_fullname = strdup (location); } return TRUE; } #else /* Unix */ static void find_shared_library_fullname () { #if defined __linux__ && __GLIBC__ >= 2 /* Linux has /proc/self/maps. glibc 2 has the getline() function. */ FILE *fp; /* Open the current process' maps file. It describes one VMA per line. */ fp = fopen ("/proc/self/maps", "r"); if (fp) { unsigned long address = (unsigned long) &find_shared_library_fullname; for (;;) { unsigned long start, end; int c; if (fscanf (fp, "%lx-%lx", &start, &end) != 2) break; if (address >= start && address <= end - 1) { /* Found it. Now see if this line contains a filename. */ while (c = getc (fp), c != EOF && c != '\n' && c != '/') continue; if (c == '/') { size_t size; int len; ungetc (c, fp); shared_library_fullname = NULL; size = 0; len = getline (&shared_library_fullname, &size, fp); if (len >= 0) { /* Success: filled shared_library_fullname. */ if (len > 0 && shared_library_fullname[len - 1] == '\n') shared_library_fullname[len - 1] = '\0'; } } break; } while (c = getc (fp), c != EOF && c != '\n') continue; } fclose (fp); } #endif } #endif /* WIN32 / Unix */ /* Return the full pathname of the current shared library. Return NULL if unknown. Guaranteed to work only on Linux and Woe32. */ static char * get_shared_library_fullname () { #if !(defined _WIN32 || defined __WIN32__) static bool tried_find_shared_library_fullname; if (!tried_find_shared_library_fullname) { find_shared_library_fullname (); tried_find_shared_library_fullname = true; } #endif return shared_library_fullname; } #endif /* PIC */ /* Returns the pathname, relocated according to the current installation directory. */ const char * relocate (const char *pathname) { #if defined PIC && defined INSTALLDIR static int initialized; /* Initialization code for a shared library. */ if (!initialized) { /* At this point, orig_prefix and curr_prefix likely have already been set through the main program's set_program_name_and_installdir function. This is sufficient in the case that the library has initially been installed in the same orig_prefix. But we can do better, to also cover the cases that 1. it has been installed in a different prefix before being moved to orig_prefix and (later) to curr_prefix, 2. unlike the program, it has not moved away from orig_prefix. */ const char *orig_installprefix = INSTALLPREFIX; const char *orig_installdir = INSTALLDIR; const char *curr_prefix_better; curr_prefix_better = compute_curr_prefix (orig_installprefix, orig_installdir, get_shared_library_fullname ()); if (curr_prefix_better == NULL) curr_prefix_better = curr_prefix; set_relocation_prefix (orig_installprefix, curr_prefix_better); initialized = 1; } #endif /* Note: It is not necessary to perform case insensitive comparison here, even for DOS-like filesystems, because the pathname argument was typically created from the same Makefile variable as orig_prefix came from. */ if (orig_prefix != NULL && curr_prefix != NULL && strncmp (pathname, orig_prefix, orig_prefix_len) == 0) { if (pathname[orig_prefix_len] == '\0') /* pathname equals orig_prefix. */ return curr_prefix; if (ISSLASH (pathname[orig_prefix_len])) { /* pathname starts with orig_prefix. */ const char *pathname_tail = &pathname[orig_prefix_len]; char *result = (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1); #ifdef NO_XMALLOC if (result != NULL) #endif { memcpy (result, curr_prefix, curr_prefix_len); strcpy (result + curr_prefix_len, pathname_tail); return result; } } } /* Nothing to relocate. */ return pathname; } #endif pbbuttonsd-0.7.9/intl/localename.c0000644000175000017500000007441610463223134014060 00000000000000/* Determine the current selected locale. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Ulrich Drepper , 1995. */ /* Win32 code written by Tor Lillqvist . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #ifdef WIN32 # define WIN32_LEAN_AND_MEAN # include /* List of language codes, sorted by value: 0x01 LANG_ARABIC 0x02 LANG_BULGARIAN 0x03 LANG_CATALAN 0x04 LANG_CHINESE 0x05 LANG_CZECH 0x06 LANG_DANISH 0x07 LANG_GERMAN 0x08 LANG_GREEK 0x09 LANG_ENGLISH 0x0a LANG_SPANISH 0x0b LANG_FINNISH 0x0c LANG_FRENCH 0x0d LANG_HEBREW 0x0e LANG_HUNGARIAN 0x0f LANG_ICELANDIC 0x10 LANG_ITALIAN 0x11 LANG_JAPANESE 0x12 LANG_KOREAN 0x13 LANG_DUTCH 0x14 LANG_NORWEGIAN 0x15 LANG_POLISH 0x16 LANG_PORTUGUESE 0x17 LANG_RHAETO_ROMANCE 0x18 LANG_ROMANIAN 0x19 LANG_RUSSIAN 0x1a LANG_CROATIAN == LANG_SERBIAN 0x1b LANG_SLOVAK 0x1c LANG_ALBANIAN 0x1d LANG_SWEDISH 0x1e LANG_THAI 0x1f LANG_TURKISH 0x20 LANG_URDU 0x21 LANG_INDONESIAN 0x22 LANG_UKRAINIAN 0x23 LANG_BELARUSIAN 0x24 LANG_SLOVENIAN 0x25 LANG_ESTONIAN 0x26 LANG_LATVIAN 0x27 LANG_LITHUANIAN 0x28 LANG_TAJIK 0x29 LANG_FARSI 0x2a LANG_VIETNAMESE 0x2b LANG_ARMENIAN 0x2c LANG_AZERI 0x2d LANG_BASQUE 0x2e LANG_SORBIAN 0x2f LANG_MACEDONIAN 0x30 LANG_SUTU 0x31 LANG_TSONGA 0x32 LANG_TSWANA 0x33 LANG_VENDA 0x34 LANG_XHOSA 0x35 LANG_ZULU 0x36 LANG_AFRIKAANS 0x37 LANG_GEORGIAN 0x38 LANG_FAEROESE 0x39 LANG_HINDI 0x3a LANG_MALTESE 0x3b LANG_SAAMI 0x3c LANG_GAELIC 0x3d LANG_YIDDISH 0x3e LANG_MALAY 0x3f LANG_KAZAK 0x40 LANG_KYRGYZ 0x41 LANG_SWAHILI 0x42 LANG_TURKMEN 0x43 LANG_UZBEK 0x44 LANG_TATAR 0x45 LANG_BENGALI 0x46 LANG_PUNJABI 0x47 LANG_GUJARATI 0x48 LANG_ORIYA 0x49 LANG_TAMIL 0x4a LANG_TELUGU 0x4b LANG_KANNADA 0x4c LANG_MALAYALAM 0x4d LANG_ASSAMESE 0x4e LANG_MARATHI 0x4f LANG_SANSKRIT 0x50 LANG_MONGOLIAN 0x51 LANG_TIBETAN 0x52 LANG_WELSH 0x53 LANG_CAMBODIAN 0x54 LANG_LAO 0x55 LANG_BURMESE 0x56 LANG_GALICIAN 0x57 LANG_KONKANI 0x58 LANG_MANIPURI 0x59 LANG_SINDHI 0x5a LANG_SYRIAC 0x5b LANG_SINHALESE 0x5c LANG_CHEROKEE 0x5d LANG_INUKTITUT 0x5e LANG_AMHARIC 0x5f LANG_TAMAZIGHT 0x60 LANG_KASHMIRI 0x61 LANG_NEPALI 0x62 LANG_FRISIAN 0x63 LANG_PASHTO 0x64 LANG_TAGALOG 0x65 LANG_DIVEHI 0x66 LANG_EDO 0x67 LANG_FULFULDE 0x68 LANG_HAUSA 0x69 LANG_IBIBIO 0x6a LANG_YORUBA 0x70 LANG_IGBO 0x71 LANG_KANURI 0x72 LANG_OROMO 0x73 LANG_TIGRINYA 0x74 LANG_GUARANI 0x75 LANG_HAWAIIAN 0x76 LANG_LATIN 0x77 LANG_SOMALI 0x78 LANG_YI 0x79 LANG_PAPIAMENTU */ /* Mingw headers don't have latest language and sublanguage codes. */ # ifndef LANG_AFRIKAANS # define LANG_AFRIKAANS 0x36 # endif # ifndef LANG_ALBANIAN # define LANG_ALBANIAN 0x1c # endif # ifndef LANG_AMHARIC # define LANG_AMHARIC 0x5e # endif # ifndef LANG_ARABIC # define LANG_ARABIC 0x01 # endif # ifndef LANG_ARMENIAN # define LANG_ARMENIAN 0x2b # endif # ifndef LANG_ASSAMESE # define LANG_ASSAMESE 0x4d # endif # ifndef LANG_AZERI # define LANG_AZERI 0x2c # endif # ifndef LANG_BASQUE # define LANG_BASQUE 0x2d # endif # ifndef LANG_BELARUSIAN # define LANG_BELARUSIAN 0x23 # endif # ifndef LANG_BENGALI # define LANG_BENGALI 0x45 # endif # ifndef LANG_BURMESE # define LANG_BURMESE 0x55 # endif # ifndef LANG_CAMBODIAN # define LANG_CAMBODIAN 0x53 # endif # ifndef LANG_CATALAN # define LANG_CATALAN 0x03 # endif # ifndef LANG_CHEROKEE # define LANG_CHEROKEE 0x5c # endif # ifndef LANG_DIVEHI # define LANG_DIVEHI 0x65 # endif # ifndef LANG_EDO # define LANG_EDO 0x66 # endif # ifndef LANG_ESTONIAN # define LANG_ESTONIAN 0x25 # endif # ifndef LANG_FAEROESE # define LANG_FAEROESE 0x38 # endif # ifndef LANG_FARSI # define LANG_FARSI 0x29 # endif # ifndef LANG_FRISIAN # define LANG_FRISIAN 0x62 # endif # ifndef LANG_FULFULDE # define LANG_FULFULDE 0x67 # endif # ifndef LANG_GAELIC # define LANG_GAELIC 0x3c # endif # ifndef LANG_GALICIAN # define LANG_GALICIAN 0x56 # endif # ifndef LANG_GEORGIAN # define LANG_GEORGIAN 0x37 # endif # ifndef LANG_GUARANI # define LANG_GUARANI 0x74 # endif # ifndef LANG_GUJARATI # define LANG_GUJARATI 0x47 # endif # ifndef LANG_HAUSA # define LANG_HAUSA 0x68 # endif # ifndef LANG_HAWAIIAN # define LANG_HAWAIIAN 0x75 # endif # ifndef LANG_HEBREW # define LANG_HEBREW 0x0d # endif # ifndef LANG_HINDI # define LANG_HINDI 0x39 # endif # ifndef LANG_IBIBIO # define LANG_IBIBIO 0x69 # endif # ifndef LANG_IGBO # define LANG_IGBO 0x70 # endif # ifndef LANG_INDONESIAN # define LANG_INDONESIAN 0x21 # endif # ifndef LANG_INUKTITUT # define LANG_INUKTITUT 0x5d # endif # ifndef LANG_KANNADA # define LANG_KANNADA 0x4b # endif # ifndef LANG_KANURI # define LANG_KANURI 0x71 # endif # ifndef LANG_KASHMIRI # define LANG_KASHMIRI 0x60 # endif # ifndef LANG_KAZAK # define LANG_KAZAK 0x3f # endif # ifndef LANG_KONKANI # define LANG_KONKANI 0x57 # endif # ifndef LANG_KYRGYZ # define LANG_KYRGYZ 0x40 # endif # ifndef LANG_LAO # define LANG_LAO 0x54 # endif # ifndef LANG_LATIN # define LANG_LATIN 0x76 # endif # ifndef LANG_LATVIAN # define LANG_LATVIAN 0x26 # endif # ifndef LANG_LITHUANIAN # define LANG_LITHUANIAN 0x27 # endif # ifndef LANG_MACEDONIAN # define LANG_MACEDONIAN 0x2f # endif # ifndef LANG_MALAY # define LANG_MALAY 0x3e # endif # ifndef LANG_MALAYALAM # define LANG_MALAYALAM 0x4c # endif # ifndef LANG_MALTESE # define LANG_MALTESE 0x3a # endif # ifndef LANG_MANIPURI # define LANG_MANIPURI 0x58 # endif # ifndef LANG_MARATHI # define LANG_MARATHI 0x4e # endif # ifndef LANG_MONGOLIAN # define LANG_MONGOLIAN 0x50 # endif # ifndef LANG_NEPALI # define LANG_NEPALI 0x61 # endif # ifndef LANG_ORIYA # define LANG_ORIYA 0x48 # endif # ifndef LANG_OROMO # define LANG_OROMO 0x72 # endif # ifndef LANG_PAPIAMENTU # define LANG_PAPIAMENTU 0x79 # endif # ifndef LANG_PASHTO # define LANG_PASHTO 0x63 # endif # ifndef LANG_PUNJABI # define LANG_PUNJABI 0x46 # endif # ifndef LANG_RHAETO_ROMANCE # define LANG_RHAETO_ROMANCE 0x17 # endif # ifndef LANG_SAAMI # define LANG_SAAMI 0x3b # endif # ifndef LANG_SANSKRIT # define LANG_SANSKRIT 0x4f # endif # ifndef LANG_SERBIAN # define LANG_SERBIAN 0x1a # endif # ifndef LANG_SINDHI # define LANG_SINDHI 0x59 # endif # ifndef LANG_SINHALESE # define LANG_SINHALESE 0x5b # endif # ifndef LANG_SLOVAK # define LANG_SLOVAK 0x1b # endif # ifndef LANG_SOMALI # define LANG_SOMALI 0x77 # endif # ifndef LANG_SORBIAN # define LANG_SORBIAN 0x2e # endif # ifndef LANG_SUTU # define LANG_SUTU 0x30 # endif # ifndef LANG_SWAHILI # define LANG_SWAHILI 0x41 # endif # ifndef LANG_SYRIAC # define LANG_SYRIAC 0x5a # endif # ifndef LANG_TAGALOG # define LANG_TAGALOG 0x64 # endif # ifndef LANG_TAJIK # define LANG_TAJIK 0x28 # endif # ifndef LANG_TAMAZIGHT # define LANG_TAMAZIGHT 0x5f # endif # ifndef LANG_TAMIL # define LANG_TAMIL 0x49 # endif # ifndef LANG_TATAR # define LANG_TATAR 0x44 # endif # ifndef LANG_TELUGU # define LANG_TELUGU 0x4a # endif # ifndef LANG_THAI # define LANG_THAI 0x1e # endif # ifndef LANG_TIBETAN # define LANG_TIBETAN 0x51 # endif # ifndef LANG_TIGRINYA # define LANG_TIGRINYA 0x73 # endif # ifndef LANG_TSONGA # define LANG_TSONGA 0x31 # endif # ifndef LANG_TSWANA # define LANG_TSWANA 0x32 # endif # ifndef LANG_TURKMEN # define LANG_TURKMEN 0x42 # endif # ifndef LANG_UKRAINIAN # define LANG_UKRAINIAN 0x22 # endif # ifndef LANG_URDU # define LANG_URDU 0x20 # endif # ifndef LANG_UZBEK # define LANG_UZBEK 0x43 # endif # ifndef LANG_VENDA # define LANG_VENDA 0x33 # endif # ifndef LANG_VIETNAMESE # define LANG_VIETNAMESE 0x2a # endif # ifndef LANG_WELSH # define LANG_WELSH 0x52 # endif # ifndef LANG_XHOSA # define LANG_XHOSA 0x34 # endif # ifndef LANG_YI # define LANG_YI 0x78 # endif # ifndef LANG_YIDDISH # define LANG_YIDDISH 0x3d # endif # ifndef LANG_YORUBA # define LANG_YORUBA 0x6a # endif # ifndef LANG_ZULU # define LANG_ZULU 0x35 # endif # ifndef SUBLANG_ARABIC_SAUDI_ARABIA # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 # endif # ifndef SUBLANG_ARABIC_IRAQ # define SUBLANG_ARABIC_IRAQ 0x02 # endif # ifndef SUBLANG_ARABIC_EGYPT # define SUBLANG_ARABIC_EGYPT 0x03 # endif # ifndef SUBLANG_ARABIC_LIBYA # define SUBLANG_ARABIC_LIBYA 0x04 # endif # ifndef SUBLANG_ARABIC_ALGERIA # define SUBLANG_ARABIC_ALGERIA 0x05 # endif # ifndef SUBLANG_ARABIC_MOROCCO # define SUBLANG_ARABIC_MOROCCO 0x06 # endif # ifndef SUBLANG_ARABIC_TUNISIA # define SUBLANG_ARABIC_TUNISIA 0x07 # endif # ifndef SUBLANG_ARABIC_OMAN # define SUBLANG_ARABIC_OMAN 0x08 # endif # ifndef SUBLANG_ARABIC_YEMEN # define SUBLANG_ARABIC_YEMEN 0x09 # endif # ifndef SUBLANG_ARABIC_SYRIA # define SUBLANG_ARABIC_SYRIA 0x0a # endif # ifndef SUBLANG_ARABIC_JORDAN # define SUBLANG_ARABIC_JORDAN 0x0b # endif # ifndef SUBLANG_ARABIC_LEBANON # define SUBLANG_ARABIC_LEBANON 0x0c # endif # ifndef SUBLANG_ARABIC_KUWAIT # define SUBLANG_ARABIC_KUWAIT 0x0d # endif # ifndef SUBLANG_ARABIC_UAE # define SUBLANG_ARABIC_UAE 0x0e # endif # ifndef SUBLANG_ARABIC_BAHRAIN # define SUBLANG_ARABIC_BAHRAIN 0x0f # endif # ifndef SUBLANG_ARABIC_QATAR # define SUBLANG_ARABIC_QATAR 0x10 # endif # ifndef SUBLANG_AZERI_LATIN # define SUBLANG_AZERI_LATIN 0x01 # endif # ifndef SUBLANG_AZERI_CYRILLIC # define SUBLANG_AZERI_CYRILLIC 0x02 # endif # ifndef SUBLANG_BENGALI_INDIA # define SUBLANG_BENGALI_INDIA 0x00 # endif # ifndef SUBLANG_BENGALI_BANGLADESH # define SUBLANG_BENGALI_BANGLADESH 0x01 # endif # ifndef SUBLANG_CHINESE_MACAU # define SUBLANG_CHINESE_MACAU 0x05 # endif # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 # endif # ifndef SUBLANG_ENGLISH_JAMAICA # define SUBLANG_ENGLISH_JAMAICA 0x08 # endif # ifndef SUBLANG_ENGLISH_CARIBBEAN # define SUBLANG_ENGLISH_CARIBBEAN 0x09 # endif # ifndef SUBLANG_ENGLISH_BELIZE # define SUBLANG_ENGLISH_BELIZE 0x0a # endif # ifndef SUBLANG_ENGLISH_TRINIDAD # define SUBLANG_ENGLISH_TRINIDAD 0x0b # endif # ifndef SUBLANG_ENGLISH_ZIMBABWE # define SUBLANG_ENGLISH_ZIMBABWE 0x0c # endif # ifndef SUBLANG_ENGLISH_PHILIPPINES # define SUBLANG_ENGLISH_PHILIPPINES 0x0d # endif # ifndef SUBLANG_ENGLISH_INDONESIA # define SUBLANG_ENGLISH_INDONESIA 0x0e # endif # ifndef SUBLANG_ENGLISH_HONGKONG # define SUBLANG_ENGLISH_HONGKONG 0x0f # endif # ifndef SUBLANG_ENGLISH_INDIA # define SUBLANG_ENGLISH_INDIA 0x10 # endif # ifndef SUBLANG_ENGLISH_MALAYSIA # define SUBLANG_ENGLISH_MALAYSIA 0x11 # endif # ifndef SUBLANG_ENGLISH_SINGAPORE # define SUBLANG_ENGLISH_SINGAPORE 0x12 # endif # ifndef SUBLANG_FRENCH_LUXEMBOURG # define SUBLANG_FRENCH_LUXEMBOURG 0x05 # endif # ifndef SUBLANG_FRENCH_MONACO # define SUBLANG_FRENCH_MONACO 0x06 # endif # ifndef SUBLANG_FRENCH_WESTINDIES # define SUBLANG_FRENCH_WESTINDIES 0x07 # endif # ifndef SUBLANG_FRENCH_REUNION # define SUBLANG_FRENCH_REUNION 0x08 # endif # ifndef SUBLANG_FRENCH_CONGO # define SUBLANG_FRENCH_CONGO 0x09 # endif # ifndef SUBLANG_FRENCH_SENEGAL # define SUBLANG_FRENCH_SENEGAL 0x0a # endif # ifndef SUBLANG_FRENCH_CAMEROON # define SUBLANG_FRENCH_CAMEROON 0x0b # endif # ifndef SUBLANG_FRENCH_COTEDIVOIRE # define SUBLANG_FRENCH_COTEDIVOIRE 0x0c # endif # ifndef SUBLANG_FRENCH_MALI # define SUBLANG_FRENCH_MALI 0x0d # endif # ifndef SUBLANG_FRENCH_MOROCCO # define SUBLANG_FRENCH_MOROCCO 0x0e # endif # ifndef SUBLANG_FRENCH_HAITI # define SUBLANG_FRENCH_HAITI 0x0f # endif # ifndef SUBLANG_GERMAN_LUXEMBOURG # define SUBLANG_GERMAN_LUXEMBOURG 0x04 # endif # ifndef SUBLANG_GERMAN_LIECHTENSTEIN # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 # endif # ifndef SUBLANG_KASHMIRI_INDIA # define SUBLANG_KASHMIRI_INDIA 0x02 # endif # ifndef SUBLANG_MALAY_MALAYSIA # define SUBLANG_MALAY_MALAYSIA 0x01 # endif # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 # endif # ifndef SUBLANG_NEPALI_INDIA # define SUBLANG_NEPALI_INDIA 0x02 # endif # ifndef SUBLANG_PUNJABI_INDIA # define SUBLANG_PUNJABI_INDIA 0x00 # endif # ifndef SUBLANG_PUNJABI_PAKISTAN # define SUBLANG_PUNJABI_PAKISTAN 0x01 # endif # ifndef SUBLANG_ROMANIAN_ROMANIA # define SUBLANG_ROMANIAN_ROMANIA 0x00 # endif # ifndef SUBLANG_ROMANIAN_MOLDOVA # define SUBLANG_ROMANIAN_MOLDOVA 0x01 # endif # ifndef SUBLANG_SERBIAN_LATIN # define SUBLANG_SERBIAN_LATIN 0x02 # endif # ifndef SUBLANG_SERBIAN_CYRILLIC # define SUBLANG_SERBIAN_CYRILLIC 0x03 # endif # ifndef SUBLANG_SINDHI_INDIA # define SUBLANG_SINDHI_INDIA 0x00 # endif # ifndef SUBLANG_SINDHI_PAKISTAN # define SUBLANG_SINDHI_PAKISTAN 0x01 # endif # ifndef SUBLANG_SPANISH_GUATEMALA # define SUBLANG_SPANISH_GUATEMALA 0x04 # endif # ifndef SUBLANG_SPANISH_COSTA_RICA # define SUBLANG_SPANISH_COSTA_RICA 0x05 # endif # ifndef SUBLANG_SPANISH_PANAMA # define SUBLANG_SPANISH_PANAMA 0x06 # endif # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 # endif # ifndef SUBLANG_SPANISH_VENEZUELA # define SUBLANG_SPANISH_VENEZUELA 0x08 # endif # ifndef SUBLANG_SPANISH_COLOMBIA # define SUBLANG_SPANISH_COLOMBIA 0x09 # endif # ifndef SUBLANG_SPANISH_PERU # define SUBLANG_SPANISH_PERU 0x0a # endif # ifndef SUBLANG_SPANISH_ARGENTINA # define SUBLANG_SPANISH_ARGENTINA 0x0b # endif # ifndef SUBLANG_SPANISH_ECUADOR # define SUBLANG_SPANISH_ECUADOR 0x0c # endif # ifndef SUBLANG_SPANISH_CHILE # define SUBLANG_SPANISH_CHILE 0x0d # endif # ifndef SUBLANG_SPANISH_URUGUAY # define SUBLANG_SPANISH_URUGUAY 0x0e # endif # ifndef SUBLANG_SPANISH_PARAGUAY # define SUBLANG_SPANISH_PARAGUAY 0x0f # endif # ifndef SUBLANG_SPANISH_BOLIVIA # define SUBLANG_SPANISH_BOLIVIA 0x10 # endif # ifndef SUBLANG_SPANISH_EL_SALVADOR # define SUBLANG_SPANISH_EL_SALVADOR 0x11 # endif # ifndef SUBLANG_SPANISH_HONDURAS # define SUBLANG_SPANISH_HONDURAS 0x12 # endif # ifndef SUBLANG_SPANISH_NICARAGUA # define SUBLANG_SPANISH_NICARAGUA 0x13 # endif # ifndef SUBLANG_SPANISH_PUERTO_RICO # define SUBLANG_SPANISH_PUERTO_RICO 0x14 # endif # ifndef SUBLANG_SWEDISH_FINLAND # define SUBLANG_SWEDISH_FINLAND 0x02 # endif # ifndef SUBLANG_TAMAZIGHT_ARABIC # define SUBLANG_TAMAZIGHT_ARABIC 0x01 # endif # ifndef SUBLANG_TAMAZIGHT_LATIN # define SUBLANG_TAMAZIGHT_LATIN 0x02 # endif # ifndef SUBLANG_TIGRINYA_ETHIOPIA # define SUBLANG_TIGRINYA_ETHIOPIA 0x00 # endif # ifndef SUBLANG_TIGRINYA_ERITREA # define SUBLANG_TIGRINYA_ERITREA 0x01 # endif # ifndef SUBLANG_URDU_PAKISTAN # define SUBLANG_URDU_PAKISTAN 0x01 # endif # ifndef SUBLANG_URDU_INDIA # define SUBLANG_URDU_INDIA 0x02 # endif # ifndef SUBLANG_UZBEK_LATIN # define SUBLANG_UZBEK_LATIN 0x01 # endif # ifndef SUBLANG_UZBEK_CYRILLIC # define SUBLANG_UZBEK_CYRILLIC 0x02 # endif #endif /* XPG3 defines the result of 'setlocale (category, NULL)' as: "Directs 'setlocale()' to query 'category' and return the current setting of 'local'." However it does not specify the exact format. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ #if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) # define HAVE_LOCALE_NULL #endif /* Determine the current locale's name, and canonicalize it into XPG syntax language[_territory[.codeset]][@modifier] The codeset part in the result is not reliable; the locale_charset() should be used for codeset information instead. The result must not be freed; it is statically allocated. */ const char * _nl_locale_name (int category, const char *categoryname) { const char *retval; #ifndef WIN32 /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. On some systems this can be done by the 'setlocale' function itself. */ # if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL retval = setlocale (category, NULL); # else /* Setting of LC_ALL overwrites all other. */ retval = getenv ("LC_ALL"); if (retval == NULL || retval[0] == '\0') { /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval == NULL || retval[0] == '\0') { /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval == NULL || retval[0] == '\0') /* We use C as the default domain. POSIX says this is implementation defined. */ retval = "C"; } } # endif return retval; #else /* WIN32 */ /* Return an XPG style locale name language[_territory][@modifier]. Don't even bother determining the codeset; it's not useful in this context, because message catalogs are not specific to a single codeset. */ LCID lcid; LANGID langid; int primary, sub; /* Let the user override the system settings through environment variables, as on POSIX systems. */ retval = getenv ("LC_ALL"); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv (categoryname); if (retval != NULL && retval[0] != '\0') return retval; retval = getenv ("LANG"); if (retval != NULL && retval[0] != '\0') return retval; /* Use native Win32 API locale ID. */ lcid = GetThreadLocale (); /* Strip off the sorting rules, keep only the language part. */ langid = LANGIDFROMLCID (lcid); /* Split into language and territory part. */ primary = PRIMARYLANGID (langid); sub = SUBLANGID (langid); /* Dispatch on language. See also http://www.unicode.org/unicode/onlinedat/languages.html . For details about languages, see http://www.ethnologue.com/ . */ switch (primary) { case LANG_AFRIKAANS: return "af_ZA"; case LANG_ALBANIAN: return "sq_AL"; case LANG_AMHARIC: return "am_ET"; case LANG_ARABIC: switch (sub) { case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; case SUBLANG_ARABIC_EGYPT: return "ar_EG"; case SUBLANG_ARABIC_LIBYA: return "ar_LY"; case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; case SUBLANG_ARABIC_OMAN: return "ar_OM"; case SUBLANG_ARABIC_YEMEN: return "ar_YE"; case SUBLANG_ARABIC_SYRIA: return "ar_SY"; case SUBLANG_ARABIC_JORDAN: return "ar_JO"; case SUBLANG_ARABIC_LEBANON: return "ar_LB"; case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; case SUBLANG_ARABIC_UAE: return "ar_AE"; case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; case SUBLANG_ARABIC_QATAR: return "ar_QA"; } return "ar"; case LANG_ARMENIAN: return "hy_AM"; case LANG_ASSAMESE: return "as_IN"; case LANG_AZERI: switch (sub) { /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; } return "az"; case LANG_BASQUE: return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ case LANG_BELARUSIAN: return "be_BY"; case LANG_BENGALI: switch (sub) { case SUBLANG_BENGALI_INDIA: return "bn_IN"; case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; } return "bn"; case LANG_BULGARIAN: return "bg_BG"; case LANG_BURMESE: return "my_MM"; case LANG_CAMBODIAN: return "km_KH"; case LANG_CATALAN: return "ca_ES"; case LANG_CHEROKEE: return "chr_US"; case LANG_CHINESE: switch (sub) { case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW"; case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN"; case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; case SUBLANG_CHINESE_MACAU: return "zh_MO"; } return "zh"; case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN * What used to be called Serbo-Croatian * should really now be two separate * languages because of political reasons. * (Says tml, who knows nothing about Serbian * or Croatian.) * (I can feel those flames coming already.) */ switch (sub) { case SUBLANG_DEFAULT: return "hr_HR"; case SUBLANG_SERBIAN_LATIN: return "sr_CS"; case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; } return "hr"; case LANG_CZECH: return "cs_CZ"; case LANG_DANISH: return "da_DK"; case LANG_DIVEHI: return "div_MV"; case LANG_DUTCH: switch (sub) { case SUBLANG_DUTCH: return "nl_NL"; case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; } return "nl"; case LANG_EDO: return "bin_NG"; case LANG_ENGLISH: switch (sub) { /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought * English was the language spoken in England. * Oh well. */ case SUBLANG_ENGLISH_US: return "en_US"; case SUBLANG_ENGLISH_UK: return "en_GB"; case SUBLANG_ENGLISH_AUS: return "en_AU"; case SUBLANG_ENGLISH_CAN: return "en_CA"; case SUBLANG_ENGLISH_NZ: return "en_NZ"; case SUBLANG_ENGLISH_EIRE: return "en_IE"; case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; case SUBLANG_ENGLISH_INDIA: return "en_IN"; case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; } return "en"; case LANG_ESTONIAN: return "et_EE"; case LANG_FAEROESE: return "fo_FO"; case LANG_FARSI: return "fa_IR"; case LANG_FINNISH: return "fi_FI"; case LANG_FRENCH: switch (sub) { case SUBLANG_FRENCH: return "fr_FR"; case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; case SUBLANG_FRENCH_SWISS: return "fr_CH"; case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; case SUBLANG_FRENCH_MONACO: return "fr_MC"; case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ case SUBLANG_FRENCH_REUNION: return "fr_RE"; case SUBLANG_FRENCH_CONGO: return "fr_CG"; case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; case SUBLANG_FRENCH_MALI: return "fr_ML"; case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; case SUBLANG_FRENCH_HAITI: return "fr_HT"; } return "fr"; case LANG_FRISIAN: return "fy_NL"; case LANG_FULFULDE: return "ful_NG"; case LANG_GAELIC: switch (sub) { case 0x01: /* SCOTTISH */ return "gd_GB"; case 0x02: /* IRISH */ return "ga_IE"; } return "C"; case LANG_GALICIAN: return "gl_ES"; case LANG_GEORGIAN: return "ka_GE"; case LANG_GERMAN: switch (sub) { case SUBLANG_GERMAN: return "de_DE"; case SUBLANG_GERMAN_SWISS: return "de_CH"; case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; } return "de"; case LANG_GREEK: return "el_GR"; case LANG_GUARANI: return "gn_PY"; case LANG_GUJARATI: return "gu_IN"; case LANG_HAUSA: return "ha_NG"; case LANG_HAWAIIAN: /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) or Hawaii Creole English ("cpe_US", 600000 speakers)? */ return "cpe_US"; case LANG_HEBREW: return "he_IL"; case LANG_HINDI: return "hi_IN"; case LANG_HUNGARIAN: return "hu_HU"; case LANG_IBIBIO: return "nic_NG"; case LANG_ICELANDIC: return "is_IS"; case LANG_IGBO: return "ibo_NG"; case LANG_INDONESIAN: return "id_ID"; case LANG_INUKTITUT: return "iu_CA"; case LANG_ITALIAN: switch (sub) { case SUBLANG_ITALIAN: return "it_IT"; case SUBLANG_ITALIAN_SWISS: return "it_CH"; } return "it"; case LANG_JAPANESE: return "ja_JP"; case LANG_KANNADA: return "kn_IN"; case LANG_KANURI: return "kau_NG"; case LANG_KASHMIRI: switch (sub) { case SUBLANG_DEFAULT: return "ks_PK"; case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; } return "ks"; case LANG_KAZAK: return "kk_KZ"; case LANG_KONKANI: /* FIXME: Adjust this when such locales appear on Unix. */ return "kok_IN"; case LANG_KOREAN: return "ko_KR"; case LANG_KYRGYZ: return "ky_KG"; case LANG_LAO: return "lo_LA"; case LANG_LATIN: return "la_VA"; case LANG_LATVIAN: return "lv_LV"; case LANG_LITHUANIAN: return "lt_LT"; case LANG_MACEDONIAN: return "mk_MK"; case LANG_MALAY: switch (sub) { case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; } return "ms"; case LANG_MALAYALAM: return "ml_IN"; case LANG_MALTESE: return "mt_MT"; case LANG_MANIPURI: /* FIXME: Adjust this when such locales appear on Unix. */ return "mni_IN"; case LANG_MARATHI: return "mr_IN"; case LANG_MONGOLIAN: return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ case LANG_NEPALI: switch (sub) { case SUBLANG_DEFAULT: return "ne_NP"; case SUBLANG_NEPALI_INDIA: return "ne_IN"; } return "ne"; case LANG_NORWEGIAN: switch (sub) { case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO"; case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; } return "no"; case LANG_ORIYA: return "or_IN"; case LANG_OROMO: return "om_ET"; case LANG_PAPIAMENTU: return "pap_AN"; case LANG_PASHTO: return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ case LANG_POLISH: return "pl_PL"; case LANG_PORTUGUESE: switch (sub) { case SUBLANG_PORTUGUESE: return "pt_PT"; /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; } return "pt"; case LANG_PUNJABI: switch (sub) { case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ } return "pa"; case LANG_RHAETO_ROMANCE: return "rm_CH"; case LANG_ROMANIAN: switch (sub) { case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; } return "ro"; case LANG_RUSSIAN: return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO"; case LANG_SANSKRIT: return "sa_IN"; case LANG_SINDHI: switch (sub) { case SUBLANG_SINDHI_INDIA: return "sd_IN"; case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; } return "sd"; case LANG_SINHALESE: return "si_LK"; case LANG_SLOVAK: return "sk_SK"; case LANG_SLOVENIAN: return "sl_SI"; case LANG_SOMALI: return "so_SO"; case LANG_SORBIAN: /* FIXME: Adjust this when such locales appear on Unix. */ return "wen_DE"; case LANG_SPANISH: switch (sub) { case SUBLANG_SPANISH: return "es_ES"; case SUBLANG_SPANISH_MEXICAN: return "es_MX"; case SUBLANG_SPANISH_MODERN: return "es_ES@modern"; /* not seen on Unix */ case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; case SUBLANG_SPANISH_PANAMA: return "es_PA"; case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; case SUBLANG_SPANISH_PERU: return "es_PE"; case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; case SUBLANG_SPANISH_ECUADOR: return "es_EC"; case SUBLANG_SPANISH_CHILE: return "es_CL"; case SUBLANG_SPANISH_URUGUAY: return "es_UY"; case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; case SUBLANG_SPANISH_HONDURAS: return "es_HN"; case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; } return "es"; case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ case LANG_SWAHILI: return "sw_KE"; case LANG_SWEDISH: switch (sub) { case SUBLANG_DEFAULT: return "sv_SE"; case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; } return "sv"; case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */ case LANG_TAGALOG: return "tl_PH"; case LANG_TAJIK: return "tg_TJ"; case LANG_TAMAZIGHT: switch (sub) { /* FIXME: Adjust this when Tamazight locales appear on Unix. */ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic"; case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin"; } return "ber_MA"; case LANG_TAMIL: return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ case LANG_TATAR: return "tt_RU"; case LANG_TELUGU: return "te_IN"; case LANG_THAI: return "th_TH"; case LANG_TIBETAN: return "bo_CN"; case LANG_TIGRINYA: switch (sub) { case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET"; case SUBLANG_TIGRINYA_ERITREA: return "ti_ER"; } return "ti"; case LANG_TSONGA: return "ts_ZA"; case LANG_TSWANA: return "tn_BW"; case LANG_TURKISH: return "tr_TR"; case LANG_TURKMEN: return "tk_TM"; case LANG_UKRAINIAN: return "uk_UA"; case LANG_URDU: switch (sub) { case SUBLANG_URDU_PAKISTAN: return "ur_PK"; case SUBLANG_URDU_INDIA: return "ur_IN"; } return "ur"; case LANG_UZBEK: switch (sub) { case SUBLANG_UZBEK_LATIN: return "uz_UZ"; case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; } return "uz"; case LANG_VENDA: /* FIXME: It's not clear whether Venda has the ISO 639-2 two-letter code "ve" or not. http://www.loc.gov/standards/iso639-2/englangn.html has it, but http://lcweb.loc.gov/standards/iso639-2/codechanges.html doesn't, */ return "ven_ZA"; /* or "ve_ZA"? */ case LANG_VIETNAMESE: return "vi_VN"; case LANG_WELSH: return "cy_GB"; case LANG_XHOSA: return "xh_ZA"; case LANG_YI: return "sit_CN"; case LANG_YIDDISH: return "yi_IL"; case LANG_YORUBA: return "yo_NG"; case LANG_ZULU: return "zu_ZA"; default: return "C"; } #endif } pbbuttonsd-0.7.9/intl/log.c0000644000175000017500000000530310463223134012526 00000000000000/* Log file output. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include /* Print an ASCII string with quotes and escape sequences where needed. */ static void print_escaped (FILE *stream, const char *str) { putc ('"', stream); for (; *str != '\0'; str++) if (*str == '\n') { fputs ("\\n\"", stream); if (str[1] == '\0') return; fputs ("\n\"", stream); } else { if (*str == '"' || *str == '\\') putc ('\\', stream); putc (*str, stream); } putc ('"', stream); } /* Add to the log file an entry denoting a failed translation. */ void _nl_log_untranslated (const char *logfilename, const char *domainname, const char *msgid1, const char *msgid2, int plural) { static char *last_logfilename = NULL; static FILE *last_logfile = NULL; FILE *logfile; /* Can we reuse the last opened logfile? */ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0) { /* Close the last used logfile. */ if (last_logfilename != NULL) { if (last_logfile != NULL) { fclose (last_logfile); last_logfile = NULL; } free (last_logfilename); last_logfilename = NULL; } /* Open the logfile. */ last_logfilename = (char *) malloc (strlen (logfilename) + 1); if (last_logfilename == NULL) return; strcpy (last_logfilename, logfilename); last_logfile = fopen (logfilename, "a"); if (last_logfile == NULL) return; } logfile = last_logfile; fprintf (logfile, "domain "); print_escaped (logfile, domainname); fprintf (logfile, "\nmsgid "); print_escaped (logfile, msgid1); if (plural) { fprintf (logfile, "\nmsgid_plural "); print_escaped (logfile, msgid2); fprintf (logfile, "\nmsgstr[0] \"\"\n"); } else fprintf (logfile, "\nmsgstr \"\"\n"); putc ('\n', logfile); } pbbuttonsd-0.7.9/intl/printf.c0000644000175000017500000001717710463223136013265 00000000000000/* Formatted output to strings, using POSIX/XSI format strings with positions. Copyright (C) 2003 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # ifdef _MSC_VER # include # define alloca _alloca # else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif # endif #endif #include #if !HAVE_POSIX_PRINTF #include #include /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif #define STATIC static /* Define auxiliary functions declared in "printf-args.h". */ #include "printf-args.c" /* Define auxiliary functions declared in "printf-parse.h". */ #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnprintf libintl_vasnprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnprintf libintl_asnprintf #include "asnprintf.c" #endif DLL_EXPORTED int libintl_vfprintf (FILE *stream, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vfprintf (stream, format, args); else { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { if (fwrite (result, 1, length, stream) == length) retval = length; free (result); } return retval; } } DLL_EXPORTED int libintl_fprintf (FILE *stream, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vprintf (const char *format, va_list args) { return libintl_vfprintf (stdout, format, args); } DLL_EXPORTED int libintl_printf (const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vsprintf (char *resultbuf, const char *format, va_list args) { if (strchr (format, '$') == NULL) return vsprintf (resultbuf, format, args); else { size_t length = (size_t) ~0 / (4 * sizeof (char)); char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { free (result); return -1; } else return length; } } DLL_EXPORTED int libintl_sprintf (char *resultbuf, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsprintf (resultbuf, format, args); va_end (args); return retval; } #if HAVE_SNPRINTF # if HAVE_DECL__SNPRINTF /* Windows. */ # define system_vsnprintf _vsnprintf # else /* Unix. */ # define system_vsnprintf vsnprintf # endif DLL_EXPORTED int libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args) { if (strchr (format, '$') == NULL) return system_vsnprintf (resultbuf, length, format, args); else { size_t maxlength = length; char *result = libintl_vasnprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { if (length < maxlength) abort (); memcpy (resultbuf, result, maxlength - 1); resultbuf[maxlength - 1] = '\0'; } free (result); return -1; } else return length; } } DLL_EXPORTED int libintl_snprintf (char *resultbuf, size_t length, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vsnprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #if HAVE_ASPRINTF DLL_EXPORTED int libintl_vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = libintl_vasnprintf (NULL, &length, format, args); if (result == NULL) return -1; *resultp = result; return length; } DLL_EXPORTED int libintl_asprintf (char **resultp, const char *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vasprintf (resultp, format, args); va_end (args); return retval; } #endif #if HAVE_FWPRINTF #include #define WIDE_CHAR_VERSION 1 /* Define auxiliary functions declared in "wprintf-parse.h". */ #include "printf-parse.c" /* Define functions declared in "vasnprintf.h". */ #define vasnwprintf libintl_vasnwprintf #include "vasnprintf.c" #if 0 /* not needed */ #define asnwprintf libintl_asnwprintf #include "asnprintf.c" #endif # if HAVE_DECL__SNWPRINTF /* Windows. */ # define system_vswprintf _vsnwprintf # else /* Unix. */ # define system_vswprintf vswprintf # endif DLL_EXPORTED int libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return vfwprintf (stream, format, args); else { size_t length; wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args); int retval = -1; if (result != NULL) { size_t i; for (i = 0; i < length; i++) if (fputwc (result[i], stream) == WEOF) break; if (i == length) retval = length; free (result); } return retval; } } DLL_EXPORTED int libintl_fwprintf (FILE *stream, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vfwprintf (stream, format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vwprintf (const wchar_t *format, va_list args) { return libintl_vfwprintf (stdout, format, args); } DLL_EXPORTED int libintl_wprintf (const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vwprintf (format, args); va_end (args); return retval; } DLL_EXPORTED int libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args) { if (wcschr (format, '$') == NULL) return system_vswprintf (resultbuf, length, format, args); else { size_t maxlength = length; wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args); if (result != resultbuf) { if (maxlength > 0) { if (length < maxlength) abort (); memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t)); resultbuf[maxlength - 1] = 0; } free (result); return -1; } else return length; } } DLL_EXPORTED int libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...) { va_list args; int retval; va_start (args, format); retval = libintl_vswprintf (resultbuf, length, format, args); va_end (args); return retval; } #endif #endif pbbuttonsd-0.7.9/intl/osdep.c0000644000175000017500000000164310463223135013063 00000000000000/* OS dependent parts of libintl. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined __EMX__ # include "os2compat.c" #else /* Avoid AIX compiler warning. */ typedef int dummy; #endif pbbuttonsd-0.7.9/intl/os2compat.c0000644000175000017500000000550310463223134013656 00000000000000/* OS/2 compatibility functions. Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define OS2_AWARE #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* A version of getenv() that works from DLLs */ extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue); char * _nl_getenv (const char *name) { unsigned char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } /* A fixed size buffer. */ char libintl_nl_default_dirname[MAXPATHLEN+1]; char *_nlos2_libdir = NULL; char *_nlos2_localealiaspath = NULL; char *_nlos2_localedir = NULL; static __attribute__((constructor)) void nlos2_initialize () { char *root = getenv ("UNIXROOT"); char *gnulocaledir = getenv ("GNULOCALEDIR"); _nlos2_libdir = gnulocaledir; if (!_nlos2_libdir) { if (root) { size_t sl = strlen (root); _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); memcpy (_nlos2_libdir, root, sl); memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); } else _nlos2_libdir = LIBDIR; } _nlos2_localealiaspath = gnulocaledir; if (!_nlos2_localealiaspath) { if (root) { size_t sl = strlen (root); _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); memcpy (_nlos2_localealiaspath, root, sl); memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); } else _nlos2_localealiaspath = LOCALE_ALIAS_PATH; } _nlos2_localedir = gnulocaledir; if (!_nlos2_localedir) { if (root) { size_t sl = strlen (root); _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); memcpy (_nlos2_localedir, root, sl); memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); } else _nlos2_localedir = LOCALEDIR; } if (strlen (_nlos2_localedir) <= MAXPATHLEN) strcpy (libintl_nl_default_dirname, _nlos2_localedir); } pbbuttonsd-0.7.9/intl/intl-compat.c0000644000175000017500000000644310463223133014201 00000000000000/* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000-2003 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" /* @@ end of prolog @@ */ /* This file redirects the gettext functions (without prefix) to those defined in the included GNU libintl library (with "libintl_" prefix). It is compiled into libintl in order to make the AM_GNU_GETTEXT test of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which has the redirections primarily in the include file. It is also compiled into libgnuintl so that libgnuintl.so can be used as LD_PRELOADable library on glibc systems, to provide the extra features that the functions in the libc don't have (namely, logging). */ #undef gettext #undef dgettext #undef dcgettext #undef ngettext #undef dngettext #undef dcngettext #undef textdomain #undef bindtextdomain #undef bind_textdomain_codeset /* When building a DLL, we must export some functions. Note that because the functions are only defined for binary backward compatibility, we don't need to use __declspec(dllimport) in any case. */ #if defined _MSC_VER && BUILDING_DLL # define DLL_EXPORTED __declspec(dllexport) #else # define DLL_EXPORTED #endif DLL_EXPORTED char * gettext (const char *msgid) { return libintl_gettext (msgid); } DLL_EXPORTED char * dgettext (const char *domainname, const char *msgid) { return libintl_dgettext (domainname, msgid); } DLL_EXPORTED char * dcgettext (const char *domainname, const char *msgid, int category) { return libintl_dcgettext (domainname, msgid, category); } DLL_EXPORTED char * ngettext (const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_ngettext (msgid1, msgid2, n); } DLL_EXPORTED char * dngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n) { return libintl_dngettext (domainname, msgid1, msgid2, n); } DLL_EXPORTED char * dcngettext (const char *domainname, const char *msgid1, const char *msgid2, unsigned long int n, int category) { return libintl_dcngettext (domainname, msgid1, msgid2, n, category); } DLL_EXPORTED char * textdomain (const char *domainname) { return libintl_textdomain (domainname); } DLL_EXPORTED char * bindtextdomain (const char *domainname, const char *dirname) { return libintl_bindtextdomain (domainname, dirname); } DLL_EXPORTED char * bind_textdomain_codeset (const char *domainname, const char *codeset) { return libintl_bind_textdomain_codeset (domainname, codeset); } pbbuttonsd-0.7.9/intl/plural.c0000644000175000017500000011065110463223135013250 00000000000000/* A Bison parser, made from plural.y by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs # define EQUOP2 257 # define CMPOP2 258 # define ADDOP2 259 # define MULOP2 260 # define NUMBER 261 #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include "plural-exp.h" /* The main function generated by the parser is called __gettextparse, but we want it to be called PLURAL_PARSE. */ #ifndef _LIBC # define __gettextparse PLURAL_PARSE #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg #line 49 "plural.y" #ifndef YYSTYPE typedef union { unsigned long int num; enum operator op; struct expression *exp; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #line 55 "plural.y" /* Prototypes for local functions. */ static int yylex (YYSTYPE *lval, const char **pexp); static void yyerror (const char *str); /* Allocation of expressions. */ static struct expression * new_exp (int nargs, enum operator op, struct expression * const *args) { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (enum operator op) { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (enum operator op, struct expression *right) { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (enum operator op, struct expression *left, struct expression *right) { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch) { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } #ifndef YYDEBUG # define YYDEBUG 0 #endif #define YYFINAL 27 #define YYFLAG -32768 #define YYNTBASE 16 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, 2, 2, 2, 5, 2, 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 6, 7, 8, 9, 11 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, 37, 39 }; static const short yyrhs[] = { 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, 15, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 150, 158, 162, 166, 170, 174, 178, 182, 186, 190, 194, 199 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", "start", "exp", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, 7, 8, 0, 2, 0, 0, 0 }; static const short yydefgoto[] = { 25, 5 }; static const short yypact[] = { -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, -3,-32768, -9, 34, 21, 53,-32768 }; static const short yypgoto[] = { -32768, -1 }; #define YYLAST 53 static const short yytable[] = { 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, 13, 14, 27 }; static const short yycheck[] = { 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 0 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "/usr/local/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 151 "plural.y" { if (yyvsp[0].exp == NULL) YYABORT; ((struct parse_args *) arg)->res = yyvsp[0].exp; } break; case 2: #line 159 "plural.y" { yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); } break; case 3: #line 163 "plural.y" { yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); } break; case 4: #line 167 "plural.y" { yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); } break; case 5: #line 171 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 6: #line 175 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 7: #line 179 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 8: #line 183 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); } break; case 9: #line 187 "plural.y" { yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); } break; case 10: #line 191 "plural.y" { yyval.exp = new_exp_0 (var); } break; case 11: #line 195 "plural.y" { if ((yyval.exp = new_exp_0 (num)) != NULL) yyval.exp->val.num = yyvsp[0].num; } break; case 12: #line 200 "plural.y" { yyval.exp = yyvsp[-1].exp; } break; } #line 705 "/usr/local/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 205 "plural.y" void internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (YYSTYPE *lval, const char **pexp) { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (const char *str) { /* Do nothing. We don't print error messages here. */ } pbbuttonsd-0.7.9/intl/VERSION0000644000175000017500000000005010463223131012640 00000000000000GNU gettext library from gettext-0.13.1 pbbuttonsd-0.7.9/libpbbipc/0000777000175000017500000000000010507757750012663 500000000000000pbbuttonsd-0.7.9/libpbbipc/Makefile.in0000644000175000017500000002277410507757750014660 00000000000000# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CXX = @CXX@ DATADIRNAME = @DATADIRNAME@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_LIB = @HAVE_LIB@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_WPRINTF = @HAVE_WPRINTF@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LIB = @LIB@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LN_S = @LN_S@ LTLIB = @LTLIB@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ PACKAGE = @PACKAGE@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ localstatedir = @localstatedir@ lib_LIBRARIES = libpbb.a include_HEADERS = pbb.h pbbmisc.h pbbipc.h pbbtaglist.h pbbtags.h pbberrno.h pbblist.h libpbb_a_SOURCES = pbb_lib.c pbb_ipc.c pbb_errno.c pbb_misc.c pbb_taglist.c pbb_list.c gettext_macros.h @DEBUG_TRUE@AM_CFLAGS = -DDEBUG mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LIBRARIES = $(lib_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libpbb_a_LIBADD = libpbb_a_OBJECTS = pbb_lib.o pbb_ipc.o pbb_errno.o pbb_misc.o \ pbb_taglist.o pbb_list.o AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(include_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(libpbb_a_SOURCES) OBJECTS = $(libpbb_a_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libpbbipc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLIBRARIES: clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) distclean-libLIBRARIES: maintainer-clean-libLIBRARIES: install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libdir) @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) list='$(lib_LIBRARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(libdir)/$$p; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: libpbb.a: $(libpbb_a_OBJECTS) $(libpbb_a_DEPENDENCIES) -rm -f libpbb.a $(AR) cru libpbb.a $(libpbb_a_OBJECTS) $(libpbb_a_LIBADD) $(RANLIB) libpbb.a install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) list='$(include_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(includedir)/$$p; \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = libpbbipc distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done pbb_errno.o: pbb_errno.c ../config.h pbb.h pbbipc.h pbbtaglist.h \ pbberrno.h pbbmisc.h pbbtags.h pbblist.h gettext_macros.h pbb_ipc.o: pbb_ipc.c ../config.h pbb.h pbbipc.h pbbtaglist.h pbberrno.h \ pbbmisc.h pbbtags.h pbblist.h pbb_lib.o: pbb_lib.c pbb.h pbbipc.h pbbtaglist.h pbberrno.h pbbmisc.h \ pbbtags.h pbblist.h pbb_list.o: pbb_list.c ../config.h pbblist.h pbb_misc.o: pbb_misc.c pbb.h pbbipc.h pbbtaglist.h pbberrno.h pbbmisc.h \ pbbtags.h pbblist.h pbb_taglist.o: pbb_taglist.c pbbtaglist.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-libLIBRARIES install-exec: install-exec-am install-data-am: install-includeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-libLIBRARIES uninstall-includeHEADERS uninstall: uninstall-am all-am: Makefile $(LIBRARIES) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-libLIBRARIES mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-libLIBRARIES clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-libLIBRARIES distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-libLIBRARIES \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-libLIBRARIES distclean-libLIBRARIES \ clean-libLIBRARIES maintainer-clean-libLIBRARIES uninstall-libLIBRARIES \ install-libLIBRARIES mostlyclean-compile distclean-compile \ clean-compile maintainer-clean-compile uninstall-includeHEADERS \ install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \ maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # 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: pbbuttonsd-0.7.9/libpbbipc/Makefile.am0000644000175000017500000000056010317474775014636 00000000000000## Process this file with automake to produce Makefile.in ## INCLUDES = -I/lib/modules/`uname -r`/build/include lib_LIBRARIES = libpbb.a include_HEADERS = pbb.h pbbmisc.h pbbipc.h pbbtaglist.h pbbtags.h pbberrno.h pbblist.h libpbb_a_SOURCES = pbb_lib.c pbb_ipc.c pbb_errno.c pbb_misc.c pbb_taglist.c pbb_list.c gettext_macros.h if DEBUG AM_CFLAGS = -DDEBUG endif pbbuttonsd-0.7.9/libpbbipc/pbb_lib.c0000644000175000017500000000553010217627342014326 00000000000000/* ---------------------------------------------------------------------------- * pbb_lib.c * main funtions of pbb library * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include #include #include #include "pbb.h" struct libbase libdata; /* library basic data */ /*--------------------------------------------------------------------- * void init_libpbbuttons () * * This function initialises the basic library structure and * have to be called before any library funcion is used. *---------------------------------------------------------------------*/ void init_libpbb () { struct libbase *base = &libdata; base->serverport = 0; base->msgport = 0; base->ptagcount = 0; base->daemon = PBBDS_NONE; /* don't detach by default */ base->filtermode = 0; /* no filtering by default */ base->uid = geteuid(); /* uid from current process */ base->pidfile[0] = '\0'; base->rc = 0; base->timeforcmd = 10; /* 10 seconds by default */ taglist_init (base->ptags); initListHeader (&base->clients); } void exit_libpbb () { struct libbase *base = &libdata; freeList (&base->clients); if (base->daemon == PBBDS_CHILD) unlink (base->pidfile); } /* This function is for compatibility reasons. It should * be called as early as possible to show the library that * this process becomes a daemon so that error messages * could be redirected into a logfile instead of printing * them to console. It also saves the pidfile name for * later use. */ int prepare_daemon (char *name, char *pidfile, int flags) { struct libbase *base = &libdata; int err; err = check_devorfile(pidfile, TYPE_FILE); /* If the caller set PBBDF_FORCE, it wouldn't matter if the pidfile already exists. The caller takes care about it. */ if (err == 0 && flags == PBBDF_FORCE) err = E_NOEXIST; if (err == E_NOEXIST) { strncpy (base->pidfile, pidfile, sizeof(base->pidfile)); base->daemon = PBBDS_PREPARE; openlog (name, 0, LOG_DAEMON); } return err; } int create_daemon () { struct libbase *base = &libdata; int pid = 0; FILE *fh; if (base->daemon == PBBDS_PREPARE) { if ((pid = fork()) == 0) { base->daemon = PBBDS_CHILD; /* this is the child now */ fclose(stdin); fclose(stdout); fclose(stderr); chdir("/"); setsid(); } else { base->daemon = PBBDS_PARENT; /* this is the parent now */ /* the parent process have to save the pid */ if ((fh = fopen (base->pidfile, "w")) != 0) { fprintf (fh, "%i\n", pid); fclose (fh); } } } return pid; } pbbuttonsd-0.7.9/libpbbipc/pbb_ipc.c0000644000175000017500000003514210257035165014335 00000000000000/* ---------------------------------------------------------------------------- * pbbuttons_ipc.c * functions for client/server inter process communication * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "pbb.h" extern struct libbase libdata; /* Init function called by the program init procedure. Function is known by the prginitab. It does module data initialisation */ int ipc_init (char *name, int mode, int flags) { if (mode == LIBMODE_SERVER) return ipc_serverinit (); else return ipc_clientinit (name, flags); } int ipc_serverinit () { struct libbase *base = &libdata; struct pbbmessage pbbmsg; /* includes empty taglist */ int sPort, i; base->mode = LIBMODE_SERVER; if ((sPort = ipc_findport(SERVERPORTKEY)) < 0) { if ((base->msgport = ipc_createport(SERVERPORTKEY)) < 0) { return E_MSGPORT; } } else { if ((base->msgport = ipc_createport( (key_t) getpid() )) >= 0) { ipc_send(sPort, READVALUE, NULL); /* send test message */ for (i=10; i > 0; i--) { usleep(100); /* timeout loop for the answer */ if (ipc_getmessage (base->msgport, 0, &pbbmsg, sizeof(struct pbbmessage)) >= 0) break; } ipc_removeport(base->msgport); if (i == 0) { ipc_removeport(sPort); /* remove stall pbbuttonsd msgport */ ipc_serverinit(); /* try again */ return E_OLDPORT; /* tell calling function that an old * port has been found and removed */ } } return E_TWICE; } base->serverport = base->msgport; return 0; } int ipc_clientinit (char *name, int flags) { struct libbase *base = &libdata; struct tagitem taglist[4]; base->mode = LIBMODE_CLIENT; taglist_init (taglist); taglist_add (taglist, TAG_CLIENTFLAGS, (long) flags); if (name) taglist_add (taglist, TAG_CLIENTNAME, (long) name); taglist_add (taglist, TAG_CLIENTPID, (long) getpid()); if ((base->serverport = ipc_findport(SERVERPORTKEY)) < 0) { return E_NOSERVER; } else if ((base->msgport = ipc_createport( (key_t) getpid() )) < 0) { return E_MSGPORT; } else if (flags & CLIENT_REGISTER) if ((ipc_send (0, REGISTERCLIENT, taglist)) < 0) { return E_REGISTER; } return 0; } /* Exit function called by the program exit procedure. Function is known by the prginitab. It does module data cleanup. */ int ipc_exit () { struct libbase *base = &libdata; if (base->mode == LIBMODE_SERVER) if (base->daemon == PBBDS_PARENT) base->msgport = -1; /* let messageport to child process */ else distribute_to_clients (CLIENTEXIT, NULL); /* send all clients 'good bye' */ else ipc_send (0, UNREGISTERCLIENT, NULL); if (base->msgport >= 0) ipc_removeport(base->msgport); return 0; } /* Function to send a ipc message to a given messageport. if the library was in client mode the message would be sent to the server and the parameter 'mp' will be ignored. if the pointer 'taglist' was NULL, an empty taglist would be created and sent to the receiver. */ int ipc_send (int mp, int action, struct tagitem *taglist) { struct libbase *base = &libdata; char msgbuffer[MSGMAX], *strptr, *strdata, *nullstr = ""; struct pbbmessage *pbbmsg; int n = 0; if (base->mode == LIBMODE_CLIENT) mp = base->serverport; pbbmsg = (struct pbbmessage *) msgbuffer; pbbmsg->returnport = base->msgport; pbbmsg->action = action; if (taglist == NULL) { pbbmsg->taglist[n].tag = TAG_END; pbbmsg->taglist[n].data = 0; } else do { pbbmsg->taglist[n].tag = taglist[n].tag; pbbmsg->taglist[n].data = taglist[n].data; } while (taglist[n++].tag != TAG_END); strptr = (char *) &pbbmsg->taglist[n]; n = 0; while (pbbmsg->taglist[n].tag) { /* copy and reloc stringdata in tags */ if ( !(pbbmsg->taglist[n].tag & FLG_ERROR) && (pbbmsg->taglist[n].tag & FLG_STRING)) { strdata = (char*) pbbmsg->taglist[n].data; if (strdata == NULL) strdata = nullstr; if (strptr + strlen (strdata) + 1 >= msgbuffer + sizeof (msgbuffer)) return -1; strcpy (strptr, strdata); pbbmsg->taglist[n].data = (tag_t) (strptr - msgbuffer); strptr += strlen (strdata) + 1 ; } n++; } if ((ipc_putmessage (mp, pbbmsg, (size_t) (strptr - msgbuffer))) == 0) return 0; /* message sent */ return -1; /* message not sent */ } /* This funcion will check it there are messages pending at the messageport. If so the message would be received and returned. In this case all string pointers in the buffer are adjusted and zero is returned. If it was something wrong with the message or no message was pending, -1 would be returned and the contents of the buffer is invalid. If REGISTERCLIENT or UNREGISTERCLIENT were received, the messages would be processed here directly. the returncode in this case is also -1. */ int ipc_receive (void *buffer, size_t bufferlen) { struct libbase *base = &libdata; struct pbbmessage *pbbmsg = (struct pbbmessage *) buffer; int n; uid_t owner; if (ipc_getmessage (base->msgport, 0, pbbmsg, bufferlen) < 0) { if (errno == -E2BIG) ipc_getmessagepart (base->msgport, 0, pbbmsg, bufferlen); } else if (pbbmsg->messagetype == MESSAGETYPE) { owner = ipc_getportowner (pbbmsg->returnport); n = 0; while (pbbmsg->taglist[n].tag) { if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 1)) tagerror (&pbbmsg->taglist[n], E_PERM); else if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 2) && (owner != base->uid)) tagerror (&pbbmsg->taglist[n], E_PERM); else if ((pbbmsg->action == CHANGEVALUE) && (base->filtermode == 0) && (tagfind (base->ptags, pbbmsg->taglist[n].tag, 0)) && (owner != geteuid())) /* protected tags are only changable by */ tagerror (&pbbmsg->taglist[n], E_PERM); /* the processowner of pbbuttonsd */ else if ((pbbmsg->taglist[n].tag & FLG_PRIVATE)) /* filter private tags */ tagerror (&pbbmsg->taglist[n], E_PRIVATE); else if ( !(pbbmsg->taglist[n].tag & FLG_ERROR) && (pbbmsg->taglist[n].tag & FLG_STRING)) /* reloc stringdata in tags */ pbbmsg->taglist[n].data += (long) buffer; n++; } if (base->mode == LIBMODE_SERVER) { if (pbbmsg->action == REGISTERCLIENT) { if (register_client (pbbmsg->returnport, pbbmsg->taglist)) ipc_send (pbbmsg->returnport, REGFAILED, NULL); return -1; /* message evaluated */ } else if (pbbmsg->action == UNREGISTERCLIENT) { unregister_client (pbbmsg->returnport); return -1; /* message evaluated */ } else if (pbbmsg->action == GETCLIENTLIST) { ipc_sendclientlist(pbbmsg->returnport); return -1; /* message evaluated */ } } return 0; /* message received */ } return -1; /* no message pending or ignore it */ } /* This function adds a client message port to the list. This client will get event messages * from the server in the future. If the client was successfull added, the return value * would be 0, otherwise -1 */ #ifdef DEBUG void printClients () { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; printf ("\nClients:\n\n"); printf (" PID | Name | Port | Flags\n"); printf (" ------+----------------------+---------+-----------\n"); while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); printf (" %5d | %-20s | %7d | %08x\n", client->pid, (client->name) ? client->name : "", client->port, client->flags); } printf ("\n"); } #endif void ipc_sendclientlist (int port) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; struct tagitem *taglist; int cnt; cnt = getNodeCount(&base->clients); if ((taglist = (struct tagitem *) malloc (sizeof(struct tagitem) * (cnt*4 + 1)))) { taglist_init (taglist); while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); taglist_add (taglist, TAG_CLIENTPID, client->pid); taglist_add (taglist, TAG_CLIENTNAME, (tag_t) client->name); taglist_add (taglist, TAG_CLIENTPORT, client->port); taglist_add (taglist, TAG_CLIENTFLAGS, client->flags); } ipc_send (port, CHANGEVALUE, taglist); free (taglist); } } struct listnode * getPBBClientName (struct listhead *lh, char *name) { struct listnode *it = lh->first; struct pbbclient *client; if (name) { while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if (client->name) if (strcmp (name, client->name) == 0) return it->pred; } } return NULL; } int register_client (int cmsgport, struct tagitem *taglist) { struct libbase *base = &libdata; struct listnode *oldnode, *newnode; struct pbbclient *client; long flags; char *name; int len, pid; name = (char *) tagfind (taglist, TAG_CLIENTNAME, (long) NULL); flags = tagfind (taglist, TAG_CLIENTFLAGS, 0); pid = (int) tagfind (taglist, TAG_CLIENTPID, 0); oldnode = getPBBClientName (&base->clients, name); if ((oldnode) && (flags & CLIENT_EXCLUSIVE)) { if (flags & CLIENT_REPLACEMENT) { /* new client replaces old one. So wave old existing * client good bye */ client = (struct pbbclient *) getNodeData (oldnode); ipc_send (client->port, CLIENTEXIT, NULL); freeListNode (oldnode); } else /* client already exists, registration denied */ return -1; } len = (name) ? strlen (name) + 1 : 0; if ((newnode = newListNode (sizeof (struct pbbclient) + len))) { client = (struct pbbclient *) getNodeData (newnode); client->port = cmsgport; client->flags = flags; client->pid = pid; if (name) { client->name = (char*) client + sizeof (struct pbbclient); strcpy (client->name, name); } else client->name = NULL; appendListNode (&base->clients, newnode); #ifdef DEBUG printClients(); #endif return 0; } return -1; } /* This function removes a client message port from the list and reorganizes the * list so that gaps would be eliminated. This client won't get further messages from * the server. If the client was successfull removed, the return value would be 0, * otherwise -1 */ int unregister_client (int cmsgport) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if (client->port == cmsgport) { freeListNode (it->pred); #ifdef DEBUG printClients(); #endif return 0; } } return -1; } /* This function distributes a single tag to all clients. Most of the distribution tasks are single tag transmissions. */ void singletag_to_clients (int action, tag_t tag, tag_t data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); distribute_to_clients (action, taglist); } /* This function distributes a single tag to the server. */ int singletag_to_server (int action, tag_t tag, tag_t data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); return ipc_send (0, action, taglist); } /* This function sends a message with given code and value to every registered * client. If an error with a client occured, that client would be unregistered */ void distribute_to_clients (int action, struct tagitem *taglist) { struct libbase *base = &libdata; struct listnode *it = base->clients.first; struct pbbclient *client; #ifdef DEBUG peep_ipc (taglist); #endif while ((it = it->next)) { client = (struct pbbclient *) getNodeData (it->pred); if ((ipc_send (client->port, action, taglist)) != 0) unregister_client (client->port); } } int ipc_protect_tag (tag_t tag) { struct libbase *base = &libdata; if (base->ptagcount < (MAXPROTECTEDTAGS - 1)) { taglist_add (base->ptags, tag, 1); return 0; } return -1; } void ipc_filteruser (uid_t uid) { struct libbase *base = &libdata; base->filtermode = 2; base->uid = uid; } void ipc_filterall () { struct libbase *base = &libdata; base->filtermode = 1; } void ipc_filterclear () { struct libbase *base = &libdata; base->filtermode = 0; } /* ---------------------- LOW LEVEL MESSAGE FUNCTIONS ----------------------- */ /* This function create an new message port with world read/write permissions. The result is an errorcode or an IPC identifier for the messageport */ int ipc_createport (key_t keyval) { int mp; int perm = 0622; /* permissions for the messageport */ if ((mp = msgget(keyval, IPC_CREAT | IPC_EXCL | perm)) == -1) { return -errno; } return mp; } /* This function look up a message port. If it was found the IPC identifier would be returned. Otherwise an errorcode will be returned. */ int ipc_findport (key_t keyval) { int mp; if ((mp = msgget(keyval, 0)) == -1) return -errno; return mp; } /* This function removed a messageport from the kernel list. */ int ipc_removeport (int mp) { if( msgctl( mp, IPC_RMID, 0) == -1) return -errno; return 0; } /* This function puts a message to a given IPC messagequeue */ int ipc_putmessage (int mp, struct pbbmessage *msg, size_t len) { msg->messagetype = MESSAGETYPE; if (msgsnd (mp, msg, len - sizeof(long), 0) == -1) return -errno; return 0; } /* This function polls the next message from the given IPC message queue. if there is no new message pending it returns immediately with a corresponding return code. */ int ipc_getmessage (int mp, long type, struct pbbmessage *msg, size_t len) { if (msgrcv (mp, msg, len, type, IPC_NOWAIT) == -1) return -errno; return 0; } /* This function polls the next message from the given IPC message queue. if there is no new message pending it returns immediately with a corresponding return code. This function gets also messages that are to big for the buffer. In this case the buffer is filled to its end and the rest of the message is lost. */ int ipc_getmessagepart (int mp, long type, struct pbbmessage *msg, size_t len) { if (msgrcv (mp, msg, len, type, IPC_NOWAIT | MSG_NOERROR) == -1) return -errno; return 0; } /* This function reads the creator-id of an given port. This is needed to verify permissions. The creator-id is used because the owner-id of a messageport could be changed by the owner, not so the creator-id. */ uid_t ipc_getportowner (int mp) { struct msqid_ds qbuf; if (msgctl (mp, IPC_STAT, &qbuf) != -1) return qbuf.msg_perm.cuid; return -1; } pbbuttonsd-0.7.9/libpbbipc/pbb_errno.c0000644000175000017500000000620310224273750014701 00000000000000/* ---------------------------------------------------------------------------- * pbb_errno.c * libpbb funtions to handle error messages * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) # include # include # include #endif #include "pbb.h" #include "gettext_macros.h" extern struct libbase libdata; /* This function is depreciated and should not be used in new developments or * changes of existing clients. Use replacement function print_msg() instead. */ void print_error (char *msg, ...) { va_list args; va_start (args, msg); print_message (PBB_ERR, msg, args); va_end (args); } void print_msg (enum pbberrtype type, char *msg, ...) { va_list args; va_start (args, msg); print_message (type, msg, args); va_end (args); } void print_message (enum pbberrtype type, char *msg, va_list args) { struct libbase *base = &libdata; va_list targs; char inbuffer[200], *inptr = inbuffer; int offset, level; #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) iconv_t cvh; char outbuffer[200], *outptr = outbuffer; size_t count, inidx, outidx; #endif va_copy (targs, args); switch (type) { case PBB_ERR: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("ERROR")); level = LOG_ERR; break; case PBB_WARN: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("WARNING")); level = LOG_WARNING; break; case PBB_INFO: snprintf (inbuffer, sizeof(inbuffer) - 1, "%s: ", _("INFO")); default: level = LOG_INFO; } offset = strlen (inbuffer); vsnprintf (&inbuffer[offset], sizeof(inbuffer) - offset - 1, msg, targs); va_end (targs); #if defined(HAVE_ICONV) && defined(HAVE_LANGIINFO_CODESET) && defined(ENABLE_NLS) inidx = strlen(inbuffer); outidx = sizeof(outbuffer); if ((cvh = iconv_open (nl_langinfo(CODESET), bind_textdomain_codeset(textdomain(NULL), NULL))) != (iconv_t) -1) { count = iconv (cvh, &inptr, &inidx, &outptr, &outidx); inptr = count == -1 ? inbuffer : outbuffer; *outptr = '\0'; /* iconv doesn't terminate strings with '\0' */ iconv_close (cvh); } #endif /* PBB_ERR PBB_WARN PBB_INFO * (LOG_ERR) (LOG_WARNING) (LOG_INFO) * PBBDS_NONE stderr stderr stderr * PBBDS_PREPARE stderr + syslog syslog syslog * PBBDS_PARENT stderr + syslog syslog syslog * PBBDS_CHILD syslog syslog syslog */ if (base->daemon != PBBDS_NONE) { if (type == PBB_ERR && base->daemon != PBBDS_CHILD) fprintf(stderr, inptr); syslog(level, inptr); } else fprintf(stderr, inptr); } pbbuttonsd-0.7.9/libpbbipc/pbb_misc.c0000644000175000017500000001553010477313351014514 00000000000000/* ---------------------------------------------------------------------------- * pbb_misc.c * funtions usefull for everybody * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pbb.h" /* the prototype for getpgid() should be in unistd.h but although it is * included above the compiler complains with "implicit declaration for * getpgid" if this line is missing. This must be further investigated. */ extern pid_t getpgid (pid_t pid); extern struct libbase libdata; /* This function checks the existance and the filetype of a given * file and returns the result. The result is '0' if the given file * exists and matches the desired filetype. Otherwise an error code * is returned. */ int check_devorfile (char *file, int type) { struct stat stat_buf; int rc; if (type == TYPE_SYMLINK) rc = lstat(file, &stat_buf); /* don't follow symlinks */ else rc = stat(file, &stat_buf); /* follow symlinks */ if (rc) return E_NOEXIST; else switch (type) { case TYPE_CHARDEV: if(!S_ISCHR(stat_buf.st_mode)) return E_NOCHAR; break; case TYPE_BLKDEV: if(!S_ISBLK(stat_buf.st_mode)) return E_NOBLK; break; case TYPE_SYMLINK: if (!S_ISLNK(stat_buf.st_mode)) return E_NOLINK; break; case TYPE_FILE: if (!S_ISREG(stat_buf.st_mode)) return E_NOFILE; break; case TYPE_DIR: if (!S_ISDIR(stat_buf.st_mode)) return E_NODIR; break; } return 0; } /* This function runs a program in an separate process and waits for * it's return. If the program haven't returned after base->timeforcmd * seconds, it will be killed. The child process closes all open * handles and switches STDIN, STDOUT and STDERR to /dev/null so * that the program can't process any input or output. */ int launch_program (char* maskstr, ...) { struct libbase *base = &libdata; int pid, pgrp, status, i, n, rc, maxfiles; struct rlimit l; char *argv[MAXARGS+1], script[MAXCMDLEN+1]; va_list list; va_start(list, maskstr); vsnprintf (script, MAXCMDLEN, maskstr, list); script[MAXCMDLEN] = '\0'; va_end (list); i = n = rc = maxfiles = 0; do { argv[i++] = &script[n]; /* put argument in argv[] array */ while (script[n] != ' ' && script[n] != '\0') n++; if (script[n] == ' ') { script[n] = '\0'; /* terminate argument */ while (script[++n] == ' '); /* remove leading spaces */ } } while (i < MAXARGS && script[n] != '\0'); argv[i] = NULL; /* terminate argv[] array */ if((rc = check_permissions (argv[0], geteuid(), 0700, 022))) return rc; if (!getrlimit(RLIMIT_NOFILE, &l)) maxfiles = l.rlim_cur; /* get max count of file handles */ pid = fork(); switch (pid) { case 0: /* child */ for (i=0; i < maxfiles; i++) close(i); /* close all possible file handles */ open("/dev/null", O_RDONLY); /* STDIN */ open("/dev/null", O_WRONLY); /* STDOUT */ open("/dev/null", O_WRONLY); /* STDERR */ setsid(); /* opens its own process group */ execv(argv[0], argv); /* execute command */ exit(99); /* will only be executed if execv fails */ break; case -1: /* fork failed, no child created */ rc = E_CLDFAIL; break; default: /* parent */ rc = 0; for (i=base->timeforcmd * 10; i > 0; i--) { usleep(100000); /* sleep 100ms */ if (waitpid (pid, &status, WNOHANG)) { if (WIFEXITED(status)) { if ((base->rc = WEXITSTATUS(status))) rc = E_CLDEXIT; } else if (WIFSIGNALED(status)) rc = E_CLDSIG; /* else: If the child have not exited normally * and was not terminated by a signal then it * has to be stopped. In this case the lopp will * continue and after the timeout is over the * stopped child will be killed */ break; } } if (i == 0) { pgrp = getpgid(pid); /* get childs process group */ kill (-pgrp, SIGKILL); /* kill child and his childs */ waitpid (pid, &status, 0); /* clean up zombie */ rc = E_CLDKILL; } } return rc; } int get_lastrc() { struct libbase *base = &libdata; return base->rc; } int get_timeforcmd() { struct libbase *base = &libdata; return base->timeforcmd; } void set_timeforcmd(int timeout) { struct libbase *base = &libdata; if (timeout <= 0) timeout = 1; base->timeforcmd = timeout; } int check_permissions (char *file, uid_t uid, mode_t perms, int mask) { struct stat stat_buf; if(stat(file, &stat_buf)) return E_NOEXIST; if (stat_buf.st_uid != 0 && stat_buf.st_uid != uid) return E_USER; if (stat_buf.st_mode & mask) return E_RIGHTS; if ((stat_buf.st_mode & perms) != perms) return E_PERM; return 0; } int get_owner (char *file) { struct stat stat_buf; if(stat(file, &stat_buf)) return -1; return stat_buf.st_uid; return 0; } int get_permissions (char *file) { struct stat stat_buf; if(stat(file, &stat_buf)) return -1; return stat_buf.st_mode & 0777; } int keydelayms (struct timeval *start, int value, int delay) { struct timeval tv; long ms; if (value == 1) /* key pressed for the first time */ gettimeofday (start, 0); if (value == 2) { gettimeofday(&tv, 0); ms = (tv.tv_sec - start->tv_sec) * 1000000 + tv.tv_usec - start->tv_usec; if (ms > (delay * 1000)) return 1; } return 0; } /* This function removes all whitespaces from the buffer except * quoted ones. */ void cleanup_buffer(char *buffer) { char *buf2 = buffer, quotchar = 0; while (*buffer != 0) { *buf2 = *buffer++; if (quotchar == 0) { /* no quoting active */ if ((*buf2 == '"') || (*buf2 == '\'')) quotchar = *buf2; else if ((*buf2 != ' ') && (*buf2 != '\t')) buf2++; } else if (*buf2 == quotchar) /* qouting active */ quotchar = 0; else buf2++; } *buf2 = 0; /* terminate cleaned-up buffer again */ } /* This function converts a string to an integer. Additionally to * atoi() it converts also hexadecimal values */ int axtoi (char *arg) { int val, pwr = 1, rc = 0; size_t n, m; char hex[9], c; for (n=0,m=0; n < strlen(arg); n++) if (arg[n] != ' ') { hex[m++] = c = toupper(arg[n]); if (m == sizeof(hex) || c < '0' || c > 'F') return 0; /* overflow or invalid */ } hex[m] = '\0'; /* terminate string */ for (n=0; n < m; n++) { c = hex[m-n-1]; if ((c >= 'A') && (c <= 'F')) { val = c -'A' + 10; } else { val = c - '0'; } rc = rc + val * pwr; pwr *= 16; } return rc; } pbbuttonsd-0.7.9/libpbbipc/pbb_taglist.c0000644000175000017500000000434410477313505015232 00000000000000/* ---------------------------------------------------------------------------- * taglist.c * funtions to handle taglists * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include "pbbtaglist.h" /* This function searches for a named 'tag' in 'taglist'. If the tag was found its data otherwise 'val' would be returned. */ tag_t tagfind (struct tagitem *taglist, tag_t tag, tag_t val) { while (taglist->tag != TAG_END) { if (taglist->tag == tag) { val = taglist->data; break; } else taglist++; } return val; } /* This function replaces a given Tag with TAG_SKIP. As result this Tag is deleted from the taglist. If taglist didn't contain Tag, nothing would be done*/ void tagskip (struct tagitem *taglist, tag_t tag) { while (taglist->tag != TAG_END) { if (taglist->tag == tag) { taglist->data = taglist->tag; taglist->tag = TAG_SKIP; break; } else taglist++; } } int tagerror (struct tagitem *tag, int error) { tag->data = (tag_t) error; tag->tag |= FLG_ERROR; return error; } /* This function initializes a taglist. */ void taglist_init (struct tagitem *taglist) { taglist->tag = TAG_END; taglist->data = 0; } /* This function adds a tagitem to an existing taglist. The taglist must be long enough for the new tag. No boundary checks are performed. */ void taglist_add (struct tagitem *taglist, tag_t tag, tag_t val) { while (taglist->tag != TAG_END) taglist++; /* find end of taglist */ taglist->tag = tag; /* add tagitem */ taglist->data = val; taglist++; taglist->tag = TAG_END; /* mark end of taglist again */ taglist->data = 0; } struct tagitem* find_tagitem (struct tagitem *taglist, tag_t tag) { while (taglist->tag != TAG_END && taglist->tag != tag) taglist++; if (taglist->tag == TAG_END) return 0; else return taglist; } int taglist_count (struct tagitem *taglist) { int n = 0; while (taglist->tag != TAG_END) { n++; taglist++; } return n; } pbbuttonsd-0.7.9/libpbbipc/pbb_list.c0000644000175000017500000000476510217607501014537 00000000000000/* ---------------------------------------------------------------------------- * pbb_list.c * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include "pbblist.h" /* +--------+ * +-> |first | --+ * | |tail | <-+ tail is always NULL: no predecessor (pred) * +-- |tailpred| for 'first' and no successor (next) for 'tail' * +--------+ The header is first and last node of the list. */ void initListHeader (struct listhead *lh) { lh->first = (struct listnode *) &lh->tail; lh->tail = NULL; lh->tailpred = (struct listnode *) &lh->first; } void freeList (struct listhead *lh) { struct listnode *it = lh->first; while ((it = it->next)) free (it->pred); initListHeader (lh); } /* append new node to the end of the list */ void appendListNode (struct listhead *lh, struct listnode *ln) { ln->next = lh->tailpred->next; ln->pred = lh->tailpred; lh->tailpred->next = ln; lh->tailpred = ln; } /* remove node from list */ struct listnode* removeListNode (struct listnode *ln) { if (ln) { ln->pred->next = ln->next; ln->next->pred = ln->pred; ln->next = NULL; ln->pred = NULL; } return ln; } /* remove node from list if it is still part of one * and free memory */ void freeListNode (struct listnode *ln) { if (ln->next) /* is node part of a list? */ ln = removeListNode (ln); /* then remove node from list */ free (ln); } /* get memory for a new list node and extend the allocation by * datalen. This buffer behind the node structure is for user * data. */ struct listnode* newListNode (int datalen) { struct listnode *newnode; if ((newnode = malloc (sizeof (struct listnode) + datalen))) { bzero (newnode, sizeof (struct listnode) + datalen); newnode->datalen = datalen; } return newnode; } void * getNodeData (struct listnode *ln) { return (char *) ln + sizeof (struct listnode); } void * getNodeDataEnd (struct listnode *ln) { return (char *) ln + sizeof (struct listnode) + ln->datalen; } int getNodeCount (struct listhead *lh) { struct listnode *it = lh->first; int n = 0; while ((it = it->next)) n++; return n; } pbbuttonsd-0.7.9/libpbbipc/gettext_macros.h0000644000175000017500000000221710054126220015755 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.7.9/libpbbipc/pbb.h0000644000175000017500000000420110223216376013475 00000000000000#ifndef INCLUDE_PBB_H #define INCLUDE_PBB_H /* ---------------------------------------------------------------------------- * pbb.h * prototypes and definitions for pbbuttons library. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include "pbbipc.h" #include "pbberrno.h" #include "pbbmisc.h" #include "pbbtaglist.h" #include "pbbtags.h" #include "pbblist.h" #define MAXPROTECTEDTAGS 20 #define MODE_QUERY 0 /* modes for new handle_tags routines */ #define MODE_CONFIG 1 #define PBBDF_NONE 0 /* Flags for deamonise functions */ #define PBBDF_FORCE 1 enum {PBBDS_NONE, PBBDS_PREPARE, PBBDS_CHILD, PBBDS_PARENT}; /* --- private module data structure of libpbbuttons --- */ struct libbase { int serverport; int msgport; struct tagitem ptags[MAXPROTECTEDTAGS]; int ptagcount; int mode; /* client or server */ int daemon; /* deamon status, possible values see PBBDS_* */ char pidfile[80]; /* name of the pidfile to write the child pid to */ int filtermode; /* = 0: IPC-filtering off = 1: no IPC-Messages will be accepted = 2: only IPC-messages from 'uid' will be accepted */ uid_t uid; /* user-id for IPC-filter */ int rc; /* return code of last launched program */ int timeforcmd; /* timeout value for lauched programs */ struct listhead clients; /* list of registered clients for IPC messages */ }; struct pbbclient { int port; int pid; unsigned int flags; char *name; }; /* prototypes */ /* main initialisation function, call before using any other function */ void init_libpbb(); /* this should be the nearly last function you called in your program */ void exit_libpbb (); int prepare_daemon (char *name, char *pidfile, int flags); int create_daemon (); #endif /* INCLUDE_PBB_H */ pbbuttonsd-0.7.9/libpbbipc/pbbmisc.h0000644000175000017500000000252210477315227014363 00000000000000#ifndef INCLUDE_PBBMISC_H #define INCLUDE_PBBMISC_H /* ---------------------------------------------------------------------------- * pbbmisc.h * prototypes and definitions for misc functions in pbb library. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define STDBUFFERLEN 120 #define MAXARGS 10 /* maximum args for command */ #define MAXCMDLEN 150 /* maximum length of command + args */ /* testtypes for check_devorfile() */ #define TYPE_FILE 0 #define TYPE_BLKDEV 1 #define TYPE_CHARDEV 2 #define TYPE_SYMLINK 3 #define TYPE_DIR 4 /* prototypes */ int check_devorfile(char *file, int type); int launch_program (char* maskstr, ...); int get_lastrc(); int get_timeforcmd(); void set_timeforcmd(int timeout); int check_permissions (char *file, uid_t uid, mode_t perms, int mask); int get_owner (char *file); int get_permissions (char *file); int keydelayms (struct timeval *start, int value, int delay); void cleanup_buffer(char *buffer); int axtoi (char *arg); #endif /* INCLUDE_PBBMISC_H */ pbbuttonsd-0.7.9/libpbbipc/pbbipc.h0000644000175000017500000000523710257031113014172 00000000000000#ifndef INCLUDE_PBBIPC_H #define INCLUDE_PBBIPC_H /* ---------------------------------------------------------------------------- * pbbipc.h * definitions for client/server inter process communication. * * Copyright 2002-2004 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Best view with tabwidth=4 * ----------------------------------------------------------------------------*/ #include #include #include #include "pbbtaglist.h" #define CHUNK(a,b,c,d) ((a)<<24 | (b)<<16 | (c)<<8 | (d)) #define SERVERPORTKEY CHUNK('P', 'B', 'B', 'S') #define MESSAGETYPE CHUNK('P', 'B', 'B', 'M') #define MSGMAX 8192 /* from */ #define LIBMODE_SERVER 1 #define LIBMODE_CLIENT 0 /* action codes */ #define REGISTERCLIENT 1 /* arg = msgport */ #define UNREGISTERCLIENT 2 /* arg = msgport */ #define REGFAILED 3 /* no args */ #define CLIENTEXIT 4 /* no args */ #define GETCLIENTLIST 5 /* no args */ #define CHANGEVALUE 10 /* arg = taglist */ #define CHANGEERROR 11 /* arg = taglist */ #define WARNING 12 /* arg = taglist */ #define READVALUE 13 /* arg = taglist */ struct pbbmessage { long messagetype; int returnport; int action; struct tagitem taglist[1]; }; /* public prototypes */ int ipc_init (char *name, int mode, int reg); int ipc_exit (); int ipc_send (int mp, int action, struct tagitem *taglist); int ipc_receive (void *buffer, size_t bufferlen); /* client only functions */ int singletag_to_server (int action, tag_t tag, tag_t data); /* server only functions */ int register_client (int cmsgport, struct tagitem *taglist); int unregister_client (int cmsgport); void singletag_to_clients (int action, tag_t tag, tag_t data); void distribute_to_clients (int action, struct tagitem *taglist); int ipc_protect_tag (tag_t tag); void ipc_filteruser (uid_t uid); void ipc_filterall (); void ipc_filterclear (); /* private prototypes */ int ipc_serverinit (); int ipc_clientinit (char *name, int flags); int ipc_createport (key_t keyval); int ipc_findport (key_t keyval); int ipc_removeport (int mp); int ipc_putmessage (int mp, struct pbbmessage *msg, size_t len); int ipc_getmessage (int mp, long type, struct pbbmessage *msg, size_t len); int ipc_getmessagepart (int mp, long type, struct pbbmessage *msg, size_t len); uid_t ipc_getportowner (int mp); void ipc_sendclientlist (int port); /*debug */ void peep_ipc (struct tagitem *taglist); #endif /* INCLUDE_PBBIPC_H */ pbbuttonsd-0.7.9/libpbbipc/pbbtaglist.h0000644000175000017500000000432510507216516015075 00000000000000#ifndef INCLUDE_PBBTAGLIST_H #define INCLUDE_PBBTAGLIST_H /* ---------------------------------------------------------------------------- * pbbtaglist.h * prototypes and definitions for pbbtaglist.c. * * Copyright 2002-2004 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Best view with tabwidth=4 * ----------------------------------------------------------------------------*/ #define TAG_END 0 #define TAG_SKIP 1 #define FLG_STRING 0x8000 #define FLG_PRIVATE 0x4000 #define FLG_ERROR 0x2000 #define FLG_NOPEEP 0x1000 /* for pbbuttonsd internal use only */ #define FLG_DEPRECIATED 0x0800 /* for pbbuttonsd internal use only */ /* This mask removes all control bits from a tag identifier so that the pure * identifier is the result. It should always be used before comparing any * tag identifiers. */ #define TAGMASK ~(FLG_ERROR | FLG_NOPEEP | FLG_DEPRECIATED) /* Flags for TAG_SYSINFO */ #define SYSINFO_CONFIGWRITABLE (1<<1) #define SYSINFO_HAVELMU (1<<2) #define SYSINFO_SLEEPSUPPORTED (1<<3) #define SYSINFO_PMUDSUPPORT (1<<4) #define SYSINFO_HAVEOSS (1<<5) #define SYSINFO_HAVEALSA (1<<6) #define SYSINFO_HAVEIBAM (1<<7) #define SYSINFO_PB_USB_TPAD (1<<8) #define SYSINFO_PB_USB_KBD (1<<9) /* Flags for TAG_CLIENTFLAGS */ #define CLIENT_REGISTER (1<<0) /* register client at server */ #define CLIENT_EXCLUSIVE (1<<1) /* only one instance allowed */ #define CLIENT_REPLACEMENT (1<<2 | CLIENT_EXCLUSIVE) /* new instance replaces old one */ typedef unsigned long tag_t; struct tagitem { tag_t tag; tag_t data; }; /* prototypes */ tag_t tagfind (struct tagitem *taglist, tag_t tag, tag_t val); struct tagitem* find_tagitem (struct tagitem *taglist, tag_t tag); void tagskip (struct tagitem *taglist, tag_t tag); int tagerror (struct tagitem *tag, int error); void taglist_init (struct tagitem *taglist); void taglist_add (struct tagitem *taglist, tag_t tag, tag_t val); int taglist_count (struct tagitem *taglist); #endif /* INCLUDE_PBBTAGLIST_H */ pbbuttonsd-0.7.9/libpbbipc/pbbtags.h0000644000175000017500000001604410507215274014365 00000000000000#ifndef INCLUDE_TAGS_H #define INCLUDE_TAGS_H /* --------------------------------------------------------------- * tags.h * definitions of TAGS, functions and structures are defined in * pbbtaglist.h and pbbtaglist.c * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * ATTENTION: Don't use tags marked as "depreciated". They will * be removed in future. * * optimized for tabwith=4 * ---------------------------------------------------------------*/ #include "pbbtaglist.h" #define PBBLIB 1 << 24 #define TAG_CLIENTNAME PBBLIB | FLG_STRING | 1 #define TAG_CLIENTFLAGS PBBLIB | 2 #define TAG_CLIENTPID PBBLIB | 3 #define TAG_CLIENTPORT PBBLIB | 4 /* Pri0 Tags */ #define MOD_SYSTEM 1 << 16 #define TAG_KEYCODE MOD_SYSTEM | FLG_PRIVATE | 1 #define TAG_KEYREPEAT MOD_SYSTEM | FLG_PRIVATE | 2 #define TAG_MODIFIER MOD_SYSTEM | FLG_PRIVATE | 3 #define TAG_MOUSERELX MOD_SYSTEM | FLG_PRIVATE | 5 #define TAG_MOUSERELY MOD_SYSTEM | FLG_PRIVATE | 6 #define TAG_USERALLOWED MOD_SYSTEM | FLG_PRIVATE | FLG_STRING | 8 #define TAG_SAVECONFIG MOD_SYSTEM | 9 #define TAG_VERSION MOD_SYSTEM | FLG_STRING | 10 #define TAG_AUTORESCAN MOD_SYSTEM | 11 #define TAG_TIMEFORCMD MOD_SYSTEM | 12 #define TAG_SYSINFO MOD_SYSTEM | 13 #define TAG_CFGNAME MOD_SYSTEM | FLG_PRIVATE | FLG_STRING | 14 #define TAG_REINIT MOD_SYSTEM | 15 #define TAG_SYSINFOSLAVE MOD_SYSTEM | FLG_PRIVATE | 16 /* Pri1 tags */ #define MOD_LAPTOP 2 << 16 #define TAG_BACKLIGHTMAX MOD_LAPTOP | FLG_PRIVATE | 1 #define TAG_BACKLIGHTLEVEL MOD_LAPTOP | FLG_PRIVATE | 2 #define TAG_COVERSTATUS MOD_LAPTOP | FLG_PRIVATE | 3 #define TAG_POWERCHANGED MOD_LAPTOP | FLG_PRIVATE | 5 #define TAG_REQUESTSLEEP MOD_LAPTOP | FLG_PRIVATE | 6 #define TAG_SLEEPSUPPORTED MOD_LAPTOP | 7 #define TAG_PREPAREFORSLEEP MOD_LAPTOP | FLG_PRIVATE | 8 #define TAG_WAKEUPFROMSLEEP MOD_LAPTOP | FLG_PRIVATE | 9 #define TAG_TIMECHANGED MOD_LAPTOP | FLG_PRIVATE | 10 #define TAG_HW_BACKLIGHT MOD_LAPTOP | FLG_PRIVATE | 11 #define MOD_PMAC 3 << 16 #define TAG_PMUDEVICE MOD_PMAC | FLG_STRING | 1 #define TAG_ADBDEVICE MOD_PMAC | FLG_STRING | 2 #define TAG_TPMODEUPKEY MOD_PMAC | 3 #define TAG_TPMODEUPMOD MOD_PMAC | 4 #define TAG_TPMODEDOWNKEY MOD_PMAC | 5 #define TAG_TPMODEDOWNMOD MOD_PMAC | 6 #define TAG_TPMODE MOD_PMAC | 7 #define TAG_KBDMODE MOD_PMAC | 8 //#define TAG_REPLACEPMUD MOD_PMAC | 9 /* depreciated */ #define TAG_IDENTITY MOD_PMAC | FLG_STRING | 10 #define TAG_POWERSOURCE MOD_PMAC | 11 #define TAG_TIMEREMAINING MOD_PMAC | 12 #define TAG_AMBIENTLIGHT MOD_PMAC | 13 #define TAG_KEYBLIGHTLEVEL MOD_PMAC | FLG_PRIVATE | 14 #define TAG_KEYBLIGHTMAX MOD_PMAC | FLG_PRIVATE | 15 #define TAG_BATLOG MOD_PMAC | 16 #define TAG_BATCYCLE MOD_PMAC | 17 #define TAG_BATTERYPRESENT MOD_PMAC | 18 #define TAG_NOTAPTYPING MOD_PMAC | 19 /* Pri2 Tags */ #define MOD_DISPLAY 4 << 16 #define TAG_LCDILLUMUPKEY MOD_DISPLAY | 1 #define TAG_LCDILLUMUPMOD MOD_DISPLAY | 2 #define TAG_LCDILLUMDOWNKEY MOD_DISPLAY | 3 #define TAG_LCDILLUMDOWNMOD MOD_DISPLAY | 4 #define TAG_KBDILLUMUPKEY MOD_DISPLAY | 15 #define TAG_KBDILLUMUPMOD MOD_DISPLAY | 16 #define TAG_KBDILLUMDOWNKEY MOD_DISPLAY | 17 #define TAG_KBDILLUMDOWNMOD MOD_DISPLAY | 18 #define TAG_KBDILLUMONKEY MOD_DISPLAY | 19 #define TAG_KBDILLUMONMOD MOD_DISPLAY | 20 #define TAG_LCDAUTOADJUST MOD_DISPLAY | 12 #define TAG_BRIGHTNESS TAG_LCDBRIGHTNESS /* depreciated */ #define TAG_LCDBRIGHTNESS MOD_DISPLAY | 5 //#define TAG_LCDBRIGHTNESSMAX MOD_DISPLAY | 7 /* deprecated */ #define TAG_LCDFADINGSPEED MOD_DISPLAY | 10 #define TAG_LCDTHRESHOLD MOD_DISPLAY | 24 #define TAG_LCDAUTOADJMINBAT MOD_DISPLAY | 25 #define TAG_LCDAUTOADJMAXBAT MOD_DISPLAY | 26 #define TAG_LCDAUTOADJMINAC MOD_DISPLAY | 27 #define TAG_LCDAUTOADJMAXAC MOD_DISPLAY | 28 #define TAG_KBDAUTOADJUST MOD_DISPLAY | 13 #define TAG_KBDBRIGHTNESS MOD_DISPLAY | 21 #define TAG_KBDONBRIGHTNESS MOD_DISPLAY | 29 //#define TAG_KBDBRIGHTNESSMAX MOD_DISPLAY | 22 /* deprecated */ #define TAG_KBDFADINGSPEED MOD_DISPLAY | 23 #define TAG_KBDTHRESHOLD MOD_DISPLAY | 14 #define TAG_BRIGHTNESSOP MOD_DISPLAY | FLG_PRIVATE | 6 #define TAG_FRAMEBUFFERDEVICE MOD_DISPLAY | FLG_STRING | 8 #define TAG_BLANKFRAMEBUFFER MOD_DISPLAY | 9 #define TAG_DIMFULLYDARK MOD_DISPLAY | 11 #define TAG_CRTMIRROR MOD_DISPLAY | 30 #define TAG_CRTMIRRORKEY MOD_DISPLAY | 31 #define TAG_CRTMIRRORMOD MOD_DISPLAY | 32 #define MOD_MIXER 5 << 16 #define TAG_MIXERDEVICE MOD_MIXER | FLG_STRING | 1 #define TAG_VOLUMEUPKEY MOD_MIXER | 2 #define TAG_VOLUMEUPMOD MOD_MIXER | 3 #define TAG_VOLUMEDOWNKEY MOD_MIXER | 4 #define TAG_VOLUMEDOWNMOD MOD_MIXER | 5 #define TAG_MUTEKEY MOD_MIXER | 6 #define TAG_MUTEMOD MOD_MIXER | 7 #define TAG_MIXERINITDELAY MOD_MIXER | 8 #define TAG_VOLUME MOD_MIXER | 9 #define TAG_MUTE MOD_MIXER | 10 #define TAG_MIXERCHANNELS MOD_MIXER | FLG_STRING | 11 #define TAG_SOUNDSYSTEM MOD_MIXER | 12 #define TAG_SOUNDSYSTEMCFG MOD_MIXER | 13 #define TAG_MIXERCARD MOD_MIXER | FLG_STRING | 14 #define TAG_MIXERELEMENTS MOD_MIXER | FLG_STRING | 15 #define MOD_CDROM 6 << 16 #define TAG_CDROMDEVICE MOD_CDROM | FLG_STRING | 1 #define TAG_EJECTCDKEY MOD_CDROM | 2 #define TAG_EJECTCDMOD MOD_CDROM | 3 #define TAG_EJECTCDKEYDELAY MOD_CDROM | 4 #define TAG_EJECTCD MOD_CDROM | 5 #define MOD_POWER 7 << 16 #define TAG_SCRIPTPMCS MOD_POWER | FLG_STRING | 2 #define TAG_SLEEPKEY MOD_POWER | 7 #define TAG_SLEEPMOD MOD_POWER | 8 #define TAG_SLEEPKEYDELAY MOD_POWER | 9 #define TAG_GOTOSLEEP MOD_POWER | 10 #define TAG_BWLFIRST MOD_POWER | 11 #define TAG_BWLSECOND MOD_POWER | 12 #define TAG_BWLLAST MOD_POWER | 13 #define TAG_CURRENTBWL MOD_POWER | 14 #define TAG_SLEEPINSECONDS MOD_POWER | 15 #define TAG_CPULOADSLEEPLOCK MOD_POWER | 16 #define TAG_CPULOADMIN MOD_POWER | 17 #define TAG_CPULOADPERIOD MOD_POWER | 18 #define TAG_NETLOADSLEEPLOCK MOD_POWER | 19 #define TAG_NETLOADMIN MOD_POWER | 20 #define TAG_NETLOADPERIOD MOD_POWER | 21 #define TAG_NETLOADDEV MOD_POWER | FLG_STRING | 22 #define TAG_EMERGENCYACTION MOD_POWER | 23 #define TAG_HEARTBEATBEEP MOD_POWER | 24 #define TAG_POLICY MOD_POWER | 26 #define TAG_GOTOHIBERNATE MOD_POWER | 27 #define TAG_IBAMDATADIR MOD_POWER | FLG_STRING | 28 #define TAG_CHARGETIME MOD_POWER | 29 #define TAG_ONAC_POLICY MOD_POWER | 50 #define TAG_ONAC_TIMERACTION MOD_POWER | 51 #define TAG_ONAC_COVERACTION MOD_POWER | 52 #define TAG_ONAC_KEYACTION MOD_POWER | 53 #define TAG_ONAC_TIMESUSPEND MOD_POWER | 54 #define TAG_ONAC_TIMEDIM MOD_POWER | 55 #define TAG_ONBATT_POLICY MOD_POWER | 60 #define TAG_ONBATT_TIMERACTION MOD_POWER | 61 #define TAG_ONBATT_COVERACTION MOD_POWER | 62 #define TAG_ONBATT_KEYACTION MOD_POWER | 63 #define TAG_ONBATT_TIMESUSPEND MOD_POWER | 64 #define TAG_ONBATT_TIMEDIM MOD_POWER | 65 #endif /* INCLUDE_TAGS_H */ pbbuttonsd-0.7.9/libpbbipc/pbberrno.h0000644000175000017500000000270110224243604014541 00000000000000#ifndef INCLUDE_PBBERRNO_H #define INCLUDE_PBBERRNO_H /* ---------------------------------------------------------------------------- * errorcodes.h * definitions of errorcodes used in pbbuttonsd and its modules * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define E_OK 0 #define E_PERM 1 #define E_PRIVATE 2 #define E_NOEXIST 3 #define E_NOCHAR 4 #define E_NOBLK 5 #define E_NOFILE 6 #define E_NOLINK 7 #define E_BUFOVL 8 #define E_OPEN 9 #define E_FORMAT 10 #define E_MSGPORT 11 #define E_TWICE 12 #define E_INFO 13 #define E_NOSERVER 14 #define E_REGISTER 15 #define E_USER 16 #define E_RIGHTS 17 #define E_NOWRITE 18 #define E_NOREAD 19 #define E_CLDKILL 20 #define E_CLDEXIT 21 #define E_CLDSIG 22 #define E_NOMEM 23 #define E_NOSUPPORT 24 #define E_INVALID 25 #define E_CLDFAIL 26 #define E_OLDPORT 27 #define E_OPTEXISTS 28 #define E_NODIR 29 enum pbberrtype { PBB_ERR, PBB_WARN, PBB_INFO }; /* prototypes */ void print_error (char *msg, ...); void print_msg (enum pbberrtype type, char *msg, ...); void print_message (enum pbberrtype type, char *msg, va_list args); #endif /* INCLUDE_PBBERRNO_H */ pbbuttonsd-0.7.9/libpbbipc/pbblist.h0000644000175000017500000000243010217607264014376 00000000000000#ifndef INCLUDE_PBBLIST_H #define INCLUDE_PBBLIST_H /* ---------------------------------------------------------------------------- * pbblist.h * prototypes and definitions for double linked lists * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ struct listnode { struct listnode *next; struct listnode *pred; int datalen; /* length of buffer behind node structure */ }; struct listhead { struct listnode *first; struct listnode *tail; /* always NULL */ struct listnode *tailpred; }; /* prototypes */ void initListHeader (struct listhead *lh); void appendListNode (struct listhead *lh, struct listnode *ln); struct listnode *removeListNode (struct listnode *ln); void freeListNode (struct listnode *ln); void freeList (struct listhead *lh); struct listnode *newListNode (int datalen); void *getNodeData (struct listnode *ln); void *getNodeDataEnd (struct listnode *ln); int getNodeCount (struct listhead *lh); #endif /* INCLUDE_PBBLIST_H */ pbbuttonsd-0.7.9/pbbcmd/0000777000175000017500000000000010507757752012166 500000000000000pbbuttonsd-0.7.9/pbbcmd/Makefile.in0000644000175000017500000002103710507757752014152 00000000000000# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CXX = @CXX@ DATADIRNAME = @DATADIRNAME@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_LIB = @HAVE_LIB@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_WPRINTF = @HAVE_WPRINTF@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LIB = @LIB@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LN_S = @LN_S@ LTLIB = @LTLIB@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ PACKAGE = @PACKAGE@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ localstatedir = @localstatedir@ INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbcmd pbbcmd_SOURCES = pbbcmd.c pbbcmd.h gettext_macros.h pbbcmd_LDADD = -lpbb $(INTLLIBS) @PACKAGE_LIBS@ pbbcmd_LDFLAGS = -L$(top_srcdir)/libpbbipc @DEBUG_TRUE@AM_CFLAGS = -DDEBUG mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ pbbcmd_OBJECTS = pbbcmd.o pbbcmd_DEPENDENCIES = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(pbbcmd_SOURCES) OBJECTS = $(pbbcmd_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps pbbcmd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: pbbcmd: $(pbbcmd_OBJECTS) $(pbbcmd_DEPENDENCIES) @rm -f pbbcmd $(LINK) $(pbbcmd_LDFLAGS) $(pbbcmd_OBJECTS) $(pbbcmd_LDADD) $(LIBS) tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = pbbcmd distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done pbbcmd.o: pbbcmd.c ../config.h ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h pbbcmd.h \ ../libpbbipc/pbbtaglist.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # 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: pbbuttonsd-0.7.9/pbbcmd/Makefile.am0000644000175000017500000000052210357440017014117 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbcmd pbbcmd_SOURCES = pbbcmd.c pbbcmd.h gettext_macros.h pbbcmd_LDADD = -lpbb $(INTLLIBS) @PACKAGE_LIBS@ pbbcmd_LDFLAGS = -L$(top_srcdir)/libpbbipc if DEBUG AM_CFLAGS = -DDEBUG endif pbbuttonsd-0.7.9/pbbcmd/pbbcmd.c0000644000175000017500000003757010506736372013503 00000000000000/* ---------------------------------------------------------------------------- * pbbcmd.c * command line control tool for pbbuttonsd * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "pbbcmd.h" #define BUFFERLEN 200 int config_no_answer = 0; static struct tagtable cmdtab[] = { { "saveconfig", TAG_SAVECONFIG}, { "reinit", TAG_REINIT}, { "ejectcd", TAG_EJECTCD }, { "sleep", TAG_GOTOSLEEP }, { "hibernate", TAG_GOTOHIBERNATE }}; static struct tagtable tagtab[] = { { "TAG_AUTORESCAN", TAG_AUTORESCAN}, { "TAG_TIMEFORCMD", TAG_TIMEFORCMD}, { "TAG_VERSION", TAG_VERSION}, { "TAG_KEYCODE", TAG_KEYCODE}, { "TAG_KEYREPEAT", TAG_KEYREPEAT}, { "TAG_MODIFIER", TAG_MODIFIER}, { "TAG_MOUSERELX", TAG_MOUSERELX}, { "TAG_MOUSERELY", TAG_MOUSERELY}, { "TAG_SYSINFO", TAG_SYSINFO}, { "TAG_BACKLIGHTMAX", TAG_BACKLIGHTMAX}, { "TAG_BACKLIGHTLEVEL", TAG_BACKLIGHTLEVEL}, { "TAG_COVERSTATUS", TAG_COVERSTATUS}, { "TAG_TIMEREMAINING", TAG_TIMEREMAINING}, { "TAG_POWERSOURCE", TAG_POWERSOURCE}, { "TAG_TIMECHANGED", TAG_TIMECHANGED}, { "TAG_POWERCHANGED", TAG_POWERCHANGED}, { "TAG_REQUESTSLEEP", TAG_REQUESTSLEEP}, { "TAG_SLEEPSUPPORTED", TAG_SLEEPSUPPORTED}, { "TAG_PREPAREFORSLEEP", TAG_PREPAREFORSLEEP}, { "TAG_WAKEUPFROMSLEEP", TAG_WAKEUPFROMSLEEP}, { "TAG_PMUDEVICE", TAG_PMUDEVICE}, { "TAG_ADBDEVICE", TAG_ADBDEVICE}, { "TAG_TPMODEUPKEY", TAG_TPMODEUPKEY}, { "TAG_TPMODEUPMOD", TAG_TPMODEUPMOD}, { "TAG_TPMODEDOWNKEY", TAG_TPMODEDOWNKEY}, { "TAG_TPMODEDOWNMOD", TAG_TPMODEDOWNMOD}, { "TAG_TPMODE", TAG_TPMODE}, { "TAG_NOTAPTYPING", TAG_NOTAPTYPING}, { "TAG_KBDMODE", TAG_KBDMODE}, { "TAG_BATLOG", TAG_BATLOG}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT}, { "TAG_BATCYCLE", TAG_BATCYCLE}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT }, { "TAG_KEYBLIGHTLEVEL", TAG_KEYBLIGHTLEVEL }, { "TAG_KEYBLIGHTMAX", TAG_KEYBLIGHTMAX }, { "TAG_LCDILLUMUPKEY", TAG_LCDILLUMUPKEY}, { "TAG_LCDILLUMUPMOD", TAG_LCDILLUMUPMOD}, { "TAG_LCDILLUMDOWNKEY", TAG_LCDILLUMDOWNKEY}, { "TAG_LCDILLUMDOWNMOD", TAG_LCDILLUMDOWNMOD}, { "TAG_KBDILLUMUPKEY", TAG_KBDILLUMUPKEY}, { "TAG_KBDILLUMUPMOD", TAG_KBDILLUMUPMOD}, { "TAG_KBDILLUMDOWNKEY", TAG_KBDILLUMDOWNKEY}, { "TAG_KBDILLUMDOWNMOD", TAG_KBDILLUMDOWNMOD}, { "TAG_KBDILLUMONKEY", TAG_KBDILLUMONKEY}, { "TAG_KBDILLUMONMOD", TAG_KBDILLUMONMOD}, { "TAG_LCDBRIGHTNESS", TAG_LCDBRIGHTNESS}, { "TAG_LCDFADINGSPEED", TAG_LCDFADINGSPEED}, { "TAG_LCDAUTOADJUST", TAG_LCDAUTOADJUST }, { "TAG_LCDTHRESHOLD", TAG_LCDTHRESHOLD }, { "TAG_LCDAUTOADJMINBAT", TAG_LCDAUTOADJMINBAT }, { "TAG_LCDAUTOADJMAXBAT", TAG_LCDAUTOADJMAXBAT }, { "TAG_LCDAUTOADJMINAC", TAG_LCDAUTOADJMINAC }, { "TAG_LCDAUTOADJMAXAC", TAG_LCDAUTOADJMAXAC }, { "TAG_KBDBRIGHTNESS", TAG_KBDBRIGHTNESS}, { "TAG_KBDONBRIGHTNESS", TAG_KBDONBRIGHTNESS}, { "TAG_KBDFADINGSPEED", TAG_KBDFADINGSPEED}, { "TAG_KBDTHRESHOLD", TAG_KBDTHRESHOLD }, { "TAG_KBDAUTOADJUST", TAG_KBDAUTOADJUST }, { "TAG_BRIGHTNESSOP", TAG_BRIGHTNESSOP}, { "TAG_FRAMEBUFFERDEVICE", TAG_FRAMEBUFFERDEVICE}, { "TAG_BLANKFRAMEBUFFER", TAG_BLANKFRAMEBUFFER}, { "TAG_DIMFULLYDARK", TAG_DIMFULLYDARK}, { "TAG_CRTMIRROR", TAG_CRTMIRROR}, { "TAG_CRTMIRRORKEY", TAG_CRTMIRRORKEY}, { "TAG_CRTMIRRORMOD", TAG_CRTMIRRORMOD}, { "TAG_SOUNDSYSTEM", TAG_SOUNDSYSTEM}, { "TAG_SOUNDSYSTEMCFG", TAG_SOUNDSYSTEMCFG}, { "TAG_MIXERDEVICE", TAG_MIXERDEVICE}, { "TAG_MIXERCARD", TAG_MIXERCARD}, { "TAG_VOLUMEUPKEY", TAG_VOLUMEUPKEY}, { "TAG_VOLUMEUPMOD", TAG_VOLUMEUPMOD}, { "TAG_VOLUMEDOWNKEY", TAG_VOLUMEDOWNKEY}, { "TAG_VOLUMEDOWNMOD", TAG_VOLUMEDOWNMOD}, { "TAG_MUTEKEY", TAG_MUTEKEY}, { "TAG_MUTEMOD", TAG_MUTEMOD}, { "TAG_MIXERINITDELAY", TAG_MIXERINITDELAY}, { "TAG_VOLUME", TAG_VOLUME }, { "TAG_MUTE", TAG_MUTE }, { "TAG_MIXERCHANNELS", TAG_MIXERCHANNELS }, { "TAG_MIXERELEMENTS", TAG_MIXERELEMENTS }, { "TAG_CDROMDEVICE", TAG_CDROMDEVICE }, { "TAG_EJECTCDKEY", TAG_EJECTCDKEY }, { "TAG_EJECTCDMOD", TAG_EJECTCDMOD }, { "TAG_EJECTCDKEYDELAY", TAG_EJECTCDKEYDELAY }, { "TAG_SCRIPTPMCS", TAG_SCRIPTPMCS}, { "TAG_SLEEPKEY", TAG_SLEEPKEY }, { "TAG_SLEEPMOD", TAG_SLEEPMOD }, { "TAG_SLEEPKEYDELAY", TAG_SLEEPKEYDELAY }, { "TAG_BWLFIRST", TAG_BWLFIRST }, { "TAG_BWLSECOND", TAG_BWLSECOND }, { "TAG_BWLLAST", TAG_BWLLAST }, { "TAG_CURRENTBWL", TAG_CURRENTBWL }, { "TAG_CPULOADSLEEPLOCK", TAG_CPULOADSLEEPLOCK }, { "TAG_CPULOADMIN", TAG_CPULOADMIN }, { "TAG_CPULOADPERIOD", TAG_CPULOADPERIOD }, { "TAG_NETLOADSLEEPLOCK", TAG_NETLOADSLEEPLOCK }, { "TAG_NETLOADMIN", TAG_NETLOADMIN }, { "TAG_NETLOADPERIOD", TAG_NETLOADPERIOD }, { "TAG_NETLOADDEV", TAG_NETLOADDEV }, #ifdef WITH_IBAM { "TAG_IBAMDATADIR", TAG_IBAMDATADIR }, { "TAG_CHARGETIME", TAG_CHARGETIME }, #endif { "TAG_POLICY", TAG_POLICY }, { "TAG_ONAC_POLICY", TAG_ONAC_POLICY }, { "TAG_ONAC_TIMERACTION", TAG_ONAC_TIMERACTION }, { "TAG_ONAC_COVERACTION", TAG_ONAC_COVERACTION }, { "TAG_ONAC_KEYACTION", TAG_ONAC_KEYACTION }, { "TAG_ONAC_TIMESUSPEND", TAG_ONAC_TIMESUSPEND }, { "TAG_ONAC_TIMEDIM", TAG_ONAC_TIMEDIM }, { "TAG_ONBATT_POLICY", TAG_ONBATT_POLICY }, { "TAG_ONBATT_TIMERACTION",TAG_ONBATT_TIMERACTION }, { "TAG_ONBATT_COVERACTION",TAG_ONBATT_COVERACTION }, { "TAG_ONBATT_KEYACTION", TAG_ONBATT_KEYACTION }, { "TAG_ONBATT_TIMESUSPEND",TAG_ONBATT_TIMESUSPEND }, { "TAG_ONBATT_TIMEDIM", TAG_ONBATT_TIMEDIM }, { "TAG_EMERGENCYACTION", TAG_EMERGENCYACTION }, { "TAG_HEARTBEATBEEP", TAG_HEARTBEATBEEP }, { "TAG_IDENTITY", TAG_IDENTITY }}; static struct tagtable errortab[] = { { N_("Permission denied"), E_PERM}, { N_("Private Tag"), E_PRIVATE}, { N_("File doesn't exist"), E_NOEXIST}, { N_("File not a charakter device"),E_NOCHAR}, { N_("File not a block device"), E_NOBLK}, { N_("File not a file"), E_NOFILE}, { N_("Buffer overflow"), E_BUFOVL}, { N_("open error"), E_OPEN}, { N_("format error"), E_FORMAT}, { N_("Messageport not available"), E_MSGPORT}, { N_("Server already running"), E_TWICE}, { N_("Help or version info"), E_INFO}, { N_("Server not found"), E_NOSERVER}, { N_("Registration failed"), E_REGISTER}, { N_("Unsecure script owner"), E_USER}, { N_("Script must be write-only by owner"), E_RIGHTS}, { N_("read-only value"), E_NOWRITE}, { N_("write-only value"), E_NOREAD}, { N_("argument invalid"), E_INVALID}, { N_("function not supported"), E_NOSUPPORT}}; void print_usage (char *prgname) { printf(_("%s (version %s) - control client for pbbuttonsd.\n"), prgname, VERSION); printf(_("Usage:\n")); printf(" %s [-%s] \n", prgname, ARG_ALL); printf(" %s [-%s] query \n", prgname, ARG_ALL); printf(" %s [-%s] config \n\n", prgname, ARG_ALL); printf (_("Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n"), ARG_HELP, ARG_VERSION, ARG_IGNORE); print_cmds (); print_tags (); } void print_cmds () { printf ("\n"); printf (_("Supported commands:\n")); printf (" "); printf (_("%-14s - prints a list of clients attached\n"), "listclients"); printf (" "); printf (_("%-14s - save the current configuration to disk\n"), "saveconfig"); printf (" "); printf (_("%-14s - reinitialising the keyboard and the trackpad\n"), "reinit"); printf (" "); printf (_("%-14s - eject the CDROM\n"), "ejectcd"); printf (" "); printf (_("%-14s - suspend to RAM\n"), "sleep"); printf (" "); printf (_("%-14s - suspend to Disk\n"), "hibernate"); printf (" "); printf (_("%-14s - reconfigure server parameters\n"), "config"); printf (" "); printf (_("%-14s - queries the server for certain parameters\n"), "query"); } void print_tags () { size_t n, z; printf ("\n"); printf (_("Supported tags:\n")); printf (" "); for (n=1,z=1; n <= (sizeof(tagtab) / sizeof(struct tagtable)); n++) { if (tagtab[n-1].tag & FLG_PRIVATE) continue; else printf ("%-23s", tagtab[n-1].tagname); if ((z++ % 3) == 0) printf ("\n "); } printf ("\n\n "); printf (_("The leading 'TAG_' could be omited.\n")); } int evaluate_args(int argc, char *argv[], struct tagitem *taglist) { struct option const long_options[] = { {"help", no_argument, 0, ARG_HELP}, {"version", no_argument, 0, ARG_VERSION}, {"ignore", no_argument, 0, ARG_IGNORE}, {NULL, 0, NULL, 0} }; char *prgname; long tag; int c, n; if((prgname = strrchr(argv[0],'/')) == NULL) prgname = argv[0]; else prgname++; /* ignore first slash*/ while ((c = getopt_long (argc, argv, ARG_ALL, long_options, (int *) 0)) != EOF) { switch (c) { case ARG_VERSION: printf(_("pbbcmd, version %s"), VERSION); printf(", (c) 2002-2005 Matthias Grimm\n"); return CMD_FLAGS; case ARG_IGNORE: config_no_answer = 1; break; case ARG_HELP: default: print_usage (prgname); return CMD_FLAGS; } } if (argc - optind >= 1) { if ((strcasecmp (argv[optind], "query")) == 0) { if (argc - optind < 2) { printf (_("ERROR: Missing arguments\n")); return 0; } for (n=optind+1; n < argc; n++) { if ((tag = identifytag (argv[n])) != 0) { taglist_add (taglist, tag, (tag & FLG_STRING) ? 0 : -1); } else { printf (_("WARNING: tag %s not supported.\n"), argv[n]); print_tags (); return 0; } } return CMD_QUERY; } else if ((strcasecmp (argv[optind], "config")) == 0) { if (argc - optind < 3) { printf (_("ERROR: Missing arguments\n")); return 0; } else if ((argc - optind - 1) % 2 == 1) { printf (_("ERROR: tag/data pairs not complete.\n")); return 0; } for (n=optind+1; n < argc; n++) { if ((tag = identifytag (argv[n])) != 0) { if (tag & FLG_STRING) taglist_add (taglist, tag, (long) argv[++n]); else taglist_add (taglist, tag, (long) atoi (argv[++n])); } else { printf (_("WARNING: tag %s not supported.\n"), argv[n]); print_tags (); return 0; } } return CMD_CONFIG; } else if (strcasecmp (argv[optind], "listclients") == 0) { return CMD_LISTCLIENTS; } else if ((tag = identifycmd (argv[optind])) != 0) { taglist_add (taglist, tag, 0); return CMD_CONFIG; } } print_usage (prgname); return 0; } int read_message (char *buffer, int bufferlen) { int timeout = 40; /* 4 seconds timeout */ while (timeout > 0) { if ((ipc_receive (buffer, bufferlen)) >=0) { return 0; /* ok */ } usleep (100000); /* wait for 100ms */ timeout--; } printf (_("Server didn't send an answer and timed out.\n")); return 1; /* fail */ } long identifytag (char *name) { int n; for (n=(sizeof(tagtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (!strcasecmp (tagtab[n].tagname, name)) return tagtab[n].tag; else if (!strcasecmp ((tagtab[n].tagname) + 4, name)) return tagtab[n].tag; return 0; } long identifycmd (char *name) { int n; for (n=(sizeof(cmdtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (!strcasecmp (cmdtab[n].tagname, name)) return cmdtab[n].tag; return 0; } char * identifytagname (long tag, char *defname) { int n; for (n=(sizeof(tagtab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (tagtab[n].tag == tag) return tagtab[n].tagname; return defname; } char * identifyerror (long error, char *deferror) { int n; for (n=(sizeof(errortab) / sizeof(struct tagtable) - 1); n >= 0; n--) if (errortab[n].tag == error) return errortab[n].tagname; return deferror; } int main(int argc, char *argv[]) { char buffer[BUFFERLEN]; struct pbbmessage *pbbmsg; struct tagitem *taglist, *tags; char *tagname, *errname; int cmd, rc = 1; #ifdef ENABLE_NLS setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR); textdomain(PACKAGE); #endif init_libpbb (); if ((taglist = (struct tagitem *) malloc (argc * sizeof (struct tagitem))) != NULL) { taglist_init (taglist); if ((cmd = evaluate_args (argc, argv, taglist)) != 0) { if (ipc_init ("pbbcmd", LIBMODE_CLIENT, 0) == 0) { switch (cmd) { case CMD_FLAGS: /* for command line flags -h and -v */ rc = 0; /* they are no errors */ break; case CMD_QUERY: ipc_send (0, READVALUE, taglist); if ((rc = read_message (buffer, BUFFERLEN)) == 0) { tags = ((struct pbbmessage *) buffer)->taglist; while (tags->tag != TAG_END) { if (tags->tag & FLG_ERROR) { tagname = identifytagname (tags->tag & TAGMASK, "???"); errname = identifyerror (tags->data, "???"); printf (_("Sorry, Couldn't get data for %s: %s."), tagname, _(errname)); rc = 1; } else if (tags->tag & FLG_STRING) printf ("%s ", (char *) tags->data); else printf ("%ld ", tags->data); tags++; } printf ("\n"); } break; case CMD_CONFIG: ipc_send (0, CHANGEVALUE, taglist); if (config_no_answer) rc = 0; else if ((rc = read_message (buffer, BUFFERLEN)) == 0) { pbbmsg = (struct pbbmessage *) buffer; if (pbbmsg->action == CHANGEERROR) { tags = pbbmsg->taglist; while (tags->tag != TAG_END) { tagname = identifytagname (tags->tag & TAGMASK, "???"); errname = identifyerror (tags->data, "???"); printf (_("Setting of %s failed: %s.\n"), tagname, _(errname)); tags++; rc = 1; } } else printf (_("ERROR: Unexpected answer from server, actioncode %ld.\n"), (long) pbbmsg->action); } break; case CMD_LISTCLIENTS: ipc_send(0, GETCLIENTLIST, NULL); if ((rc = read_message (buffer, BUFFERLEN)) == 0) { pbbmsg = (struct pbbmessage *) buffer; if (pbbmsg->action == CHANGEVALUE) { printf ("\n"); printf (_(" PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n")); tags = pbbmsg->taglist; while (tags->tag != TAG_END) { switch (tags->tag) { case TAG_CLIENTPID: printf (" %5d |", (int) tags->data); break; case TAG_CLIENTNAME: printf (" %-20s |", (tags->data) ? (char*) tags->data : _("")); break; case TAG_CLIENTPORT: printf (" %7d |", (int) tags->data); break; case TAG_CLIENTFLAGS: printf (" %08x\n", (int) tags->data); break; } tags++; } printf ("\n"); } } break; } ipc_exit(); } else printf (_("ERROR: Problems with IPC, maybe server is not running.\n")); } free (taglist); } else printf (_("ERROR: Not enough memory for buffer.\n")); return rc; } void peep_ipc (struct tagitem *taglist) { } pbbuttonsd-0.7.9/pbbcmd/pbbcmd.h0000644000175000017500000000240410257041554013466 00000000000000#ifndef INCLUDE_PBBCMD_H #define INCLUDE_PBBCMD_H /* ---------------------------------------------------------------------------- * pbbcmd.h * prototypes and definitions for pbbcmd * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* short options for optarg */ #define ARG_ALL "hvi" #define ARG_HELP 'h' #define ARG_VERSION 'v' #define ARG_IGNORE 'i' #define CMD_FLAGS 1 #define CMD_QUERY 2 #define CMD_CONFIG 3 #define CMD_LISTCLIENTS 4 struct tagtable { char *tagname; long tag; }; /* public prototypes */ /* private prototypes */ void print_usage (char *prgname); void print_cmds (); void print_tags (); int evaluate_args(int argc, char *argv[], struct tagitem *taglist); int read_message (char *buffer, int bufferlen); long identifytag (char *name); long identifycmd (char *name); char *identifytagname (long tag, char *defname); char *identifyerror (long error, char *deferror); #endif /* INCLUDE_PBBCMD_H */ pbbuttonsd-0.7.9/pbbcmd/gettext_macros.h0000644000175000017500000000221710054126170015262 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.7.9/po/0000777000175000017500000000000010507757757011362 500000000000000pbbuttonsd-0.7.9/po/Makefile.in.in0000644000175000017500000002747210463223143013736 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.13 PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @echo "touch stamp-po" @echo timestamp > stamp-poT @mv stamp-poT stamp-po # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir); \ else \ cp -p $(srcdir)/$$file $(distdir); \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pbbuttonsd-0.7.9/po/remove-potcdate.sin0000644000175000017500000000066010002257175015064 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pbbuttonsd-0.7.9/po/quot.sed0000644000175000017500000000023110002257175012732 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g pbbuttonsd-0.7.9/po/boldquot.sed0000644000175000017500000000033110002257175013574 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g pbbuttonsd-0.7.9/po/en@quot.header0000644000175000017500000000226310002257175014041 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # pbbuttonsd-0.7.9/po/en@boldquot.header0000644000175000017500000000247110002257175014703 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # pbbuttonsd-0.7.9/po/insert-header.sin0000644000175000017500000000124010002257175014513 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pbbuttonsd-0.7.9/po/Rules-quot0000644000175000017500000000323110002257174013252 00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header pbbuttonsd-0.7.9/po/Makevars0000644000175000017500000000214410054126730012745 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Matthias Grimm MSGID_BUGS_ADDRESS = matthiasgrimm@users.sourceforge.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = pbbuttonsd-0.7.9/po/POTFILES.in0000644000175000017500000000067010507202711013025 00000000000000# List of source files containing translatable strings. src/init.c src/input_manager.c src/config_manager.c src/module_cdrom.c src/module_display.c src/module_mixer.c src/module_ossmixer.c src/module_alsamixer.c src/module_peep.c src/module_pmac.c src/module_powersave.c src/module_system.c src/class_backlight.c src/driver_backlight_pmu.c src/driver_backlight_sysfs.c src/pbbuttonsd.c src/support.c pbbcmd/pbbcmd.c libpbbipc/pbb_errno.c pbbuttonsd-0.7.9/po/pbbuttonsd.pot0000644000175000017500000004013510507722361014170 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Matthias Grimm # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2006-10-01 13:22+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/init.c:240 #, c-format msgid "%s, version %s" msgstr "" #: src/init.c:254 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" #: src/init.c:260 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" #: src/init.c:261 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "" #: src/init.c:262 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" #: src/init.c:342 msgid "Not all signal handlers could be installed.\n" msgstr "" #: src/init.c:344 msgid "Can't install any signal handler\n" msgstr "" #: src/init.c:358 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "" #: src/init.c:361 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "" #: src/init.c:364 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" #: src/input_manager.c:176 msgid "No event devices available. Please check your configuration.\n" msgstr "" #: src/config_manager.c:233 #, c-format msgid "Couldn't read configfile [%s, %s], using defaults.\n" msgstr "" #: src/config_manager.c:239 #, c-format msgid "Couldn't read configfile [%s, out of memory], using defaults.\n" msgstr "" #: src/config_manager.c:400 #, c-format msgid "Couldn't write configfile [%s, out of memory].\n" msgstr "" #: src/config_manager.c:415 msgid "" "# Configuration file for pbbuttonsd >= version 0.5\n" "# for options see man pbbuttonsd.conf\n" msgstr "" #: src/module_cdrom.c:60 src/module_display.c:80 src/module_mixer.c:51 #: src/module_ossmixer.c:83 src/module_alsamixer.c:73 src/module_pmac.c:108 #: src/module_powersave.c:114 src/module_system.c:49 #, c-format msgid "Can't register configuration section %s, out of memory." msgstr "" #: src/module_cdrom.c:85 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" #: src/module_cdrom.c:359 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "" #: src/module_display.c:84 msgid "initial LCD brightness level in percent" msgstr "" #: src/module_display.c:86 src/module_display.c:108 msgid "0 = no smooth fading" msgstr "" #: src/module_display.c:88 src/module_display.c:110 msgid "only on Aluminum PowerBooks" msgstr "" #: src/module_display.c:94 msgid "ambient light threshold in percent for backlight autoadj." msgstr "" #: src/module_display.c:96 msgid "autoadjustment range parameters" msgstr "" #: src/module_display.c:104 msgid "initial keyboard illumination level in percent" msgstr "" #: src/module_display.c:106 msgid "initial level in percent if KBD on/off key is pressed" msgstr "" #: src/module_display.c:118 msgid "ambient light threshold in percent for keyboard light autoadj." msgstr "" #: src/module_display.c:882 src/module_display.c:929 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "'" msgstr "" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "', '" msgstr "" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "' or '" msgstr "" #: src/module_mixer.c:79 msgid "" "MixerInitDelay is not possible with automatic mixer detection; option " "disabled.\n" msgstr "" #: src/module_mixer.c:125 #, c-format msgid "Soundsystem requested: %s, detected: %s and at least activated: %s.\n" msgstr "" #: src/module_mixer.c:128 #, c-format msgid "Soundsystem requested: %s and at least activated: %s.\n" msgstr "" #: src/module_ossmixer.c:98 src/module_alsamixer.c:86 msgid "initial volume level" msgstr "" #: src/module_ossmixer.c:100 src/module_alsamixer.c:88 msgid "mute after startup?" msgstr "" #: src/module_ossmixer.c:155 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" #: src/module_ossmixer.c:161 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "" #: src/module_ossmixer.c:164 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "" #: src/module_alsamixer.c:138 msgid "Memory allocation failed.\n" msgstr "" #: src/module_alsamixer.c:153 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "" #: src/module_alsamixer.c:165 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "" #: src/module_alsamixer.c:172 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "" #: src/module_alsamixer.c:193 #, c-format msgid "Memory allocation failed: %s\n" msgstr "" #: src/module_alsamixer.c:211 #, c-format msgid "Can't open card '%s': %s\n" msgstr "" #: src/module_alsamixer.c:215 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "" #: src/module_alsamixer.c:220 #, c-format msgid "Can't register mixer: %s\n" msgstr "" #: src/module_alsamixer.c:227 #, c-format msgid "Can't load card '%s': %s\n" msgstr "" #: src/module_alsamixer.c:367 msgid "ALSA Card name too long. Buffer overflow\n" msgstr "" #: src/module_alsamixer.c:380 msgid "Too much ALSA elements given. Buffer overflow.\n" msgstr "" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:166 msgid "Permission denied" msgstr "" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:167 msgid "Private Tag" msgstr "" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:168 msgid "File doesn't exist" msgstr "" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:169 msgid "File not a charakter device" msgstr "" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:170 msgid "File not a block device" msgstr "" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:171 msgid "File not a file" msgstr "" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:172 msgid "Buffer overflow" msgstr "" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:173 msgid "open error" msgstr "" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:174 msgid "format error" msgstr "" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:175 msgid "Messageport not available" msgstr "" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:176 msgid "Server already running" msgstr "" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:177 msgid "Help or version info" msgstr "" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:180 msgid "Unsecure script owner" msgstr "" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:181 msgid "Script must be write-only by owner" msgstr "" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:182 msgid "read-only value" msgstr "" #: src/module_peep.c:188 pbbcmd/pbbcmd.c:183 msgid "write-only value" msgstr "" #: src/module_peep.c:189 pbbcmd/pbbcmd.c:184 msgid "argument invalid" msgstr "" #: src/module_peep.c:190 pbbcmd/pbbcmd.c:185 msgid "function not supported" msgstr "" #: src/module_peep.c:362 msgid "unknown tag" msgstr "" #: src/module_pmac.c:129 msgid "switch trackpad to 'notap-mode' while typing" msgstr "" #: src/module_pmac.c:169 msgid "pmud support compiled in and active.\n" msgstr "" #: src/module_pmac.c:175 src/driver_backlight_pmu.c:102 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "" #: src/module_pmac.c:183 src/driver_backlight_pmu.c:113 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "" #: src/module_pmac.c:209 msgid "LMU found, ambient light sensor and keyboard illumination active.\n" msgstr "" #: src/module_pmac.c:247 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" #: src/module_pmac.c:455 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" #: src/module_pmac.c:708 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" #: src/module_pmac.c:1394 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "" #: src/module_pmac.c:1589 msgid "Unknown PowerBook" msgstr "" #: src/module_pmac.c:1673 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "" #: src/module_powersave.c:124 src/module_powersave.c:141 msgid "see TimerAction for possible values" msgstr "" #: src/module_powersave.c:127 src/module_powersave.c:144 msgid "Action (see TimerAction) for the sleepkey" msgstr "" #: src/module_powersave.c:154 msgid "values > 0 may be dangerous, if the power key is used to trigger sleep" msgstr "" #: src/module_powersave.c:156 msgid "first battery warnlevel, time in minutes" msgstr "" #: src/module_powersave.c:158 msgid "second battery warnlevel, time in minutes" msgstr "" #: src/module_powersave.c:160 msgid "last battery warnlevel, time in minutes" msgstr "" #: src/module_powersave.c:164 msgid "action, if battery is critically low" msgstr "" #: src/module_powersave.c:167 msgid "beep, if nothing else showed that the computer lives" msgstr "" #: src/module_powersave.c:171 msgid "value in percent" msgstr "" #: src/module_powersave.c:173 src/module_powersave.c:179 msgid "time in seconds" msgstr "" #: src/module_powersave.c:177 msgid "traffic in Bytes/s" msgstr "" #: src/module_powersave.c:258 msgid "Can't create IBaM object, out of memory.\n" msgstr "" #: src/module_powersave.c:386 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "" #: src/module_system.c:53 msgid "user who is allowed to use IPC" msgstr "" #: src/module_system.c:55 msgid "automatic rescan of event devices" msgstr "" #: src/module_system.c:57 msgid "timeout in seconds for launched scripts, etc." msgstr "" #: src/module_system.c:201 #, c-format msgid "config file [%s] is insecure, saving of config disabled.\n" msgstr "" #: src/module_system.c:203 #, c-format msgid "config file [%s] is not writable, saving of config disabled.\n" msgstr "" #: src/module_system.c:206 #, c-format msgid "saving of config enabled to %s.\n" msgstr "" #: src/class_backlight.c:52 #, c-format msgid "Initialized: %s\n" msgstr "" #: src/class_backlight.c:54 msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" #: src/driver_backlight_pmu.c:85 msgid "PMU Backlight Driver" msgstr "" #: src/driver_backlight_sysfs.c:119 msgid "SysFS Backlight Driver" msgstr "" #: src/support.c:60 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "" #: src/support.c:63 #, c-format msgid "The object '%s' is not a file.\n" msgstr "" #: src/support.c:66 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "" #: src/support.c:69 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "" #: src/support.c:72 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "" #: src/support.c:75 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "" #: src/support.c:78 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" #: src/support.c:81 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" #: src/support.c:89 #, c-format msgid "Path of '%s' is to long.\n" msgstr "" #: src/support.c:154 #, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "" #: src/support.c:177 #, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "" #: src/support.c:179 #, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "" #: src/support.c:181 #, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "" #: src/support.c:221 #, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "" #: src/support.c:225 #, c-format msgid "Script '%s' doesn't exist.\n" msgstr "" #: src/support.c:227 #, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "" #: src/support.c:254 msgid "launched and exited normally" msgstr "" #: src/support.c:257 msgid "doesn't exist" msgstr "" #: src/support.c:262 msgid "skipped because it's not secure" msgstr "" #: src/support.c:265 #, c-format msgid "lauched but killed after %d seconds" msgstr "" #: src/support.c:269 msgid "lauched but exitcode is not null" msgstr "" #: src/support.c:272 msgid "can't be launched - fork() failed" msgstr "" #: src/support.c:275 msgid "lauched but exited by signal" msgstr "" #: src/support.c:278 msgid "failed - unknown error code" msgstr "" #: src/support.c:280 #, c-format msgid "Script '%s' %s\n" msgstr "" #: pbbcmd/pbbcmd.c:178 msgid "Server not found" msgstr "" #: pbbcmd/pbbcmd.c:179 msgid "Registration failed" msgstr "" #: pbbcmd/pbbcmd.c:190 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "" #: pbbcmd/pbbcmd.c:191 #, c-format msgid "Usage:\n" msgstr "" #: pbbcmd/pbbcmd.c:195 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" #: pbbcmd/pbbcmd.c:208 #, c-format msgid "Supported commands:\n" msgstr "" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "" #: pbbcmd/pbbcmd.c:233 #, c-format msgid "Supported tags:\n" msgstr "" #: pbbcmd/pbbcmd.c:244 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "" #: pbbcmd/pbbcmd.c:267 #, c-format msgid "pbbcmd, version %s" msgstr "" #: pbbcmd/pbbcmd.c:283 pbbcmd/pbbcmd.c:299 #, c-format msgid "ERROR: Missing arguments\n" msgstr "" #: pbbcmd/pbbcmd.c:290 pbbcmd/pbbcmd.c:312 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "" #: pbbcmd/pbbcmd.c:302 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "" #: pbbcmd/pbbcmd.c:343 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "" #: pbbcmd/pbbcmd.c:425 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "" #: pbbcmd/pbbcmd.c:447 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "" #: pbbcmd/pbbcmd.c:452 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "" #: pbbcmd/pbbcmd.c:461 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" #: pbbcmd/pbbcmd.c:471 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:489 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "" #: pbbcmd/pbbcmd.c:493 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "" pbbuttonsd-0.7.9/po/stamp-po0000644000175000017500000000001210507722363012733 00000000000000timestamp pbbuttonsd-0.7.9/po/de.po0000644000175000017500000005712310507722573012222 00000000000000# German Translations for pbbuttonsd and gtkpbbuttons. # Copyright (C) 2002 Free Software Foundation, Inc. # Matthias Grimm , 2002. # msgid "" msgstr "" "Project-Id-Version: pbbuttons 0.6.8\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2006-10-01 13:22+0200\n" "PO-Revision-Date: 2006-10-01 13:24+0100\n" "Last-Translator: Matthias Grimm \n" "Language-Team: german\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" #: src/init.c:240 #, c-format msgid "%s, version %s" msgstr "%s, Version %s" #: src/init.c:254 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "FEHLER: Problem beim Lesen der Konfigdatei [%s]: %s.\n" #: src/init.c:260 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "%s - Daemon zur Nutzung spezieller Laptop und Notebook Fähigkeiten\n" #: src/init.c:261 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Benutzung: %s [Optionen]... \n" #: src/init.c:262 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Optionen:\n" " -%c, --help zeigt die Hilfe\n" " -%c, --version zeigt die Programmverion an\n" " -%c, --quiet unterdrückt die Startmeldung\n" " -%c, --detach[=PIDFILE] startet %s als Hintergrundprozess und\n" " verwendet ggf. eine alternative PID-Datei\n" " (Default: %s)\n" " -%c, --configfile=CONFIG benutze alternative Konfigurationsdatei\n" " (Default: %s)\n" "Siehe Konfigurationsdatei für weitere Optionen.\n" #: src/init.c:342 msgid "Not all signal handlers could be installed.\n" msgstr "Nicht alle Signal-Handler konnten installiert werden.\n" #: src/init.c:344 msgid "Can't install any signal handler\n" msgstr "Kann keinen Signalhandler installieren.\n" #: src/init.c:358 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "Kann den Messageport für den Server nicht anlegen: %s\n" #: src/init.c:361 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "Der Server darf nur einmal gestartet werden.\n" #: src/init.c:364 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "Verwaisten Serverport gelöscht. Alle laufenden Clients müssen neu gestartet " "werden.\n" #: src/input_manager.c:176 msgid "No event devices available. Please check your configuration.\n" msgstr "" "Kein Event Device verfügbar, bitte prüfen Sie Ihre Systemkonfiguration\n" #: src/config_manager.c:233 #, c-format msgid "Couldn't read configfile [%s, %s], using defaults.\n" msgstr "Kann Konfigdatei [%s, %s] nicht lesen, benutze Standardwerte.\n" #: src/config_manager.c:239 #, c-format msgid "Couldn't read configfile [%s, out of memory], using defaults.\n" msgstr "Zu wenig Speicher für die Konfigdatei [%s], benutze Standardwerte.\n" #: src/config_manager.c:400 #, c-format msgid "Couldn't write configfile [%s, out of memory].\n" msgstr "Kann Konfigdatei nicht speichern [%s, kein Speicher].\n" #: src/config_manager.c:415 msgid "" "# Configuration file for pbbuttonsd >= version 0.5\n" "# for options see man pbbuttonsd.conf\n" msgstr "" "# Konfigurationsdatei für PBButtonsd >= Version 0.5\n" "# für Liste der Optionen siehe pbbuttonsd.conf man-page\n" #: src/module_cdrom.c:60 src/module_display.c:80 src/module_mixer.c:51 #: src/module_ossmixer.c:83 src/module_alsamixer.c:73 src/module_pmac.c:108 #: src/module_powersave.c:114 src/module_system.c:49 #, c-format msgid "Can't register configuration section %s, out of memory." msgstr "Kann Konfigurationssektion %s nicht registrieren, zu wenig Speicher." #: src/module_cdrom.c:85 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" "Bitte überprüfen Sie ihre CDROM Einstellungen in der Konfigurationsdatei\n" #: src/module_cdrom.c:359 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "Kann %s nicht öffnen. Auswerfen der CDROM wird nicht funktionieren.\n" #: src/module_display.c:84 msgid "initial LCD brightness level in percent" msgstr "Anfangshelligkeit des Displays in Prozent" #: src/module_display.c:86 src/module_display.c:108 msgid "0 = no smooth fading" msgstr "0 = kein sanftes Abblenden" #: src/module_display.c:88 src/module_display.c:110 msgid "only on Aluminum PowerBooks" msgstr "derzeit nur bei Aluminium PowerBooks" #: src/module_display.c:94 msgid "ambient light threshold in percent for backlight autoadj." msgstr "Schwelle für Umgebungslicht in Prozent." #: src/module_display.c:96 msgid "autoadjustment range parameters" msgstr "Arbeitsbereich der automatischen Regelung" #: src/module_display.c:104 msgid "initial keyboard illumination level in percent" msgstr "Anfangshelligkeit der Tastaturbeleuchtung in Prozent" #: src/module_display.c:106 msgid "initial level in percent if KBD on/off key is pressed" msgstr "Startwert in Prozent für KBD ein/aus Taster." #: src/module_display.c:118 msgid "ambient light threshold in percent for keyboard light autoadj." msgstr "Schwelle für Umgebungslicht in Prozent." #: src/module_display.c:882 src/module_display.c:929 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "Kann Framebuffer Device '%s' nicht öffnen.\n" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "'" msgstr "'" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "', '" msgstr "', '" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "' or '" msgstr "' oder '" #: src/module_mixer.c:79 msgid "" "MixerInitDelay is not possible with automatic mixer detection; option " "disabled.\n" msgstr "" "MixerInitDelay ist bei automatischer Mixererkennung nicht möglich; Option " "gelöscht.\n" #: src/module_mixer.c:125 #, c-format msgid "Soundsystem requested: %s, detected: %s and at least activated: %s.\n" msgstr "" "Soundsystem angefordert: %s, erkannt: %s und letztlich aktiviert: %s.\n" #: src/module_mixer.c:128 #, c-format msgid "Soundsystem requested: %s and at least activated: %s.\n" msgstr "Soundsystem angefordert: %s und letztlich aktiviert: %s.\n" #: src/module_ossmixer.c:98 src/module_alsamixer.c:86 msgid "initial volume level" msgstr "Anfangslautstärke der Lautsprecher" #: src/module_ossmixer.c:100 src/module_alsamixer.c:88 msgid "mute after startup?" msgstr "Anfangszustand Stumm?" #: src/module_ossmixer.c:155 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "Kann verfügbare Kanäle des Mixer [%s] nicht ermitteln, benutze " "Standardwerte.\n" #: src/module_ossmixer.c:161 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "Kann Lautstärke des Masterkanals [%s] nicht ermitteln.\n" #: src/module_ossmixer.c:164 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "Kann Mixer [%s] nicht öffnen: %s\n" #: src/module_alsamixer.c:138 msgid "Memory allocation failed.\n" msgstr "Speicheranforderung fehlgeschlagen.\n" #: src/module_alsamixer.c:153 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "Card '%s' hat kein Element mit Namen '%s'.\n" #: src/module_alsamixer.c:165 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "Option 'ALSA_Elements' enthält keine gültigen Elemente.\n" #: src/module_alsamixer.c:172 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "Mixer Element '%s' hat keine Lautstärke-Eigenschaft.\n" #: src/module_alsamixer.c:193 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Speicheranforderung fehlgeschlagen: %s.\n" #: src/module_alsamixer.c:211 #, c-format msgid "Can't open card '%s': %s\n" msgstr "Kann Card '%s' nicht öffnen: %s\n" #: src/module_alsamixer.c:215 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "Kann Card '%s' nicht hinzufügen: %s.\n" #: src/module_alsamixer.c:220 #, c-format msgid "Can't register mixer: %s\n" msgstr "Kann Mixer nicht registrieren: %s.\n" #: src/module_alsamixer.c:227 #, c-format msgid "Can't load card '%s': %s\n" msgstr "Kann Card '%s' nicht laden: %s.\n" #: src/module_alsamixer.c:367 msgid "ALSA Card name too long. Buffer overflow\n" msgstr "ALSA Card Name zu lang, Bufferüberlauf.\n" #: src/module_alsamixer.c:380 msgid "Too much ALSA elements given. Buffer overflow.\n" msgstr "Zu viele ALSA Elemente angegeben, Bufferüberlauf.\n" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:166 msgid "Permission denied" msgstr "Zugriff verweigert" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:167 msgid "Private Tag" msgstr "Privater Tag" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:168 msgid "File doesn't exist" msgstr "Datei existiert nicht" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:169 msgid "File not a charakter device" msgstr "Die Datei ist kein Zeichengerät" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:170 msgid "File not a block device" msgstr "Die Datei ist kein Blockgerät" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:171 msgid "File not a file" msgstr "Die Datei ist keine Datei" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:172 msgid "Buffer overflow" msgstr "Buffer übergelaufen" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:173 msgid "open error" msgstr "Fehler beim Öffnen" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:174 msgid "format error" msgstr "Fehler im Format" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:175 msgid "Messageport not available" msgstr "Messageport nicht verfügbar" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:176 msgid "Server already running" msgstr "Server läuft bereits" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:177 msgid "Help or version info" msgstr "Hilfe oder Versionsinformationen" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:180 msgid "Unsecure script owner" msgstr "Besitzer des Scripts unsicher" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:181 msgid "Script must be write-only by owner" msgstr "Script darf nur vom Besitzer schreibbar sein." #: src/module_peep.c:187 pbbcmd/pbbcmd.c:182 msgid "read-only value" msgstr "Wert kann nur gelesen werden" #: src/module_peep.c:188 pbbcmd/pbbcmd.c:183 msgid "write-only value" msgstr "Wert kann nur geschrieben werden" #: src/module_peep.c:189 pbbcmd/pbbcmd.c:184 msgid "argument invalid" msgstr "Ungültiges Argument" #: src/module_peep.c:190 pbbcmd/pbbcmd.c:185 msgid "function not supported" msgstr "Funktion nicht unterstützt" #: src/module_peep.c:362 msgid "unknown tag" msgstr "Unbekannter Tag" #: src/module_pmac.c:129 msgid "switch trackpad to 'notap-mode' while typing" msgstr "schaltet das Trackpad in 'notap'-Modus während des Schreibens." #: src/module_pmac.c:169 msgid "pmud support compiled in and active.\n" msgstr "Pmud Unterstützung vorhanden und aktiviert.\n" #: src/module_pmac.c:175 src/driver_backlight_pmu.c:102 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "Kann PMU Device [%s] nicht öffnen: %s\n" #: src/module_pmac.c:183 src/driver_backlight_pmu.c:113 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "Kann ADB Device [%s] nicht öffnen: %s\n" #: src/module_pmac.c:209 msgid "LMU found, ambient light sensor and keyboard illumination active.\n" msgstr "LMU gefunden, Umgebungslichtsensor und Tastaturbeleuchtung aktiv.\n" #: src/module_pmac.c:247 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "Kann PMU Inputhandler nicht installieren. Einige Funktionen werden nicht " "gehen.\n" #: src/module_pmac.c:455 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" "Die Taste Fn kann auf ADB Tastaturen nicht abgeschaltet werden, erzwinge " "Modus 'fkeyslast'.\n" #: src/module_pmac.c:708 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "Kann pmud nicht finden. Schalte in den Replacement Mode.\n" #: src/module_pmac.c:1394 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "Kann auf I2C Gerät %s nicht zugreifen - %s.\n" #: src/module_pmac.c:1589 msgid "Unknown PowerBook" msgstr "Unbekanntes PowerBook" #: src/module_pmac.c:1673 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "Aktueller Batteriezyklus: %d, aktive Logdatei: %s.\n" #: src/module_powersave.c:124 src/module_powersave.c:141 msgid "see TimerAction for possible values" msgstr "siehe TimerAction für mögliche Werte" #: src/module_powersave.c:127 src/module_powersave.c:144 msgid "Action (see TimerAction) for the sleepkey" msgstr "Aktion (siehe TimerAction) für die Schlaftaste" #: src/module_powersave.c:154 msgid "values > 0 may be dangerous, if the power key is used to trigger sleep" msgstr "" "Werte >0 sind gefährlich, wenn der Powerknopf als Einschlafftaste benutzt " "wird" #: src/module_powersave.c:156 msgid "first battery warnlevel, time in minutes" msgstr "Erste Batterie Warnstufe, Zeit in Minuten" #: src/module_powersave.c:158 msgid "second battery warnlevel, time in minutes" msgstr "Zweite Batterie Warnstufe, Zeit in Minuten" #: src/module_powersave.c:160 msgid "last battery warnlevel, time in minutes" msgstr "Letzte Batterie Warnstufe, Zeit in Minuten" #: src/module_powersave.c:164 msgid "action, if battery is critically low" msgstr "Vorgehen bei leerer Batterie" #: src/module_powersave.c:167 msgid "beep, if nothing else showed that the computer lives" msgstr "Piepe, wenn nichts anderes anzeigt, das der Rechner lebt" #: src/module_powersave.c:171 msgid "value in percent" msgstr "Wert in Prozent" #: src/module_powersave.c:173 src/module_powersave.c:179 msgid "time in seconds" msgstr "Zeit in Sekunden" #: src/module_powersave.c:177 msgid "traffic in Bytes/s" msgstr "Bandbreite in Bytes/s" #: src/module_powersave.c:258 msgid "Can't create IBaM object, out of memory.\n" msgstr "Kann IBaM Objekt nicht erzeugen, zu wenig Speicher.\n" #: src/module_powersave.c:386 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "Zu viele Formatzeichen. Max. drei %%s in TAG_SCRIPTPMCS erlaubt.\n" #: src/module_system.c:53 msgid "user who is allowed to use IPC" msgstr "Benutzer, der die IPC Services nutzen darf" #: src/module_system.c:55 msgid "automatic rescan of event devices" msgstr "Automatische Erfassung zus. Tastaturen" #: src/module_system.c:57 msgid "timeout in seconds for launched scripts, etc." msgstr "Zeit in Sekunden, die Scripten zur Verfügung steht." #: src/module_system.c:201 #, c-format msgid "config file [%s] is insecure, saving of config disabled.\n" msgstr "Konfigdatei [%s] ist unsicher; speichern der Konfig gesperrt.\n" #: src/module_system.c:203 #, c-format msgid "config file [%s] is not writable, saving of config disabled.\n" msgstr "Konfigdatei [%s] nicht schreibbar; speichern der Konfig gesperrt.\n" #: src/module_system.c:206 #, c-format msgid "saving of config enabled to %s.\n" msgstr "Speichern der Konfig auf %s freigegeben.\n" #: src/class_backlight.c:52 #, c-format msgid "Initialized: %s\n" msgstr "Aktiviert: %s\n" #: src/class_backlight.c:54 msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "Kein Treiber für die Hintergrundbeleuchtung verfügbar, bitte prüfen Sie Ihre " "Kernelkonfiguration.\n" #: src/driver_backlight_pmu.c:85 msgid "PMU Backlight Driver" msgstr "PMU Treiber für LCD Hintergrundbeleuchtung" #: src/driver_backlight_sysfs.c:119 msgid "SysFS Backlight Driver" msgstr "SysFS Treiber für LCD Hintergrundbeleuchtung" #: src/support.c:60 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "Das Objekt '%s' existiert nicht.\n" #: src/support.c:63 #, c-format msgid "The object '%s' is not a file.\n" msgstr "Das Objekt '%s' ist keine Datei.\n" #: src/support.c:66 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "Das Objekt '%s' ist kein Verzeichnis.\n" #: src/support.c:69 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "Das Objekt '%s' ist kein zeichenorientiertes Gerät.\n" #: src/support.c:72 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "Das Object '%s' ist kein blockorientiertes Gerät.\n" #: src/support.c:75 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "" "SICHERHEIT: Der Besitzer von %s und PBButtonsd müssen identisch sein.\n" #: src/support.c:78 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" "SICHERHEIT: %s darf nur durch den Besitzer von PBButtonsd schreibbar sein.\n" #: src/support.c:81 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" "Zugriffsrechte für Objekt %s reichen nicht aus, benötige mindestens '0%o'.\n" #: src/support.c:89 #, c-format msgid "Path of '%s' is to long.\n" msgstr "Der Pfad von '%s' ist zu lang.\n" #: src/support.c:154 #, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "Script '%s' gestartet, aber nach %d Sekunden abgebrochen.\n" #: src/support.c:177 #, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "Script '%s' gestartet, aber mit Fehlercode %d beendet.\n" #: src/support.c:179 #, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "Script '%s' gestartet und normal beendet.\n" #: src/support.c:181 #, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "Script '%s' gestartet, aber durch ein Signal beendet.\n" #: src/support.c:221 #, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "Script '%s' nicht ausgeführt - fork() ist fehlgeschlagen.\n" #: src/support.c:225 #, c-format msgid "Script '%s' doesn't exist.\n" msgstr "Script '%s' existiert nicht.\n" #: src/support.c:227 #, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "Script '%s' übergangen weil nicht sicher.\n" #: src/support.c:254 msgid "launched and exited normally" msgstr "gestartet und normal beendet" #: src/support.c:257 msgid "doesn't exist" msgstr "existiert nicht" #: src/support.c:262 msgid "skipped because it's not secure" msgstr "übergangen weil nicht sicher" #: src/support.c:265 #, c-format msgid "lauched but killed after %d seconds" msgstr "gestartet, aber nach %d Sekunden abgebrochen" #: src/support.c:269 msgid "lauched but exitcode is not null" msgstr "gestartet, aber der Exitcode ist nicht Null" #: src/support.c:272 msgid "can't be launched - fork() failed" msgstr "nicht ausgeführt - fork() ist fehlgeschlagen" #: src/support.c:275 msgid "lauched but exited by signal" msgstr "gestartet, aber beendet durch ein Signal" #: src/support.c:278 msgid "failed - unknown error code" msgstr "fehlgeschlagen - unbekannter Fehlercode" #: src/support.c:280 #, c-format msgid "Script '%s' %s\n" msgstr "Script '%s' %s\n" #: pbbcmd/pbbcmd.c:178 msgid "Server not found" msgstr "Server nicht gefunden" #: pbbcmd/pbbcmd.c:179 msgid "Registration failed" msgstr "Registrierung fehlgeschlagen" #: pbbcmd/pbbcmd.c:190 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (version %s) - Steuerungsprogramm für PBButtonsd.\n" #: pbbcmd/pbbcmd.c:191 #, c-format msgid "Usage:\n" msgstr "Benutzung:\n" #: pbbcmd/pbbcmd.c:195 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Optionen:\n" " -%c, --help zeigt die Kurzhilfe an\n" " -%c, --version zeigt Versionsinformationen an\n" " -%c, --ignore ignoriere 'config'-Rückgabewerte und " "Fehlermeldungen\n" #: pbbcmd/pbbcmd.c:208 #, c-format msgid "Supported commands:\n" msgstr "Unterstützte Befehle:\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - gibt eine Liste der angemeldeten Klienten aus\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - speichert die aktuelle Konfiguration auf Festplatte\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - Reinitialisiert die Tastatur und das Trackpad\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - wirft die CDROM aus\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - legt die Maschine schlafen\n" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "" "%-14s - sichert den Systemzustand auf Festplatte und schaltet den Rechner " "aus\n" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - verändern von Serverparametern\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - Afragen von Serverparametern\n" #: pbbcmd/pbbcmd.c:233 #, c-format msgid "Supported tags:\n" msgstr "Unterstützte Tags:\n" #: pbbcmd/pbbcmd.c:244 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "Das führende 'TAG_' kann weggelassen werden.\n" #: pbbcmd/pbbcmd.c:267 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, Version %s" #: pbbcmd/pbbcmd.c:283 pbbcmd/pbbcmd.c:299 #, c-format msgid "ERROR: Missing arguments\n" msgstr "FEHLER: Argumente fehlen.\n" #: pbbcmd/pbbcmd.c:290 pbbcmd/pbbcmd.c:312 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "WARNUNG: Tag %s wird nicht unterstützt.\n" #: pbbcmd/pbbcmd.c:302 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "FEHLER: Tag und Daten müssen immer paarweise auftreten\n" #: pbbcmd/pbbcmd.c:343 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "Der Server antwortete nicht, Timeout.\n" #: pbbcmd/pbbcmd.c:425 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "Kann Daten für %s nicht bekommen: %s." #: pbbcmd/pbbcmd.c:447 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "Setzen von %s fehlgeschlagen: %s.\n" #: pbbcmd/pbbcmd.c:452 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "FEHLER: Unerwartete Antwort vom Server, Actioncode %ld.\n" #: pbbcmd/pbbcmd.c:461 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Name | Port | Schalter\n" " ------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:471 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:489 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "FEHLER: IPC Problem, wahrscheinlich läuft der Server nicht.\n" #: pbbcmd/pbbcmd.c:493 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "FEHLER: Zu wenig Speicher für Buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "FEHLER" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "WARNUNG" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFO" #~ msgid "Wow, later than an Alluminum PB! ;-)" #~ msgstr "Wow, neuer als ein Aluminium PB! ;-)" pbbuttonsd-0.7.9/po/ca.po0000644000175000017500000006046510507722362012214 00000000000000# translation of ca.po to català # translation of ca.po_[IUVWxb].po to # translation of ca.po_[IUVWxb].po to # translation of pbbuttonsd.po to Catalan # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR Matthias Grimm. # David Riera , 2004. # Oriol Pellicer , 2004. # Oriol Pellicer i Sabrià , 2005. # msgid "" msgstr "" "Project-Id-Version: ca\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2006-10-01 13:22+0200\n" "PO-Revision-Date: 2005-07-04 11:30+0200\n" "Last-Translator: Oriol Pellicer i Sabrià \n" "Language-Team: català \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.10\n" #: src/init.c:240 #, c-format msgid "%s, version %s" msgstr "%s, versió %s" #: src/init.c:254 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" "ERROR: S'han trobat problemes llegint l'arxiu de configuració [%s]: %s\n" #: src/init.c:260 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" "%s - dimoni per al suport de característiques especials en ordinadors " "portàtils.\n" #: src/init.c:261 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Utilització: %s[OPCIÓ]... \n" #: src/init.c:262 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Opcions:\n" " -%c, --help mostra aquest text i surt\n" " -%c, --version mostra informació sobre la versió i surt\n" " -%c, --quiet elimina els missatges de benvinguda\n" " -%c, --detach[=PIDFILE] inicia %s com a procés en segon pla i\n" " opcionalment utilitza un arxiu identificador " "alternatiu\n" " (per defecte: %s)\n" " -%c, --configfile=CONFIG utilitza un arxiu de configuració alternatiu\n" " (per defecte: %s)\n" "per a més opcions consulta l'arxiu de configuració.\n" #: src/init.c:342 msgid "Not all signal handlers could be installed.\n" msgstr "" #: src/init.c:344 #, fuzzy msgid "Can't install any signal handler\n" msgstr "No es pot instal·lar l'ajudant de senyal\n" #: src/init.c:358 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "No es pot crear el port de missatges pel servidor. %s.\n" #: src/init.c:361 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "El servidor ja està funcionant. Només es permet una instància.\n" #: src/init.c:364 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "S'ha eliminat un \"orphaned server port\". S'han de reiniciar tots els " "clients.\n" #: src/input_manager.c:176 msgid "No event devices available. Please check your configuration.\n" msgstr "" "No hi ha disponible cap dispositiu d'events. Comprova la configuració.\n" #: src/config_manager.c:233 #, c-format msgid "Couldn't read configfile [%s, %s], using defaults.\n" msgstr "" "No es pot llegir l'arxiu de configuració [%s, %s], utilitzant valors per " "defecte.\n" #: src/config_manager.c:239 #, c-format msgid "Couldn't read configfile [%s, out of memory], using defaults.\n" msgstr "" "No es pot llegir l'arxiu de configuració [%s, fora de memòria] utilitzant " "valors per defecte.\n" #: src/config_manager.c:400 #, c-format msgid "Couldn't write configfile [%s, out of memory].\n" msgstr "No es pot escriure l'arxiu de configuració [%s, fora de memòria].\n" #: src/config_manager.c:415 msgid "" "# Configuration file for pbbuttonsd >= version 0.5\n" "# for options see man pbbuttonsd.conf\n" msgstr "" "# Arxiu de configuració per al pbbuttonsd >= versió 0.5\n" "# per a opcions veure man pbbuttonsd.conf\n" #: src/module_cdrom.c:60 src/module_display.c:80 src/module_mixer.c:51 #: src/module_ossmixer.c:83 src/module_alsamixer.c:73 src/module_pmac.c:108 #: src/module_powersave.c:114 src/module_system.c:49 #, c-format msgid "Can't register configuration section %s, out of memory." msgstr "No es pot registrar la secció de configuració %s, sense memòria." #: src/module_cdrom.c:85 msgid "Please check your CDROM settings in configuration file.\n" msgstr "" "Sisplau comprova la configuració del CDROM al fitxer de configuració.\n" #: src/module_cdrom.c:359 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "No es pot obrir %s. L'expulsió del CDROM no funcionarà.\n" #: src/module_display.c:84 #, fuzzy msgid "initial LCD brightness level in percent" msgstr "nivell de lluminositat inicial per al monitor" #: src/module_display.c:86 src/module_display.c:108 msgid "0 = no smooth fading" msgstr "0 = cap degradació de lluminositat del monitor" #: src/module_display.c:88 src/module_display.c:110 msgid "only on Aluminum PowerBooks" msgstr "només en els Powerbooks d'alumini" #: src/module_display.c:94 msgid "ambient light threshold in percent for backlight autoadj." msgstr "" "interval de llum ambiental en percentatge per a l'autoajustament de la llum " "del darrera" #: src/module_display.c:96 msgid "autoadjustment range parameters" msgstr "paràmetres del rang d'autoajustament" #: src/module_display.c:104 #, fuzzy msgid "initial keyboard illumination level in percent" msgstr "nivell inicial d'il·luminació del teclat" #: src/module_display.c:106 #, fuzzy msgid "initial level in percent if KBD on/off key is pressed" msgstr "nivell inicial si la tecla KBD on/off és premuda" #: src/module_display.c:118 msgid "ambient light threshold in percent for keyboard light autoadj." msgstr "" "interval de llum ambiental (en percentatge) per a l'autoajustament de la " "llum del teclat" #: src/module_display.c:882 src/module_display.c:929 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "No es pot obrir el dispositiu de framebuffer '%s'.\n" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "'" msgstr "'" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "', '" msgstr "', '" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "' or '" msgstr "' o '" #: src/module_mixer.c:79 msgid "" "MixerInitDelay is not possible with automatic mixer detection; option " "disabled.\n" msgstr "" "El valor MixerInitDelay no és possible amb la detecció automàtica del " "mesclador; opció deshabilitada.\n" #: src/module_mixer.c:125 #, c-format msgid "Soundsystem requested: %s, detected: %s and at least activated: %s.\n" msgstr "Sistema de so requerit: %s, detectat: %s i com a mínim activat: %s.\n" #: src/module_mixer.c:128 #, c-format msgid "Soundsystem requested: %s and at least activated: %s.\n" msgstr "Sistema de so requerit: %s i almenys activat: %s.\n" #: src/module_ossmixer.c:98 src/module_alsamixer.c:86 msgid "initial volume level" msgstr "nivell inicial de volum" #: src/module_ossmixer.c:100 src/module_alsamixer.c:88 msgid "mute after startup?" msgstr "silenciat després d'iniciar?" #: src/module_ossmixer.c:155 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "No es pot accedir al devmask del mesclador [%s]; utilitzant els valors per " "defecte.\n" #: src/module_ossmixer.c:161 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "No es pot accedir al volum del canal principal [%s].\n" #: src/module_ossmixer.c:164 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "No es pot obrir la unitat mescladora [%s]. %s\n" #: src/module_alsamixer.c:138 msgid "Memory allocation failed.\n" msgstr "Memory allocation failed.\n" #: src/module_alsamixer.c:153 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "La tarja '%s' no té l'element '%s'.\n" #: src/module_alsamixer.c:165 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "L'opció 'ALSA_Elements' no conté elements vàlids\n" #: src/module_alsamixer.c:172 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "El mesclador '%s' no té control de volum del playback.\n" #: src/module_alsamixer.c:193 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Memory allocation failed: %s\n" #: src/module_alsamixer.c:211 #, c-format msgid "Can't open card '%s': %s\n" msgstr "No es pot obrir la tarja %s: %s\n" #: src/module_alsamixer.c:215 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "No es pot afegir la tarja '%s': %s\n" #: src/module_alsamixer.c:220 #, c-format msgid "Can't register mixer: %s\n" msgstr "No es pot obrir el mesclador: %s\n" #: src/module_alsamixer.c:227 #, c-format msgid "Can't load card '%s': %s\n" msgstr "No es pot carregar la tarja '%s': %s\n" #: src/module_alsamixer.c:367 msgid "ALSA Card name too long. Buffer overflow\n" msgstr "El nom de la tarja ALSA és massa llarg. Buffer overflow\n" #: src/module_alsamixer.c:380 msgid "Too much ALSA elements given. Buffer overflow.\n" msgstr "S'han donat massa elements ALSA. Buffer overflow\n" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:166 msgid "Permission denied" msgstr "Permís denegat" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:167 msgid "Private Tag" msgstr "Etiqueta privada" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:168 msgid "File doesn't exist" msgstr "El fitxer no existeix" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:169 msgid "File not a charakter device" msgstr "El fitxer no és un dispositiu de caràcters" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:170 msgid "File not a block device" msgstr "El fitxer no és un dispositiu de bloc" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:171 msgid "File not a file" msgstr "El fitxer no és un fitxer" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:172 msgid "Buffer overflow" msgstr "Desbordament de la memòria intermitja" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:173 msgid "open error" msgstr "error d'obertura" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:174 msgid "format error" msgstr "error de format" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:175 msgid "Messageport not available" msgstr "El port de missatges no està disponible" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:176 msgid "Server already running" msgstr "El servidor ja està funcionant" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:177 msgid "Help or version info" msgstr "Ajuda o informació sobre la versió" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:180 msgid "Unsecure script owner" msgstr "Propietari del fitxer de comandes insegur" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:181 msgid "Script must be write-only by owner" msgstr "Només el propietari ha de poder escriure en el fitxer de comandes" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:182 msgid "read-only value" msgstr "valor de només lectura" #: src/module_peep.c:188 pbbcmd/pbbcmd.c:183 msgid "write-only value" msgstr "valor de només escriptura" #: src/module_peep.c:189 pbbcmd/pbbcmd.c:184 msgid "argument invalid" msgstr "argument no vàlid" #: src/module_peep.c:190 pbbcmd/pbbcmd.c:185 msgid "function not supported" msgstr "funció no suportada" #: src/module_peep.c:362 msgid "unknown tag" msgstr "etiqueta desconeguda" #: src/module_pmac.c:129 msgid "switch trackpad to 'notap-mode' while typing" msgstr "canvia el 'trackpad' a 'notap-mode' mentre escriu" #: src/module_pmac.c:169 msgid "pmud support compiled in and active.\n" msgstr "està compilat amb support per pmud i aquest es troba actiu.\n" #: src/module_pmac.c:175 src/driver_backlight_pmu.c:102 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "No es pot obrir el dispositiu PMU %s: %s\n" #: src/module_pmac.c:183 src/driver_backlight_pmu.c:113 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "No es pot obrir el dispositiu ADB %s: %s\n" #: src/module_pmac.c:209 msgid "LMU found, ambient light sensor and keyboard illumination active.\n" msgstr "" "Trobat LMU, sensor de llum d'ambient i d'il·luminació de teclat actiu.\n" #: src/module_pmac.c:247 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "No es pot instal·lar el manegador de les entrades PMU. Es pot trobar a " "faltar alguna funcionalitat.\n" #: src/module_pmac.c:455 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" #: src/module_pmac.c:708 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" "No es troba el pmud en el port 879. Provocant directament PMU per adormir " "l'equip.\n" #: src/module_pmac.c:1394 #, fuzzy, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "No es pot accedir als dispositius i2c. Permís denegat.\n" #: src/module_pmac.c:1589 msgid "Unknown PowerBook" msgstr "PowerBook desconegut" #: src/module_pmac.c:1673 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "cicle de bateria actual: %d, fitxer de registre actiu: %s.\n" #: src/module_powersave.c:124 src/module_powersave.c:141 msgid "see TimerAction for possible values" msgstr "Veure TimerAction pels valors possibles" #: src/module_powersave.c:127 src/module_powersave.c:144 msgid "Action (see TimerAction) for the sleepkey" msgstr "Acció (veure TimerAction) per la tecla d'adormida" #: src/module_powersave.c:154 msgid "values > 0 may be dangerous, if the power key is used to trigger sleep" msgstr "" "valors més grans de 0 poden ser perillosos si s'utilitza la tecla " "d'apagarper a l'adormida" #: src/module_powersave.c:156 msgid "first battery warnlevel, time in minutes" msgstr "primera alerta de nivell de càrrega de bateria, temps en minuts" #: src/module_powersave.c:158 msgid "second battery warnlevel, time in minutes" msgstr "segona alerta de nivell de càrrega de bateria, temps en minuts" #: src/module_powersave.c:160 msgid "last battery warnlevel, time in minutes" msgstr "última alerta de nivell de càrrega de bateria, temps en minuts" #: src/module_powersave.c:164 msgid "action, if battery is critically low" msgstr "acció, si el nivell de càrrega de bateria és críticament baix" #: src/module_powersave.c:167 msgid "beep, if nothing else showed that the computer lives" msgstr "" "pita, si no hi ha cap altre indici que l'ordinador està en funcionament" #: src/module_powersave.c:171 msgid "value in percent" msgstr "valor en percentatge" #: src/module_powersave.c:173 src/module_powersave.c:179 msgid "time in seconds" msgstr "temps en segons" #: src/module_powersave.c:177 msgid "traffic in Bytes/s" msgstr "trànsit en Bytes/s" #: src/module_powersave.c:258 #, fuzzy msgid "Can't create IBaM object, out of memory.\n" msgstr "No es pot registrar la secció de configuració %s, sense memòria." #: src/module_powersave.c:386 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "Massa signes de format. Màxim tres %%s permesos a TAG_SCRIPTPMCS.\n" #: src/module_system.c:53 msgid "user who is allowed to use IPC" msgstr "Usuari a qui es permet usar l'IPC" #: src/module_system.c:55 msgid "automatic rescan of event devices" msgstr "exploració automàtica de dispositius d'esdeveniment" #: src/module_system.c:57 msgid "timeout in seconds for launched scripts, etc." msgstr "timeout en segons pels scripts llançats, etc." #: src/module_system.c:201 #, c-format msgid "config file [%s] is insecure, saving of config disabled.\n" msgstr "" "el fitxer de configuració [%s] és insegur, deshabilitant el desar la " "configuració.\n" #: src/module_system.c:203 #, c-format msgid "config file [%s] is not writable, saving of config disabled.\n" msgstr "" "no es pot escriure en el fitxer de configuració [%s], deshabilitant el desar " "la configuració.\n" #: src/module_system.c:206 #, c-format msgid "saving of config enabled to %s.\n" msgstr "guardar la configuració habilitat a %s.\n" #: src/class_backlight.c:52 #, c-format msgid "Initialized: %s\n" msgstr "" #: src/class_backlight.c:54 #, fuzzy msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "No hi ha disponible cap dispositiu d'events. Comprova la configuració.\n" #: src/driver_backlight_pmu.c:85 msgid "PMU Backlight Driver" msgstr "" #: src/driver_backlight_sysfs.c:119 msgid "SysFS Backlight Driver" msgstr "" #: src/support.c:60 #, fuzzy, c-format msgid "The object '%s' doesn't exist.\n" msgstr "El fitxer '%s' no existeix.\n" #: src/support.c:63 #, fuzzy, c-format msgid "The object '%s' is not a file.\n" msgstr "El fitxer '%s' no és un fitxer.\n" #: src/support.c:66 #, fuzzy, c-format msgid "The object '%s' is not a directory.\n" msgstr "El fitxer '%s' no és un fitxer.\n" #: src/support.c:69 #, fuzzy, c-format msgid "The object '%s' is not a character device.\n" msgstr "El fitxer '%s' no és un dispositiu de caràcters.\n" #: src/support.c:72 #, fuzzy, c-format msgid "The object '%s' is not a block device.\n" msgstr "El fitxer '%s' no és un dispositiu de blocs.\n" #: src/support.c:75 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "SEGURETAT: %s ha de ser del mateix propietari que pbbuttonsd.\n" #: src/support.c:78 #, fuzzy, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" "SEGURETAT: %s només ha de ser modificable pel propietari de pbbuttonsd.\n" #: src/support.c:81 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" #: src/support.c:89 #, c-format msgid "Path of '%s' is to long.\n" msgstr "La ruta de '%s' és massa llarga.\n" #: src/support.c:154 #, fuzzy, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "llançat però matat després de %d segons" #: src/support.c:177 #, fuzzy, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "llançat però el codi de sortida no és nul" #: src/support.c:179 #, fuzzy, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "llançament i sortida normal" #: src/support.c:181 #, fuzzy, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "llançat però finalitzat per senyal" #: src/support.c:221 #, fuzzy, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "no pot ser llançat - ha fallat el fork()" #: src/support.c:225 #, fuzzy, c-format msgid "Script '%s' doesn't exist.\n" msgstr "El fitxer '%s' no existeix.\n" #: src/support.c:227 #, fuzzy, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "ignorat perquè no és segur" #: src/support.c:254 msgid "launched and exited normally" msgstr "llançament i sortida normal" #: src/support.c:257 msgid "doesn't exist" msgstr "no existeix" #: src/support.c:262 msgid "skipped because it's not secure" msgstr "ignorat perquè no és segur" #: src/support.c:265 #, c-format msgid "lauched but killed after %d seconds" msgstr "llançat però matat després de %d segons" #: src/support.c:269 msgid "lauched but exitcode is not null" msgstr "llançat però el codi de sortida no és nul" #: src/support.c:272 msgid "can't be launched - fork() failed" msgstr "no pot ser llançat - ha fallat el fork()" #: src/support.c:275 msgid "lauched but exited by signal" msgstr "llançat però finalitzat per senyal" #: src/support.c:278 msgid "failed - unknown error code" msgstr "ha fallat - codi d'error desconegut" #: src/support.c:280 #, c-format msgid "Script '%s' %s\n" msgstr "Arxiu de comandes '%s' %s\n" #: pbbcmd/pbbcmd.c:178 msgid "Server not found" msgstr "No es troba el servidor" #: pbbcmd/pbbcmd.c:179 msgid "Registration failed" msgstr "Error de registre" #: pbbcmd/pbbcmd.c:190 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (versió %s) - client de control per al pbbuttonsd.\n" #: pbbcmd/pbbcmd.c:191 #, c-format msgid "Usage:\n" msgstr "Utilització:\n" #: pbbcmd/pbbcmd.c:195 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Opcions:\n" " -%c, --help mostra per pantalla aquesta ajuda i surt\n" " -%c, --version mostra per pantalla informació sobre la versió " "i surt \n" " -%c, --ignore ignora valors de configuració i d'error\n" "\n" #: pbbcmd/pbbcmd.c:208 #, c-format msgid "Supported commands:\n" msgstr "Comandes suportades:\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - llista els clients associats\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - desa la configuració actual al disc\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - reinicialitza el teclat i el trackpad\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - expulsa el cdrom\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - suspèn a la RAM\n" #: pbbcmd/pbbcmd.c:220 #, fuzzy, c-format msgid "%-14s - suspend to Disk\n" msgstr "%-14s - suspèn a la RAM\n" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - reconfigura els paràmetres del servidor\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - interroga el servidor per certs paràmetres\n" #: pbbcmd/pbbcmd.c:233 #, c-format msgid "Supported tags:\n" msgstr "Etiquetes suportades:\n" #: pbbcmd/pbbcmd.c:244 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "El primer 'TAG_' podria ser omès.\n" #: pbbcmd/pbbcmd.c:267 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, versió %s" #: pbbcmd/pbbcmd.c:283 pbbcmd/pbbcmd.c:299 #, c-format msgid "ERROR: Missing arguments\n" msgstr "ERROR: Falten arguments\n" #: pbbcmd/pbbcmd.c:290 pbbcmd/pbbcmd.c:312 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "ATENCIÓ: No està suportada l'etiqueta %s.\n" #: pbbcmd/pbbcmd.c:302 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "ERROR: la parella etiqueta/data no és completa.\n" #: pbbcmd/pbbcmd.c:343 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "Temps finalitzat, el servidor no ha pogut enviar una resposta.\n" #: pbbcmd/pbbcmd.c:425 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "No es pot obtenir la data per %s: %s." #: pbbcmd/pbbcmd.c:447 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "L'ajustament de %s ha fallat: %s.\n" #: pbbcmd/pbbcmd.c:452 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "ERROR: Resposta inesperada del servidor, codi d'acció: %ld.\n" #: pbbcmd/pbbcmd.c:461 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Nom | Port | Flags\n" " ------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:471 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:489 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "" "ERROR: Problemes amb IPC, pot ser que el servidor no estigui en " "funcionament.\n" #: pbbcmd/pbbcmd.c:493 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "ERROR: No queda suficient memòria pel buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "ERROR" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "ATENCIÓ" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFORMACIÓ" #, fuzzy #~ msgid "Wow, later than an Alluminum PB! ;-)" #~ msgstr "Uau, més nou que un Titanium! :-)" #~ msgid "Can't read filehandle %d anymore ... exiting!\n" #~ msgstr "No es pot seguir llegint %d el descriptor de fitxers... sortint!\n" pbbuttonsd-0.7.9/po/es.po0000644000175000017500000006171010507722362012232 00000000000000# pbbuttonsd translation to spanish # Copyright (C) 2004 Software in the Public Interest # This file is distributed under the same license as the postfix package. # # Changes: # - Initial translation # Rudy Godoy , 2004 # # # Traductores, si no conoce el formato PO, merece la pena leer la # documentación de gettext, especialmente las secciones dedicadas a este # formato, por ejemplo ejecutando: # info -n '(gettext)PO Files' # info -n '(gettext)Header Entry' # # Equipo de traducción al español, por favor lean antes de traducir # los siguientes documentos: # # - El proyecto de traducción de Debian al español # http://www.debian.org/intl/spanish/coordinacion # especialmente las notas de traducción en # http://www.debian.org/intl/spanish/notas # # - La guía de traducción de po's de debconf: # /usr/share/doc/po-debconf/README-trans # o http://www.debian.org/intl/l10n/po-debconf/README-trans # msgid "" msgstr "" "Project-Id-Version: pbbuttonsd 0.7.3\n" "Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net\n" "POT-Creation-Date: 2006-10-01 13:22+0200\n" "PO-Revision-Date: 2006-07-29 20:10+0100\n" "Last-Translator: Matthias Grimm \n" "Language-Team: Debian l10n spanish team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Spanish\n" "X-Poedit-SourceCharset: iso-8859-1\n" #: src/init.c:240 #, c-format msgid "%s, version %s" msgstr "%s, versión %s" #: src/init.c:254 #, c-format msgid "ERROR: Have problems reading configuration file [%s]: %s\n" msgstr "" "ERROR: Ocurrieron problemas al leer fichero de configuración [%s]: %s\n" #: src/init.c:260 #, c-format msgid "%s - daemon to support special features of laptops and notebooks.\n" msgstr "" "%s - demonio para soporte de características especiales de ordenadores " "portátiles.\n" #: src/init.c:261 #, c-format msgid "Usage: %s [OPTION]... \n" msgstr "Uso: %s [OPCIÓN]... \n" #: src/init.c:262 #, c-format msgid "" "Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n" msgstr "" "Opciones:\n" " -%c, --help muestra este mensaje y finaliza\n" " -%c, --version muestra información de versión y finaliza\n" " -%c, --quiet no muestra el mensaje de bienvenida\n" " -%c, --detach[=FICHEROPID] inicia %s como proceso en segundo plano y\n" " opcionalmente usa un fichero pid alternativo\n" " (predeterminado: %s)\n" " -%c, --configfile=CONFIG usar un fichero de configuración alternativo\n" " (predeterminado: %s)\n" "véase ficheros de configuración para más opciones.\n" #: src/init.c:342 msgid "Not all signal handlers could be installed.\n" msgstr "" #: src/init.c:344 #, fuzzy msgid "Can't install any signal handler\n" msgstr "No se puede instalar gestor de señal.\n" #: src/init.c:358 #, c-format msgid "Can't create message port for server: %s.\n" msgstr "No se puede crear puerto de mensajes para servidor: %s.\n" #: src/init.c:361 msgid "Server is already running. Sorry, only one instance allowed.\n" msgstr "" "El servidor ya se está ejecutando. Disculpe, solo se permite una instancia.\n" #: src/init.c:364 msgid "" "Orphaned server port found and removed. All running clients have to be " "restarted.\n" msgstr "" "Se ha encontrado un puerto de servidor huérfano y se ha eliminado. Sedebe " "reiniciar todos los clientes\n" #: src/input_manager.c:176 msgid "No event devices available. Please check your configuration.\n" msgstr "" "No existen dispositivos de eventos disponibles. Por favor verifique " "suconfiguración.\n" #: src/config_manager.c:233 #, c-format msgid "Couldn't read configfile [%s, %s], using defaults.\n" msgstr "" "No se puede leer fichero de configuración [%s, %s], se usarán valores " "predeterminados.\n" #: src/config_manager.c:239 #, c-format msgid "Couldn't read configfile [%s, out of memory], using defaults.\n" msgstr "" "No se puede leer fichero de configuración [%s, no hay memoria disponible], " "se usarán valores predeterminados.\n" #: src/config_manager.c:400 #, c-format msgid "Couldn't write configfile [%s, out of memory].\n" msgstr "" "No se puede escribir fichero de configuración [%s, no hay memoria " "disponible].\n" #: src/config_manager.c:415 msgid "" "# Configuration file for pbbuttonsd >= version 0.5\n" "# for options see man pbbuttonsd.conf\n" msgstr "" "# Fichero de configuración para pbbuttonsd >= versión 0.5\n" "# para saber las opciones véase: man pbbuttonsd.conf\n" #: src/module_cdrom.c:60 src/module_display.c:80 src/module_mixer.c:51 #: src/module_ossmixer.c:83 src/module_alsamixer.c:73 src/module_pmac.c:108 #: src/module_powersave.c:114 src/module_system.c:49 #, c-format msgid "Can't register configuration section %s, out of memory." msgstr "" "No se pudo registrar sección de configuración %s, no hay memoria\n" "suficiente." #: src/module_cdrom.c:85 msgid "Please check your CDROM settings in configuration file.\n" msgstr "Por favor verifique los valores de configuración del CDROM.\n" #: src/module_cdrom.c:359 #, c-format msgid "Can't open %s. Eject CDROM won't work.\n" msgstr "No se puede abrir %s. No se podrá expulsar CDROM.\n" #: src/module_display.c:84 #, fuzzy msgid "initial LCD brightness level in percent" msgstr "Nivel inicial de brillo de LCD" #: src/module_display.c:86 src/module_display.c:108 msgid "0 = no smooth fading" msgstr "0 = sin desvanecido suave" #: src/module_display.c:88 src/module_display.c:110 msgid "only on Aluminum PowerBooks" msgstr "Solamente en PowerBooks Aluminum" #: src/module_display.c:94 msgid "ambient light threshold in percent for backlight autoadj." msgstr "Nivel de luz ambiental en porcentaje para autoajuste de luz posterior" #: src/module_display.c:96 msgid "autoadjustment range parameters" msgstr "Rango de parámetros de autoajuste" #: src/module_display.c:104 #, fuzzy msgid "initial keyboard illumination level in percent" msgstr "Nivel inicial de iluminación de teclado" #: src/module_display.c:106 #, fuzzy msgid "initial level in percent if KBD on/off key is pressed" msgstr "Nivel inicial si se presiona la tecla de KBD" #: src/module_display.c:118 msgid "ambient light threshold in percent for keyboard light autoadj." msgstr "Porcentaje de nivel de luz ambiental para autoajustar luz posterior." #: src/module_display.c:882 src/module_display.c:929 #, c-format msgid "Can't open framebuffer device '%s'.\n" msgstr "No se puede abrir dispositivo framebuffer «%s».\n" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "'" msgstr "'" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "', '" msgstr "', '" #: src/module_mixer.c:55 src/module_pmac.c:120 src/module_pmac.c:123 #: src/module_pmac.c:126 src/module_powersave.c:118 src/module_powersave.c:121 #: src/module_powersave.c:135 src/module_powersave.c:138 msgid "' or '" msgstr "' o '" #: src/module_mixer.c:79 msgid "" "MixerInitDelay is not possible with automatic mixer detection; option " "disabled.\n" msgstr "" "No es posible definir «MixerInitDelay» con la detección automática de " "mezclador: Opción deshabilitada.\n" #: src/module_mixer.c:125 #, c-format msgid "Soundsystem requested: %s, detected: %s and at least activated: %s.\n" msgstr "" "Sistema de sonido solicitado: %s, detectado: %s y por lo menos activado: %s\n" #: src/module_mixer.c:128 #, c-format msgid "Soundsystem requested: %s and at least activated: %s.\n" msgstr "Sistema de sonido solicitado: %s y por lo menos activado: %s.\n" #: src/module_ossmixer.c:98 src/module_alsamixer.c:86 msgid "initial volume level" msgstr "Nivel inicial de volumen" #: src/module_ossmixer.c:100 src/module_alsamixer.c:88 msgid "mute after startup?" msgstr "¿Silenciar antes de carga?" #: src/module_ossmixer.c:155 #, c-format msgid "Can't get devmask from mixer [%s]; using default.\n" msgstr "" "No se puede obtener devmask para mezclador [%s]; se usarán valores " "predeterminados.\n" #: src/module_ossmixer.c:161 #, c-format msgid "Can't get volume of master channel [%s].\n" msgstr "No se puede obtener volumen de canal maestro [%s].\n" #: src/module_ossmixer.c:164 #, c-format msgid "Can't open mixer device [%s]. %s\n" msgstr "No se puede abrir dispositivo de mezcla [%s]. %s\n" #: src/module_alsamixer.c:138 msgid "Memory allocation failed.\n" msgstr "Fallo en asignamiento de memoria.\n" #: src/module_alsamixer.c:153 #, c-format msgid "Card '%s' has no '%s' element.\n" msgstr "La tarjeta «%s» no tiene el elemento «%s».\n" #: src/module_alsamixer.c:165 msgid "Option 'ALSA_Elements' contains no valid elements\n" msgstr "La opción «ALSA_Elements» no tiene elementos válidos.\n" #: src/module_alsamixer.c:172 #, c-format msgid "Mixer element '%s' has no playback volume control.\n" msgstr "" "El elemento mezclador «%s» no tiene control de volumen de reproducción.\n" #: src/module_alsamixer.c:193 #, c-format msgid "Memory allocation failed: %s\n" msgstr "Fallo en asignación de memoria: %s\n" #: src/module_alsamixer.c:211 #, c-format msgid "Can't open card '%s': %s\n" msgstr "No se puede abrir tarjeta «%s»: %s\n" #: src/module_alsamixer.c:215 #, c-format msgid "Can't attach card '%s': %s\n" msgstr "No se puede activar tarjeta «%s»: %s\n" #: src/module_alsamixer.c:220 #, c-format msgid "Can't register mixer: %s\n" msgstr "No se puede registrar dispositivo de mezcla: %s\n" #: src/module_alsamixer.c:227 #, c-format msgid "Can't load card '%s': %s\n" msgstr "No se puede cargar tarjeta «%s»: %s\n" #: src/module_alsamixer.c:367 msgid "ALSA Card name too long. Buffer overflow\n" msgstr "Nombre de tarjeta ALSA demasiado largo. Desbordamiento de buffer.\n" #: src/module_alsamixer.c:380 msgid "Too much ALSA elements given. Buffer overflow.\n" msgstr "Se ha indicado demasiados elementos ALSA. Debordamiento de buffer.\n" #: src/module_peep.c:173 pbbcmd/pbbcmd.c:166 msgid "Permission denied" msgstr "Permiso denegado" #: src/module_peep.c:174 pbbcmd/pbbcmd.c:167 msgid "Private Tag" msgstr "Etiqueta privada" #: src/module_peep.c:175 pbbcmd/pbbcmd.c:168 msgid "File doesn't exist" msgstr "Fichero no existe" #: src/module_peep.c:176 pbbcmd/pbbcmd.c:169 msgid "File not a charakter device" msgstr "Fichero no es un dispositivo de caracteres" #: src/module_peep.c:177 pbbcmd/pbbcmd.c:170 msgid "File not a block device" msgstr "Fichero no es un dispositivo de bloques" #: src/module_peep.c:178 pbbcmd/pbbcmd.c:171 msgid "File not a file" msgstr "Fichero no es un fichero" #: src/module_peep.c:179 pbbcmd/pbbcmd.c:172 msgid "Buffer overflow" msgstr "Desbordamiento de buffer" #: src/module_peep.c:180 pbbcmd/pbbcmd.c:173 msgid "open error" msgstr "Error de apertura" #: src/module_peep.c:181 pbbcmd/pbbcmd.c:174 msgid "format error" msgstr "Error de formato" #: src/module_peep.c:182 pbbcmd/pbbcmd.c:175 msgid "Messageport not available" msgstr "Puerto de mensajes no disponible" #: src/module_peep.c:183 pbbcmd/pbbcmd.c:176 msgid "Server already running" msgstr "El servidor ya se está ejecutando" #: src/module_peep.c:184 pbbcmd/pbbcmd.c:177 msgid "Help or version info" msgstr "Ayuda o información de versión" #: src/module_peep.c:185 pbbcmd/pbbcmd.c:180 msgid "Unsecure script owner" msgstr "Dueño de programa inseguro" #: src/module_peep.c:186 pbbcmd/pbbcmd.c:181 msgid "Script must be write-only by owner" msgstr "El programa debe tener permisos de escritura solamente para dueño" #: src/module_peep.c:187 pbbcmd/pbbcmd.c:182 msgid "read-only value" msgstr "Valor de solo lectura" #: src/module_peep.c:188 pbbcmd/pbbcmd.c:183 msgid "write-only value" msgstr "Valor de solo escritura" #: src/module_peep.c:189 pbbcmd/pbbcmd.c:184 msgid "argument invalid" msgstr "Argumento inválido" #: src/module_peep.c:190 pbbcmd/pbbcmd.c:185 msgid "function not supported" msgstr "Función no soportada" #: src/module_peep.c:362 msgid "unknown tag" msgstr "Etiqueta desconocida" #: src/module_pmac.c:129 msgid "switch trackpad to 'notap-mode' while typing" msgstr "Cambiar trackpad a «modo notap» mientras se escribe" #: src/module_pmac.c:169 msgid "pmud support compiled in and active.\n" msgstr "Soporte de pmud compilado y activo.\n" #: src/module_pmac.c:175 src/driver_backlight_pmu.c:102 #, c-format msgid "Can't open PMU device %s: %s\n" msgstr "No se puede abrir dispositivo PMU %s: %s\n" #: src/module_pmac.c:183 src/driver_backlight_pmu.c:113 #, c-format msgid "Can't open ADB device %s: %s\n" msgstr "No se puede abrir dispositivo ADB %s: %s\n" #: src/module_pmac.c:209 msgid "LMU found, ambient light sensor and keyboard illumination active.\n" msgstr "" "LMU encontrado, sensor de luz de ambiente e iluminación de teclado activas.\n" #: src/module_pmac.c:247 msgid "Can't install PMU input handler. Some functionality may be missing.\n" msgstr "" "No se pudo instalar gestor de entrada de PMU. Algunas funcionalidades " "podrían no estar disponibles.\n" #: src/module_pmac.c:455 msgid "ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n" msgstr "" #: src/module_pmac.c:708 msgid "Can't find pmud on port 879. Trigger PMU directly for sleep.\n" msgstr "" "No se pudo encontrar pmud en puerto 879. Usar direcamente PMU para " "hibernación.\n" #: src/module_pmac.c:1394 #, c-format msgid "Can't access i2c device %s - %s.\n" msgstr "No se puede acceder a dispositivos i2c %s - %s.\n" #: src/module_pmac.c:1589 msgid "Unknown PowerBook" msgstr "PowerBook desconocida" #: src/module_pmac.c:1673 #, c-format msgid "Current battery cycle: %d, active logfile: %s.\n" msgstr "Ciclo actual de batería: %d, fichero de registro activo: %s.\n" #: src/module_powersave.c:124 src/module_powersave.c:141 msgid "see TimerAction for possible values" msgstr "Véase «TimerAction» para saber los valores posibles" #: src/module_powersave.c:127 src/module_powersave.c:144 msgid "Action (see TimerAction) for the sleepkey" msgstr "Acción (vea «TimerAction») para la tecla de hibernación" #: src/module_powersave.c:154 msgid "values > 0 may be dangerous, if the power key is used to trigger sleep" msgstr "" "Los valores mayores a 0 podrían ser peligrosos, si el botón de energía\n" "es usado para activar la hibernación" #: src/module_powersave.c:156 msgid "first battery warnlevel, time in minutes" msgstr "Primer nivel de alerta de batería, tiempo en minutos" #: src/module_powersave.c:158 msgid "second battery warnlevel, time in minutes" msgstr "Segundo nivel de alerta de batería, tiempo en minutos" #: src/module_powersave.c:160 msgid "last battery warnlevel, time in minutes" msgstr "Último nivel de alerta de batería, tiempo en minutos" #: src/module_powersave.c:164 msgid "action, if battery is critically low" msgstr "Acción, si la batería está críticamente baja" #: src/module_powersave.c:167 msgid "beep, if nothing else showed that the computer lives" msgstr "Pitido, si nada muestra que el ordenador está activo" #: src/module_powersave.c:171 msgid "value in percent" msgstr "Valor en porcentaje" #: src/module_powersave.c:173 src/module_powersave.c:179 msgid "time in seconds" msgstr "Tiempo en segundos" #: src/module_powersave.c:177 msgid "traffic in Bytes/s" msgstr "Tráficos en Bytes/s" #: src/module_powersave.c:258 msgid "Can't create IBaM object, out of memory.\n" msgstr "No se pudo crear objeto IBaM, no hay memoria suficiente.\n" #: src/module_powersave.c:386 #, c-format msgid "Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n" msgstr "" "Demasiados signos de formato. El máximo permitido es tres %%s en " "TAG_SCRIPTPMCS.\n" #: src/module_system.c:53 msgid "user who is allowed to use IPC" msgstr "Usuario que tiene permisos para usar IPC" #: src/module_system.c:55 msgid "automatic rescan of event devices" msgstr "Realizar búsqueda automática de eventos en dispositivos" #: src/module_system.c:57 msgid "timeout in seconds for launched scripts, etc." msgstr "Tiempo de espera para programas cargados, etc." #: src/module_system.c:201 #, c-format msgid "config file [%s] is insecure, saving of config disabled.\n" msgstr "" "El fichero de configuración [%s] es inseguro, se deshabilitará elguardar " "configuración.\n" #: src/module_system.c:203 #, c-format msgid "config file [%s] is not writable, saving of config disabled.\n" msgstr "" "No se puede escribir en el fichero de configuración [%s], sedeshabilitará el " "guardar configuración.\n" #: src/module_system.c:206 #, c-format msgid "saving of config enabled to %s.\n" msgstr "Habilitado el guardado de configuración a %s.\n" #: src/class_backlight.c:52 #, c-format msgid "Initialized: %s\n" msgstr "" #: src/class_backlight.c:54 #, fuzzy msgid "No backlight driver available - check your Kernel configuration.\n" msgstr "" "No existen dispositivos de eventos disponibles. Por favor verifique " "suconfiguración.\n" #: src/driver_backlight_pmu.c:85 msgid "PMU Backlight Driver" msgstr "" #: src/driver_backlight_sysfs.c:119 msgid "SysFS Backlight Driver" msgstr "" #: src/support.c:60 #, c-format msgid "The object '%s' doesn't exist.\n" msgstr "El objeto «%s» no existe.\n" #: src/support.c:63 #, c-format msgid "The object '%s' is not a file.\n" msgstr "El objeto «%s» no es un fichero.\n" #: src/support.c:66 #, c-format msgid "The object '%s' is not a directory.\n" msgstr "El objeto «%s» no es un fichero.\n" #: src/support.c:69 #, c-format msgid "The object '%s' is not a character device.\n" msgstr "El objeto «%s» no es un dispositivo de caracteres.\n" #: src/support.c:72 #, c-format msgid "The object '%s' is not a block device.\n" msgstr "El objeto «%s» no es un dispositivo de bloques.\n" #: src/support.c:75 #, c-format msgid "SECURITY: %s must be owned by the same owner as pbbuttonsd.\n" msgstr "SEGURIDAD: %s debe tener el mismo dueño que pbbuttonsd.\n" #: src/support.c:78 #, c-format msgid "SECURITY: %s must only be writable by the owner of pbbuttonsd.\n" msgstr "" "SEGURIDAD: Sólo el dueño del proceso pbbuttonsd puede escribir en %s.\n" #: src/support.c:81 #, c-format msgid "Insufficient permissions for object %s, at least '0%o' needed.\n" msgstr "" "Permisos insuficientes para el objeto «%s», se requiere como mínimo «0%o».\n" #: src/support.c:89 #, c-format msgid "Path of '%s' is to long.\n" msgstr "La ruta de «%s» es demasiado larga.\n" #: src/support.c:154 #, fuzzy, c-format msgid "Script '%s' lauched but killed after %d seconds.\n" msgstr "Cargado pero terminado después de %d segundos" #: src/support.c:177 #, fuzzy, c-format msgid "Script '%s' lauched but exitcode is %d.\n" msgstr "Cargado pero código de finalización no es «null»" #: src/support.c:179 #, fuzzy, c-format msgid "Script '%s' launched and exited normally.\n" msgstr "Cargado y finalizado normalmente" #: src/support.c:181 #, fuzzy, c-format msgid "Script '%s' lauched but exited by signal.\n" msgstr "Cargado pero finalizado por señal" #: src/support.c:221 #, fuzzy, c-format msgid "Script '%s' can't be launched - fork() failed.\n" msgstr "No se puede cargar - fallo en fork()" #: src/support.c:225 #, fuzzy, c-format msgid "Script '%s' doesn't exist.\n" msgstr "El objeto «%s» no existe.\n" #: src/support.c:227 #, fuzzy, c-format msgid "Script '%s' skipped because it's not secure.\n" msgstr "Pasado debido a que no es seguro" #: src/support.c:254 msgid "launched and exited normally" msgstr "Cargado y finalizado normalmente" #: src/support.c:257 msgid "doesn't exist" msgstr "No existe" #: src/support.c:262 msgid "skipped because it's not secure" msgstr "Pasado debido a que no es seguro" #: src/support.c:265 #, c-format msgid "lauched but killed after %d seconds" msgstr "Cargado pero terminado después de %d segundos" #: src/support.c:269 msgid "lauched but exitcode is not null" msgstr "Cargado pero código de finalización no es «null»" #: src/support.c:272 msgid "can't be launched - fork() failed" msgstr "No se puede cargar - fallo en fork()" #: src/support.c:275 msgid "lauched but exited by signal" msgstr "Cargado pero finalizado por señal" #: src/support.c:278 msgid "failed - unknown error code" msgstr "Fallo - código de fallo desconocido" #: src/support.c:280 #, c-format msgid "Script '%s' %s\n" msgstr "Programa «%s» %s\n" #: pbbcmd/pbbcmd.c:178 msgid "Server not found" msgstr "Servidor no encontrado" #: pbbcmd/pbbcmd.c:179 msgid "Registration failed" msgstr "Fallo de registro" #: pbbcmd/pbbcmd.c:190 #, c-format msgid "%s (version %s) - control client for pbbuttonsd.\n" msgstr "%s (versión %s) - cliente de control para pbbuttonsd.\n" #: pbbcmd/pbbcmd.c:191 #, c-format msgid "Usage:\n" msgstr "Uso:\n" #: pbbcmd/pbbcmd.c:195 #, c-format msgid "" "Options:\n" " -%c, --help display this help and exit\n" " -%c, --version display version information and exit\n" " -%c, --ignore ignore config return and error values\n" msgstr "" "Opciones:\n" " -%c, --help muestra esta ayuda y finaliza\n" " -%c, --version muestra información de versión y finaliza\n" " -%c, --ignore ignora valores de retorno de configuración y " "errores\n" #: pbbcmd/pbbcmd.c:208 #, c-format msgid "Supported commands:\n" msgstr "Ordenes soportadas:\n" #: pbbcmd/pbbcmd.c:210 #, c-format msgid "%-14s - prints a list of clients attached\n" msgstr "%-14s - imprime una lista de clientes conectados\n" #: pbbcmd/pbbcmd.c:212 #, c-format msgid "%-14s - save the current configuration to disk\n" msgstr "%-14s - guarda a disco la configuración actual\n" #: pbbcmd/pbbcmd.c:214 #, c-format msgid "%-14s - reinitialising the keyboard and the trackpad\n" msgstr "%-14s - reinicializando el teclado y trackpad\n" #: pbbcmd/pbbcmd.c:216 #, c-format msgid "%-14s - eject the CDROM\n" msgstr "%-14s - expulsa el CDROM\n" #: pbbcmd/pbbcmd.c:218 #, c-format msgid "%-14s - suspend to RAM\n" msgstr "%-14s - suspende a RAM\n" #: pbbcmd/pbbcmd.c:220 #, c-format msgid "%-14s - suspend to Disk\n" msgstr "%-14s - suspende a disco\n" #: pbbcmd/pbbcmd.c:222 #, c-format msgid "%-14s - reconfigure server parameters\n" msgstr "%-14s - reconfigura parámetros del servidor\n" #: pbbcmd/pbbcmd.c:224 #, c-format msgid "%-14s - queries the server for certain parameters\n" msgstr "%-14s - consulta ciertos parámetros del servidor\n" #: pbbcmd/pbbcmd.c:233 #, c-format msgid "Supported tags:\n" msgstr "Etiquetas soportadas:\n" #: pbbcmd/pbbcmd.c:244 #, c-format msgid "The leading 'TAG_' could be omited.\n" msgstr "El prefijo «TAG_» puede ser omitido.\n" #: pbbcmd/pbbcmd.c:267 #, c-format msgid "pbbcmd, version %s" msgstr "pbbcmd, versión %s" #: pbbcmd/pbbcmd.c:283 pbbcmd/pbbcmd.c:299 #, c-format msgid "ERROR: Missing arguments\n" msgstr "ERROR: No se indico argumentos\n" #: pbbcmd/pbbcmd.c:290 pbbcmd/pbbcmd.c:312 #, c-format msgid "WARNING: tag %s not supported.\n" msgstr "ADVERTENCIA: La etiqueta «%s» no está soportada.\n" #: pbbcmd/pbbcmd.c:302 #, c-format msgid "ERROR: tag/data pairs not complete.\n" msgstr "ERROR: El par etiqueta/data está incompleto.\n" #: pbbcmd/pbbcmd.c:343 #, c-format msgid "Server didn't send an answer and timed out.\n" msgstr "El servidor no ha enviado respuesta y ha finalizado.\n" #: pbbcmd/pbbcmd.c:425 #, c-format msgid "Sorry, Couldn't get data for %s: %s." msgstr "Disculpe, no se puede obtener data para %s: %s." #: pbbcmd/pbbcmd.c:447 #, c-format msgid "Setting of %s failed: %s.\n" msgstr "Fallo en configuración de %s: %s.\n" #: pbbcmd/pbbcmd.c:452 #, c-format msgid "ERROR: Unexpected answer from server, actioncode %ld.\n" msgstr "ERROR: Respuesta de servidor inesperada, código de acción %ld.\n" #: pbbcmd/pbbcmd.c:461 #, c-format msgid "" " PID | Name | Port | Flags\n" " ------+----------------------+---------+-----------\n" msgstr "" " PID | Nombre | Puerto | Banderas\n" " -------+----------------------+---------+-----------\n" #: pbbcmd/pbbcmd.c:471 msgid "" msgstr "" #: pbbcmd/pbbcmd.c:489 #, c-format msgid "ERROR: Problems with IPC, maybe server is not running.\n" msgstr "ERROR: Problemas con IPC, tal vez el servidor no se está ejecutando.\n" #: pbbcmd/pbbcmd.c:493 #, c-format msgid "ERROR: Not enough memory for buffer.\n" msgstr "ERROR: No hay suficiente memoria para buffer.\n" #: libpbbipc/pbb_errno.c:73 msgid "ERROR" msgstr "ERROR" #: libpbbipc/pbb_errno.c:77 msgid "WARNING" msgstr "ADVERTENCIA" #: libpbbipc/pbb_errno.c:81 msgid "INFO" msgstr "INFO" #, fuzzy #~ msgid "Wow, later than an Alluminum PB! ;-)" #~ msgstr "¡Epa, más reciente que una Titanium! ;-)" #~ msgid "Can't read filehandle %d anymore ... exiting!\n" #~ msgstr "No se puede leer fichero gestor %d ... ¡finalizando!\n" pbbuttonsd-0.7.9/po/de.gmo0000644000175000017500000004262010507722574012363 00000000000000•ÞŸß ˆg ‰Y ñK*d2&Â5é/Oh1€B²õ  '>1)p)šÄ!Ôö)*<=g2¥)ØD!Gi'ƒ«Éç$!&7H€š3º>î/-/]9“Í%ç7 6E$|¡´Ìèø ?#Bc¦Áß3ùP-A~=À,þ2+É^ü(R%x§8¹ òþ<?O/ŸÏ(ë*1?*q-œ"Êí,=1o€$›6ÀD÷<Qb$yž'¾+æ$  7? W/ — Ç Ù ï ÷!!$!79!\>!–!Õ!æ!"4"(!"]9"="¹ "÷#(#! #J#W'#n.#–5#Å#û'$ $8$Y#$v$š$·$Ë $ç$ò%%%+ %;)%\#%†%ª,%Ê%÷-&&5 &H&T&sF&„&Ëœ&Üj(yl(ä)Q6)n%)¥')Ë6)ó<**N*g#*¶5*ÚC++T+c+e+n+s +Ž\+š(+÷., ,O,,c%,4,¶6,ë9-"N-\7-«P-ã(.4 .]D.~&.Ã&.ê /,/2!/_D/#/Æ+/ê>0C0U60™30Ð151 1A&1\<1ƒ81À71ù212G2e2… 2Ÿ2À2ÅK2ÔB3 $3c(3ˆ3±53ÍT4b4XG4»6585:Ï5sü6CT8@*8•8À8àI8ó 9=9JF9gK9®9ú:: :E7:c6:›::Ò*; *;8-;c;‘&;¦-;Í;û"<%<49A>42>v>©>¿ >Ý>é?(??8'?U'?}?¥)?¹&?ã8@ ,@C>@pB@¯@ò'A)A*ATAe)A€4Aª,Aß"B *B/+BZ(B†,B¯BÜBù$CC4CG,CZC‡)C¤*CÎ$CùD>D;Dz3D‹D¿DÕ*DåENE Eol“‚|B–hg›[&r:o}L@_Hš+jCƒf7b^•‡t4mySNG=/> qkpV~0 #$\Mn‘5”…cŸ e?Ewž%;Šx",€6Z2])<u1’{ zQŒ U-„ ‹Ž˜WdFi!™†*ˆX'RDs(—.9JPAœK8IvO3T`Y‰a PID | Name | Port | Flags ------+----------------------+---------+----------- # Configuration file for pbbuttonsd >= version 0.5 # for options see man pbbuttonsd.conf %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to Disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %s'' or '', '0 = no smooth fadingADB keyboard can't disable fnmode, force mode to 'fkeyslast'. ALSA Card name too long. Buffer overflow Action (see TimerAction) for the sleepkeyBuffer overflowCan't access i2c device %s - %s. Can't attach card '%s': %s Can't create IBaM object, out of memory. Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't install any signal handler Can't load card '%s': %s Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register configuration section %s, out of memory.Can't register mixer: %s Card '%s' has no '%s' element. Couldn't read configfile [%s, %s], using defaults. Couldn't read configfile [%s, out of memory], using defaults. Couldn't write configfile [%s, out of memory]. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a charakter deviceFile not a fileHelp or version infoINFOInitialized: %s Insufficient permissions for object %s, at least '0%o' needed. LMU found, ambient light sensor and keyboard illumination active. Memory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. MixerInitDelay is not possible with automatic mixer detection; option disabled. No backlight driver available - check your Kernel configuration. No event devices available. Please check your configuration. Not all signal handlers could be installed. Option 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. PMU Backlight DriverPath of '%s' is to long. Permission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. SECURITY: %s must only be writable by the owner of pbbuttonsd. Script '%s' %s Script '%s' can't be launched - fork() failed. Script '%s' doesn't exist. Script '%s' lauched but exitcode is %d. Script '%s' lauched but exited by signal. Script '%s' lauched but killed after %d seconds. Script '%s' launched and exited normally. Script '%s' skipped because it's not secure. Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Soundsystem requested: %s and at least activated: %s. Soundsystem requested: %s, detected: %s and at least activated: %s. Supported commands: Supported tags: SysFS Backlight DriverThe leading 'TAG_' could be omited. The object '%s' doesn't exist. The object '%s' is not a block device. The object '%s' is not a character device. The object '%s' is not a directory. The object '%s' is not a file. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Too much ALSA elements given. Buffer overflow. Unknown PowerBookUnsecure script ownerUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. action, if battery is critically lowambient light threshold in percent for backlight autoadj.ambient light threshold in percent for keyboard light autoadj.argument invalidautoadjustment range parametersautomatic rescan of event devicesbeep, if nothing else showed that the computer livescan't be launched - fork() failedconfig file [%s] is insecure, saving of config disabled. config file [%s] is not writable, saving of config disabled. doesn't existfailed - unknown error codefirst battery warnlevel, time in minutesformat errorfunction not supportedinitial LCD brightness level in percentinitial keyboard illumination level in percentinitial level in percent if KBD on/off key is pressedinitial volume levellast battery warnlevel, time in minuteslauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallymute after startup?only on Aluminum PowerBooksopen errorpbbcmd, version %spmud support compiled in and active. read-only valuesaving of config enabled to %s. second battery warnlevel, time in minutessee TimerAction for possible valuesskipped because it's not secureswitch trackpad to 'notap-mode' while typingtime in secondstimeout in seconds for launched scripts, etc.traffic in Bytes/sunknown taguser who is allowed to use IPCvalue in percentvalues > 0 may be dangerous, if the power key is used to trigger sleepwrite-only valueProject-Id-Version: pbbuttons 0.6.8 Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2006-10-01 13:22+0200 PO-Revision-Date: 2006-10-01 13:24+0100 Last-Translator: Matthias Grimm Language-Team: german MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; PID | Name | Port | Schalter ------+----------------------+---------+----------- # Konfigurationsdatei für PBButtonsd >= Version 0.5 # für Liste der Optionen siehe pbbuttonsd.conf man-page %-14s - wirft die CDROM aus %-14s - gibt eine Liste der angemeldeten Klienten aus %-14s - Afragen von Serverparametern %-14s - verändern von Serverparametern %-14s - Reinitialisiert die Tastatur und das Trackpad %-14s - speichert die aktuelle Konfiguration auf Festplatte %-14s - sichert den Systemzustand auf Festplatte und schaltet den Rechner aus %-14s - legt die Maschine schlafen %s (version %s) - Steuerungsprogramm für PBButtonsd. %s - Daemon zur Nutzung spezieller Laptop und Notebook Fähigkeiten %s, Version %s'' oder '', '0 = kein sanftes AbblendenDie Taste Fn kann auf ADB Tastaturen nicht abgeschaltet werden, erzwinge Modus 'fkeyslast'. ALSA Card Name zu lang, Bufferüberlauf. Aktion (siehe TimerAction) für die SchlaftasteBuffer übergelaufenKann auf I2C Gerät %s nicht zugreifen - %s. Kann Card '%s' nicht hinzufügen: %s. Kann IBaM Objekt nicht erzeugen, zu wenig Speicher. Kann den Messageport für den Server nicht anlegen: %s Kann pmud nicht finden. Schalte in den Replacement Mode. Kann verfügbare Kanäle des Mixer [%s] nicht ermitteln, benutze Standardwerte. Kann Lautstärke des Masterkanals [%s] nicht ermitteln. Kann PMU Inputhandler nicht installieren. Einige Funktionen werden nicht gehen. Kann keinen Signalhandler installieren. Kann Card '%s' nicht laden: %s. Kann %s nicht öffnen. Auswerfen der CDROM wird nicht funktionieren. Kann ADB Device [%s] nicht öffnen: %s Kann PMU Device [%s] nicht öffnen: %s Kann Card '%s' nicht öffnen: %s Kann Framebuffer Device '%s' nicht öffnen. Kann Mixer [%s] nicht öffnen: %s Kann Konfigurationssektion %s nicht registrieren, zu wenig Speicher.Kann Mixer nicht registrieren: %s. Card '%s' hat kein Element mit Namen '%s'. Kann Konfigdatei [%s, %s] nicht lesen, benutze Standardwerte. Zu wenig Speicher für die Konfigdatei [%s], benutze Standardwerte. Kann Konfigdatei nicht speichern [%s, kein Speicher]. Aktueller Batteriezyklus: %d, aktive Logdatei: %s. FEHLERFEHLER: Problem beim Lesen der Konfigdatei [%s]: %s. FEHLER: Argumente fehlen. FEHLER: Zu wenig Speicher für Buffer. FEHLER: IPC Problem, wahrscheinlich läuft der Server nicht. FEHLER: Unerwartete Antwort vom Server, Actioncode %ld. FEHLER: Tag und Daten müssen immer paarweise auftreten Datei existiert nichtDie Datei ist kein BlockgerätDie Datei ist kein ZeichengerätDie Datei ist keine DateiHilfe oder VersionsinformationenINFOAktiviert: %s Zugriffsrechte für Objekt %s reichen nicht aus, benötige mindestens '0%o'. LMU gefunden, Umgebungslichtsensor und Tastaturbeleuchtung aktiv. Speicheranforderung fehlgeschlagen. Speicheranforderung fehlgeschlagen: %s. Messageport nicht verfügbarMixer Element '%s' hat keine Lautstärke-Eigenschaft. MixerInitDelay ist bei automatischer Mixererkennung nicht möglich; Option gelöscht. Kein Treiber für die Hintergrundbeleuchtung verfügbar, bitte prüfen Sie Ihre Kernelkonfiguration. Kein Event Device verfügbar, bitte prüfen Sie Ihre Systemkonfiguration Nicht alle Signal-Handler konnten installiert werden. Option 'ALSA_Elements' enthält keine gültigen Elemente. Optionen: -%c, --help zeigt die Kurzhilfe an -%c, --version zeigt Versionsinformationen an -%c, --ignore ignoriere 'config'-Rückgabewerte und Fehlermeldungen Optionen: -%c, --help zeigt die Hilfe -%c, --version zeigt die Programmverion an -%c, --quiet unterdrückt die Startmeldung -%c, --detach[=PIDFILE] startet %s als Hintergrundprozess und verwendet ggf. eine alternative PID-Datei (Default: %s) -%c, --configfile=CONFIG benutze alternative Konfigurationsdatei (Default: %s) Siehe Konfigurationsdatei für weitere Optionen. Verwaisten Serverport gelöscht. Alle laufenden Clients müssen neu gestartet werden. PMU Treiber für LCD HintergrundbeleuchtungDer Pfad von '%s' ist zu lang. Zugriff verweigertBitte überprüfen Sie ihre CDROM Einstellungen in der Konfigurationsdatei Privater TagRegistrierung fehlgeschlagenSICHERHEIT: Der Besitzer von %s und PBButtonsd müssen identisch sein. SICHERHEIT: %s darf nur durch den Besitzer von PBButtonsd schreibbar sein. Script '%s' %s Script '%s' nicht ausgeführt - fork() ist fehlgeschlagen. Script '%s' existiert nicht. Script '%s' gestartet, aber mit Fehlercode %d beendet. Script '%s' gestartet, aber durch ein Signal beendet. Script '%s' gestartet, aber nach %d Sekunden abgebrochen. Script '%s' gestartet und normal beendet. Script '%s' übergangen weil nicht sicher. Script darf nur vom Besitzer schreibbar sein.Server läuft bereitsDer Server antwortete nicht, Timeout. Der Server darf nur einmal gestartet werden. Server nicht gefundenSetzen von %s fehlgeschlagen: %s. Kann Daten für %s nicht bekommen: %s.Soundsystem angefordert: %s und letztlich aktiviert: %s. Soundsystem angefordert: %s, erkannt: %s und letztlich aktiviert: %s. Unterstützte Befehle: Unterstützte Tags: SysFS Treiber für LCD HintergrundbeleuchtungDas führende 'TAG_' kann weggelassen werden. Das Objekt '%s' existiert nicht. Das Object '%s' ist kein blockorientiertes Gerät. Das Objekt '%s' ist kein zeichenorientiertes Gerät. Das Objekt '%s' ist kein Verzeichnis. Das Objekt '%s' ist keine Datei. Zu viele Formatzeichen. Max. drei %%s in TAG_SCRIPTPMCS erlaubt. Zu viele ALSA Elemente angegeben, Bufferüberlauf. Unbekanntes PowerBookBesitzer des Scripts unsicherBenutzung: Benutzung: %s [Optionen]... WARNUNGWARNUNG: Tag %s wird nicht unterstützt. Vorgehen bei leerer BatterieSchwelle für Umgebungslicht in Prozent.Schwelle für Umgebungslicht in Prozent.Ungültiges ArgumentArbeitsbereich der automatischen RegelungAutomatische Erfassung zus. TastaturenPiepe, wenn nichts anderes anzeigt, das der Rechner lebtnicht ausgeführt - fork() ist fehlgeschlagenKonfigdatei [%s] ist unsicher; speichern der Konfig gesperrt. Konfigdatei [%s] nicht schreibbar; speichern der Konfig gesperrt. existiert nichtfehlgeschlagen - unbekannter FehlercodeErste Batterie Warnstufe, Zeit in MinutenFehler im FormatFunktion nicht unterstütztAnfangshelligkeit des Displays in ProzentAnfangshelligkeit der Tastaturbeleuchtung in ProzentStartwert in Prozent für KBD ein/aus Taster.Anfangslautstärke der LautsprecherLetzte Batterie Warnstufe, Zeit in Minutengestartet, aber der Exitcode ist nicht Nullgestartet, aber beendet durch ein Signalgestartet, aber nach %d Sekunden abgebrochengestartet und normal beendetAnfangszustand Stumm?derzeit nur bei Aluminium PowerBooksFehler beim Öffnenpbbcmd, Version %sPmud Unterstützung vorhanden und aktiviert. Wert kann nur gelesen werdenSpeichern der Konfig auf %s freigegeben. Zweite Batterie Warnstufe, Zeit in Minutensiehe TimerAction für mögliche Werteübergangen weil nicht sicherschaltet das Trackpad in 'notap'-Modus während des Schreibens.Zeit in SekundenZeit in Sekunden, die Scripten zur Verfügung steht.Bandbreite in Bytes/sUnbekannter TagBenutzer, der die IPC Services nutzen darfWert in ProzentWerte >0 sind gefährlich, wenn der Powerknopf als Einschlafftaste benutzt wirdWert kann nur geschrieben werdenpbbuttonsd-0.7.9/po/ca.gmo0000644000175000017500000003572110507722362012355 00000000000000•Þ„<³\ (g )Y ‘ ë* 2 /& b5 ‰/ ¿ ï1 B 9 | ‹  ” ™ ®) ¸) â *8=c2¡)ÔDþC']…£Á$Û!7"Zt3”>È//7g9m§%Á7ç6$V{ަÂÒçBì/Jh3‚P¶=2EÉxüBR?’¬8¾ ÷<T"d‡,ž=Ë $56ZD‘Öë$ü?!/a‘£¹ÁÙá$9&>`Ÿ°!Ð4ò!'9I=ƒ ÁÏ(ë !8'M u–#³×ô $/%Bh x)™#Ãç,4-Dr …‘°FÁ t g!Žd!ö"[%"u4"›1"Ð.#-#1#_7#yS#±$$$$/$! $Q9$^2$˜&$Ë#$ò7%S%NT%¢5%÷e&-%&“:&¹)&ô)' 'H3'i.'C'Ì!(%(2S(X`(¬D) ;)R)ŽH)”)Ý/)öN*&=*u1*³*å&*û,+"+O$+j +I+›+å,(,8,Gj,€H,ë4-4ï-i>.YN0˜"0ç1 H11c1t>1†1ÅB1à2#?2CB2ƒ2Æ"2Þ%323'E3Z3 3¶#3ÍC3ñ1454g)4|4¦4µ4Ó,4ÜA5 W5KX5£5ü%6565H6k)6´V6Þ`75 7–#7¢@7Æ888,@8D,8…$8²*8×99"9=9`9q=9„9Â)9Ú?:':D:l1:‰:».:Ë:ú;!;#;E[;Z;¶)$Ny1]vq9>@2EWmjuY8&[}Z3QG!nwBk_,€p4o.?t*^~\50g`A C„<cJf R("{K;a/iF I6-D|lsMT xPSd‚7%H: ' =OXƒ+bezLUh#rV PID | Name | Port | Flags ------+----------------------+---------+----------- # Configuration file for pbbuttonsd >= version 0.5 # for options see man pbbuttonsd.conf %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %s'' or '', '0 = no smooth fadingALSA Card name too long. Buffer overflow Action (see TimerAction) for the sleepkeyBuffer overflowCan't attach card '%s': %s Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't load card '%s': %s Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register configuration section %s, out of memory.Can't register mixer: %s Card '%s' has no '%s' element. Couldn't read configfile [%s, %s], using defaults. Couldn't read configfile [%s, out of memory], using defaults. Couldn't write configfile [%s, out of memory]. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a charakter deviceFile not a fileHelp or version infoINFOLMU found, ambient light sensor and keyboard illumination active. Memory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. MixerInitDelay is not possible with automatic mixer detection; option disabled. No event devices available. Please check your configuration. Option 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. Path of '%s' is to long. Permission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. Script '%s' %s Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Soundsystem requested: %s and at least activated: %s. Soundsystem requested: %s, detected: %s and at least activated: %s. Supported commands: Supported tags: The leading 'TAG_' could be omited. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Too much ALSA elements given. Buffer overflow. Unknown PowerBookUnsecure script ownerUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. action, if battery is critically lowambient light threshold in percent for backlight autoadj.ambient light threshold in percent for keyboard light autoadj.argument invalidautoadjustment range parametersautomatic rescan of event devicesbeep, if nothing else showed that the computer livescan't be launched - fork() failedconfig file [%s] is insecure, saving of config disabled. config file [%s] is not writable, saving of config disabled. doesn't existfailed - unknown error codefirst battery warnlevel, time in minutesformat errorfunction not supportedinitial volume levellast battery warnlevel, time in minuteslauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallymute after startup?only on Aluminum PowerBooksopen errorpbbcmd, version %spmud support compiled in and active. read-only valuesaving of config enabled to %s. second battery warnlevel, time in minutessee TimerAction for possible valuesskipped because it's not secureswitch trackpad to 'notap-mode' while typingtime in secondstimeout in seconds for launched scripts, etc.traffic in Bytes/sunknown taguser who is allowed to use IPCvalue in percentvalues > 0 may be dangerous, if the power key is used to trigger sleepwrite-only valueProject-Id-Version: ca Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2006-10-01 13:22+0200 PO-Revision-Date: 2005-07-04 11:30+0200 Last-Translator: Oriol Pellicer i Sabrià Language-Team: català MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.10 PID | Nom | Port | Flags ------+----------------------+---------+----------- # Arxiu de configuració per al pbbuttonsd >= versió 0.5 # per a opcions veure man pbbuttonsd.conf %-14s - expulsa el cdrom %-14s - llista els clients associats %-14s - interroga el servidor per certs paràmetres %-14s - reconfigura els paràmetres del servidor %-14s - reinicialitza el teclat i el trackpad %-14s - desa la configuració actual al disc %-14s - suspèn a la RAM %s (versió %s) - client de control per al pbbuttonsd. %s - dimoni per al suport de característiques especials en ordinadors portàtils. %s, versió %s'' o '', '0 = cap degradació de lluminositat del monitorEl nom de la tarja ALSA és massa llarg. Buffer overflow Acció (veure TimerAction) per la tecla d'adormidaDesbordament de la memòria intermitjaNo es pot afegir la tarja '%s': %s No es pot crear el port de missatges pel servidor. %s. No es troba el pmud en el port 879. Provocant directament PMU per adormir l'equip. No es pot accedir al devmask del mesclador [%s]; utilitzant els valors per defecte. No es pot accedir al volum del canal principal [%s]. No es pot instal·lar el manegador de les entrades PMU. Es pot trobar a faltar alguna funcionalitat. No es pot carregar la tarja '%s': %s No es pot obrir %s. L'expulsió del CDROM no funcionarà. No es pot obrir el dispositiu ADB %s: %s No es pot obrir el dispositiu PMU %s: %s No es pot obrir la tarja %s: %s No es pot obrir el dispositiu de framebuffer '%s'. No es pot obrir la unitat mescladora [%s]. %s No es pot registrar la secció de configuració %s, sense memòria.No es pot obrir el mesclador: %s La tarja '%s' no té l'element '%s'. No es pot llegir l'arxiu de configuració [%s, %s], utilitzant valors per defecte. No es pot llegir l'arxiu de configuració [%s, fora de memòria] utilitzant valors per defecte. No es pot escriure l'arxiu de configuració [%s, fora de memòria]. cicle de bateria actual: %d, fitxer de registre actiu: %s. ERRORERROR: S'han trobat problemes llegint l'arxiu de configuració [%s]: %s ERROR: Falten arguments ERROR: No queda suficient memòria pel buffer. ERROR: Problemes amb IPC, pot ser que el servidor no estigui en funcionament. ERROR: Resposta inesperada del servidor, codi d'acció: %ld. ERROR: la parella etiqueta/data no és completa. El fitxer no existeixEl fitxer no és un dispositiu de blocEl fitxer no és un dispositiu de caràctersEl fitxer no és un fitxerAjuda o informació sobre la versióINFORMACIÓTrobat LMU, sensor de llum d'ambient i d'il·luminació de teclat actiu. Memory allocation failed. Memory allocation failed: %s El port de missatges no està disponibleEl mesclador '%s' no té control de volum del playback. El valor MixerInitDelay no és possible amb la detecció automàtica del mesclador; opció deshabilitada. No hi ha disponible cap dispositiu d'events. Comprova la configuració. L'opció 'ALSA_Elements' no conté elements vàlids Opcions: -%c, --help mostra per pantalla aquesta ajuda i surt -%c, --version mostra per pantalla informació sobre la versió i surt -%c, --ignore ignora valors de configuració i d'error Opcions: -%c, --help mostra aquest text i surt -%c, --version mostra informació sobre la versió i surt -%c, --quiet elimina els missatges de benvinguda -%c, --detach[=PIDFILE] inicia %s com a procés en segon pla i opcionalment utilitza un arxiu identificador alternatiu (per defecte: %s) -%c, --configfile=CONFIG utilitza un arxiu de configuració alternatiu (per defecte: %s) per a més opcions consulta l'arxiu de configuració. S'ha eliminat un "orphaned server port". S'han de reiniciar tots els clients. La ruta de '%s' és massa llarga. Permís denegatSisplau comprova la configuració del CDROM al fitxer de configuració. Etiqueta privadaError de registreSEGURETAT: %s ha de ser del mateix propietari que pbbuttonsd. Arxiu de comandes '%s' %s Només el propietari ha de poder escriure en el fitxer de comandesEl servidor ja està funcionantTemps finalitzat, el servidor no ha pogut enviar una resposta. El servidor ja està funcionant. Només es permet una instància. No es troba el servidorL'ajustament de %s ha fallat: %s. No es pot obtenir la data per %s: %s.Sistema de so requerit: %s i almenys activat: %s. Sistema de so requerit: %s, detectat: %s i com a mínim activat: %s. Comandes suportades: Etiquetes suportades: El primer 'TAG_' podria ser omès. Massa signes de format. Màxim tres %%s permesos a TAG_SCRIPTPMCS. S'han donat massa elements ALSA. Buffer overflow PowerBook desconegutPropietari del fitxer de comandes insegurUtilització: Utilització: %s[OPCIÓ]... ATENCIÓATENCIÓ: No està suportada l'etiqueta %s. acció, si el nivell de càrrega de bateria és críticament baixinterval de llum ambiental en percentatge per a l'autoajustament de la llum del darrerainterval de llum ambiental (en percentatge) per a l'autoajustament de la llum del teclatargument no vàlidparàmetres del rang d'autoajustamentexploració automàtica de dispositius d'esdevenimentpita, si no hi ha cap altre indici que l'ordinador està en funcionamentno pot ser llançat - ha fallat el fork()el fitxer de configuració [%s] és insegur, deshabilitant el desar la configuració. no es pot escriure en el fitxer de configuració [%s], deshabilitant el desar la configuració. no existeixha fallat - codi d'error desconegutprimera alerta de nivell de càrrega de bateria, temps en minutserror de formatfunció no suportadanivell inicial de volumúltima alerta de nivell de càrrega de bateria, temps en minutsllançat però el codi de sortida no és nulllançat però finalitzat per senyalllançat però matat després de %d segonsllançament i sortida normalsilenciat després d'iniciar?només en els Powerbooks d'aluminierror d'oberturapbbcmd, versió %sestà compilat amb support per pmud i aquest es troba actiu. valor de només lecturaguardar la configuració habilitat a %s. segona alerta de nivell de càrrega de bateria, temps en minutsVeure TimerAction pels valors possiblesignorat perquè no és segurcanvia el 'trackpad' a 'notap-mode' mentre escriutemps en segonstimeout en segons pels scripts llançats, etc.trànsit en Bytes/setiqueta desconegudaUsuari a qui es permet usar l'IPCvalor en percentatgevalors més grans de 0 poden ser perillosos si s'utilitza la tecla d'apagarper a l'adormidavalor de només escripturapbbuttonsd-0.7.9/po/es.gmo0000644000175000017500000004020610507722362012373 00000000000000•ÞŽŒ¿ü øg ùY a »* Ô2 ÿ& 25 Y/  ¿ Ø1 ðB"etv}‚ —)¡)Ëõ!')C*m=˜2Ö) D3x'’ºØö$!57W©3É>ý/</lœ9¢Ü%ö76T$‹°ÃÛ÷?!Ba¤¿Ý3÷P+=|2ºÉíü·R´!83 lx<Œ?É "<,S=€¾Ï$ê6DF‹ $±Ö'ö+$Jo?/Ïÿ'/GO$o9”>Î !>4`!•9·=ñ /=(Y ‚¦'» ã # ! E b v ’ % ° Ö æ)!#!1!U,!u!¢-!²!à !ó!ÿ"F"/"vã"‡j$ko$Ö%F1%`1%’,%Ä.%ñ/& &P&j6&‚S&¹' '''$') 'CB'Q7'”'Ì0'å%(9(<8(vP(¯T)3)Ud)‰$)î2*)*F)*p#*š0*¾1*ïL+!0+n++ŸW+Ën,#O,’=,â- F-&-m.-E-¼?.-.B.p'.‚*.ª.Õ.î/ K/L/^"/«#/Î /òH0g0\U0Ä61á1QB23g4v$4Þ5<55Q5b85tF5­5ôA6!6H56jL6 6í"7/7'>7WL7–7ã7ø%88508P38!8µ!8×Q8ùC9K99¥9À9Æ 9Ü19è,:E:GD::Ò!:å7;4;?$;tX;™d;ò >$>1>V.>l5>›3>Ñ ?3?&?Z.?m?œ?°(?Å?îk@@ni'O= d`Z>2B} zu7? QG%8{v‰ ;rV[.Xwx0pk|S4:y$96,nŠI(l„@<msT1C!D…‹3‚† EWŽPtg&Fbh"+~\*-HA)eNYfaKM€ƒ^U5# _cŒjoLˆ/q‡RJ] PID | Name | Port | Flags ------+----------------------+---------+----------- # Configuration file for pbbuttonsd >= version 0.5 # for options see man pbbuttonsd.conf %-14s - eject the CDROM %-14s - prints a list of clients attached %-14s - queries the server for certain parameters %-14s - reconfigure server parameters %-14s - reinitialising the keyboard and the trackpad %-14s - save the current configuration to disk %-14s - suspend to Disk %-14s - suspend to RAM %s (version %s) - control client for pbbuttonsd. %s - daemon to support special features of laptops and notebooks. %s, version %s'' or '', '0 = no smooth fadingALSA Card name too long. Buffer overflow Action (see TimerAction) for the sleepkeyBuffer overflowCan't access i2c device %s - %s. Can't attach card '%s': %s Can't create IBaM object, out of memory. Can't create message port for server: %s. Can't find pmud on port 879. Trigger PMU directly for sleep. Can't get devmask from mixer [%s]; using default. Can't get volume of master channel [%s]. Can't install PMU input handler. Some functionality may be missing. Can't load card '%s': %s Can't open %s. Eject CDROM won't work. Can't open ADB device %s: %s Can't open PMU device %s: %s Can't open card '%s': %s Can't open framebuffer device '%s'. Can't open mixer device [%s]. %s Can't register configuration section %s, out of memory.Can't register mixer: %s Card '%s' has no '%s' element. Couldn't read configfile [%s, %s], using defaults. Couldn't read configfile [%s, out of memory], using defaults. Couldn't write configfile [%s, out of memory]. Current battery cycle: %d, active logfile: %s. ERRORERROR: Have problems reading configuration file [%s]: %s ERROR: Missing arguments ERROR: Not enough memory for buffer. ERROR: Problems with IPC, maybe server is not running. ERROR: Unexpected answer from server, actioncode %ld. ERROR: tag/data pairs not complete. File doesn't existFile not a block deviceFile not a charakter deviceFile not a fileHelp or version infoINFOInsufficient permissions for object %s, at least '0%o' needed. LMU found, ambient light sensor and keyboard illumination active. Memory allocation failed. Memory allocation failed: %s Messageport not availableMixer element '%s' has no playback volume control. MixerInitDelay is not possible with automatic mixer detection; option disabled. No event devices available. Please check your configuration. Option 'ALSA_Elements' contains no valid elements Options: -%c, --help display this help and exit -%c, --version display version information and exit -%c, --ignore ignore config return and error values Options: -%c, --help display this help text and exit -%c, --version display version information and exit -%c, --quiet suppress welcome message -%c, --detach[=PIDFILE] start %s as background process and optional use an alternative pid-file (default: %s) -%c, --configfile=CONFIG use alternative configuration file (default: %s) see configuration file for more options. Orphaned server port found and removed. All running clients have to be restarted. Path of '%s' is to long. Permission deniedPlease check your CDROM settings in configuration file. Private TagRegistration failedSECURITY: %s must be owned by the same owner as pbbuttonsd. SECURITY: %s must only be writable by the owner of pbbuttonsd. Script '%s' %s Script must be write-only by ownerServer already runningServer didn't send an answer and timed out. Server is already running. Sorry, only one instance allowed. Server not foundSetting of %s failed: %s. Sorry, Couldn't get data for %s: %s.Soundsystem requested: %s and at least activated: %s. Soundsystem requested: %s, detected: %s and at least activated: %s. Supported commands: Supported tags: The leading 'TAG_' could be omited. The object '%s' doesn't exist. The object '%s' is not a block device. The object '%s' is not a character device. The object '%s' is not a directory. The object '%s' is not a file. Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS. Too much ALSA elements given. Buffer overflow. Unknown PowerBookUnsecure script ownerUsage: Usage: %s [OPTION]... WARNINGWARNING: tag %s not supported. action, if battery is critically lowambient light threshold in percent for backlight autoadj.ambient light threshold in percent for keyboard light autoadj.argument invalidautoadjustment range parametersautomatic rescan of event devicesbeep, if nothing else showed that the computer livescan't be launched - fork() failedconfig file [%s] is insecure, saving of config disabled. config file [%s] is not writable, saving of config disabled. doesn't existfailed - unknown error codefirst battery warnlevel, time in minutesformat errorfunction not supportedinitial volume levellast battery warnlevel, time in minuteslauched but exitcode is not nulllauched but exited by signallauched but killed after %d secondslaunched and exited normallymute after startup?only on Aluminum PowerBooksopen errorpbbcmd, version %spmud support compiled in and active. read-only valuesaving of config enabled to %s. second battery warnlevel, time in minutessee TimerAction for possible valuesskipped because it's not secureswitch trackpad to 'notap-mode' while typingtime in secondstimeout in seconds for launched scripts, etc.traffic in Bytes/sunknown taguser who is allowed to use IPCvalue in percentvalues > 0 may be dangerous, if the power key is used to trigger sleepwrite-only valueProject-Id-Version: pbbuttonsd 0.7.3 Report-Msgid-Bugs-To: matthiasgrimm@users.sourceforge.net POT-Creation-Date: 2006-10-01 13:22+0200 PO-Revision-Date: 2006-07-29 20:10+0100 Last-Translator: Matthias Grimm Language-Team: Debian l10n spanish team MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Poedit-Language: Spanish X-Poedit-SourceCharset: iso-8859-1 PID | Nombre | Puerto | Banderas -------+----------------------+---------+----------- # Fichero de configuración para pbbuttonsd >= versión 0.5 # para saber las opciones véase: man pbbuttonsd.conf %-14s - expulsa el CDROM %-14s - imprime una lista de clientes conectados %-14s - consulta ciertos parámetros del servidor %-14s - reconfigura parámetros del servidor %-14s - reinicializando el teclado y trackpad %-14s - guarda a disco la configuración actual %-14s - suspende a disco %-14s - suspende a RAM %s (versión %s) - cliente de control para pbbuttonsd. %s - demonio para soporte de características especiales de ordenadores portátiles. %s, versión %s'' o '', '0 = sin desvanecido suaveNombre de tarjeta ALSA demasiado largo. Desbordamiento de buffer. Acción (vea «TimerAction») para la tecla de hibernaciónDesbordamiento de bufferNo se puede acceder a dispositivos i2c %s - %s. No se puede activar tarjeta «%s»: %s No se pudo crear objeto IBaM, no hay memoria suficiente. No se puede crear puerto de mensajes para servidor: %s. No se pudo encontrar pmud en puerto 879. Usar direcamente PMU para hibernación. No se puede obtener devmask para mezclador [%s]; se usarán valores predeterminados. No se puede obtener volumen de canal maestro [%s]. No se pudo instalar gestor de entrada de PMU. Algunas funcionalidades podrían no estar disponibles. No se puede cargar tarjeta «%s»: %s No se puede abrir %s. No se podrá expulsar CDROM. No se puede abrir dispositivo ADB %s: %s No se puede abrir dispositivo PMU %s: %s No se puede abrir tarjeta «%s»: %s No se puede abrir dispositivo framebuffer «%s». No se puede abrir dispositivo de mezcla [%s]. %s No se pudo registrar sección de configuración %s, no hay memoria suficiente.No se puede registrar dispositivo de mezcla: %s La tarjeta «%s» no tiene el elemento «%s». No se puede leer fichero de configuración [%s, %s], se usarán valores predeterminados. No se puede leer fichero de configuración [%s, no hay memoria disponible], se usarán valores predeterminados. No se puede escribir fichero de configuración [%s, no hay memoria disponible]. Ciclo actual de batería: %d, fichero de registro activo: %s. ERRORERROR: Ocurrieron problemas al leer fichero de configuración [%s]: %s ERROR: No se indico argumentos ERROR: No hay suficiente memoria para buffer. ERROR: Problemas con IPC, tal vez el servidor no se está ejecutando. ERROR: Respuesta de servidor inesperada, código de acción %ld. ERROR: El par etiqueta/data está incompleto. Fichero no existeFichero no es un dispositivo de bloquesFichero no es un dispositivo de caracteresFichero no es un ficheroAyuda o información de versiónINFOPermisos insuficientes para el objeto «%s», se requiere como mínimo «0%o». LMU encontrado, sensor de luz de ambiente e iluminación de teclado activas. Fallo en asignamiento de memoria. Fallo en asignación de memoria: %s Puerto de mensajes no disponibleEl elemento mezclador «%s» no tiene control de volumen de reproducción. No es posible definir «MixerInitDelay» con la detección automática de mezclador: Opción deshabilitada. No existen dispositivos de eventos disponibles. Por favor verifique suconfiguración. La opción «ALSA_Elements» no tiene elementos válidos. Opciones: -%c, --help muestra esta ayuda y finaliza -%c, --version muestra información de versión y finaliza -%c, --ignore ignora valores de retorno de configuración y errores Opciones: -%c, --help muestra este mensaje y finaliza -%c, --version muestra información de versión y finaliza -%c, --quiet no muestra el mensaje de bienvenida -%c, --detach[=FICHEROPID] inicia %s como proceso en segundo plano y opcionalmente usa un fichero pid alternativo (predeterminado: %s) -%c, --configfile=CONFIG usar un fichero de configuración alternativo (predeterminado: %s) véase ficheros de configuración para más opciones. Se ha encontrado un puerto de servidor huérfano y se ha eliminado. Sedebe reiniciar todos los clientes La ruta de «%s» es demasiado larga. Permiso denegadoPor favor verifique los valores de configuración del CDROM. Etiqueta privadaFallo de registroSEGURIDAD: %s debe tener el mismo dueño que pbbuttonsd. SEGURIDAD: Sólo el dueño del proceso pbbuttonsd puede escribir en %s. Programa «%s» %s El programa debe tener permisos de escritura solamente para dueñoEl servidor ya se está ejecutandoEl servidor no ha enviado respuesta y ha finalizado. El servidor ya se está ejecutando. Disculpe, solo se permite una instancia. Servidor no encontradoFallo en configuración de %s: %s. Disculpe, no se puede obtener data para %s: %s.Sistema de sonido solicitado: %s y por lo menos activado: %s. Sistema de sonido solicitado: %s, detectado: %s y por lo menos activado: %s Ordenes soportadas: Etiquetas soportadas: El prefijo «TAG_» puede ser omitido. El objeto «%s» no existe. El objeto «%s» no es un dispositivo de bloques. El objeto «%s» no es un dispositivo de caracteres. El objeto «%s» no es un fichero. El objeto «%s» no es un fichero. Demasiados signos de formato. El máximo permitido es tres %%s en TAG_SCRIPTPMCS. Se ha indicado demasiados elementos ALSA. Debordamiento de buffer. PowerBook desconocidaDueño de programa inseguroUso: Uso: %s [OPCIÓN]... ADVERTENCIAADVERTENCIA: La etiqueta «%s» no está soportada. Acción, si la batería está críticamente bajaNivel de luz ambiental en porcentaje para autoajuste de luz posteriorPorcentaje de nivel de luz ambiental para autoajustar luz posterior.Argumento inválidoRango de parámetros de autoajusteRealizar búsqueda automática de eventos en dispositivosPitido, si nada muestra que el ordenador está activoNo se puede cargar - fallo en fork()El fichero de configuración [%s] es inseguro, se deshabilitará elguardar configuración. No se puede escribir en el fichero de configuración [%s], sedeshabilitará el guardar configuración. No existeFallo - código de fallo desconocidoPrimer nivel de alerta de batería, tiempo en minutosError de formatoFunción no soportadaNivel inicial de volumenÚltimo nivel de alerta de batería, tiempo en minutosCargado pero código de finalización no es «null»Cargado pero finalizado por señalCargado pero terminado después de %d segundosCargado y finalizado normalmente¿Silenciar antes de carga?Solamente en PowerBooks AluminumError de aperturapbbcmd, versión %sSoporte de pmud compilado y activo. Valor de solo lecturaHabilitado el guardado de configuración a %s. Segundo nivel de alerta de batería, tiempo en minutosVéase «TimerAction» para saber los valores posiblesPasado debido a que no es seguroCambiar trackpad a «modo notap» mientras se escribeTiempo en segundosTiempo de espera para programas cargados, etc.Tráficos en Bytes/sEtiqueta desconocidaUsuario que tiene permisos para usar IPCValor en porcentajeLos valores mayores a 0 podrían ser peligrosos, si el botón de energía es usado para activar la hibernaciónValor de solo escriturapbbuttonsd-0.7.9/po/ChangeLog0000644000175000017500000001454310002204204013013 000000000000002004-01-17 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2004-01-17 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2004-01-08 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-27 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-19 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-05 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-12-05 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-12 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-10 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-09 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-08 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-04 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-11-01 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-31 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-29 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-07 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-06 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-06 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-10-02 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-30 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-24 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-23 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-22 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. 2003-09-13 gettextize * Makefile.in.in: Upgrade to gettext-0.10.40. pbbuttonsd-0.7.9/src/0000777000175000017500000000000010507757762011527 500000000000000pbbuttonsd-0.7.9/src/Makefile.in0000644000175000017500000003765510507757761013527 00000000000000# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CXX = @CXX@ DATADIRNAME = @DATADIRNAME@ GENCAT = @GENCAT@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_LIB = @HAVE_LIB@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_WPRINTF = @HAVE_WPRINTF@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LIB = @LIB@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LN_S = @LN_S@ LTLIB = @LTLIB@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ PACKAGE = @PACKAGE@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PB_LIBS = @PB_LIBS@ PB_OBJECTS = @PB_OBJECTS@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ RANLIB = @RANLIB@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ localstatedir = @localstatedir@ INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbuttonsd pbbuttonsd_SOURCES = pbbuttonsd.c init.c init.h systems.h input_manager.c input_manager.h support.c support.h config_manager.c config_manager.h module_pmac.c module_pmac.h module_system.c module_system.h module_powersave.c module_powersave.h module_display.c module_display.h module_cdrom.c module_cdrom.h module_mixer.c module_mixer.h module_ossmixer.c module_ossmixer.h module_alsamixer.c module_alsamixer.h class_backlight.c class_backlight.h driver_backlight_sysfs.c driver_backlight_sysfs.h driver_backlight_pmu.c driver_backlight_pmu.h gettext_macros.h pbbinput.h EXTRA_pbbuttonsd_SOURCES = ibam_stub.cpp ibam_stub.h ibam.hpp ibam.inl module_peep.c module_peep.h debug.h tcp.c tcp.h pbbuttonsd_LDADD = -lpbb $(INTLLIBS) $(ALSA_LIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@ pbbuttonsd_LDFLAGS = -L$(top_srcdir)/libpbbipc pbbuttonsd_DEPENDENCIES = $(PB_OBJECTS) @DEBUG_TRUE@AM_CFLAGS1 = -DDEBUG @DEBUG_TRUE@AM_CXXFLAGS = -DDEBUG AM_CFLAGS = $(AM_CFLAGS1) $(ALSA_CFLAGS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ pbbuttonsd_OBJECTS = pbbuttonsd.o init.o input_manager.o support.o \ config_manager.o module_pmac.o module_system.o module_powersave.o \ module_display.o module_cdrom.o module_mixer.o module_ossmixer.o \ module_alsamixer.o class_backlight.o driver_backlight_sysfs.o \ driver_backlight_pmu.o CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(pbbuttonsd_SOURCES) $(EXTRA_pbbuttonsd_SOURCES) OBJECTS = $(pbbuttonsd_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cpp .o .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: pbbuttonsd: $(pbbuttonsd_OBJECTS) $(pbbuttonsd_DEPENDENCIES) @rm -f pbbuttonsd $(LINK) $(pbbuttonsd_LDFLAGS) $(pbbuttonsd_OBJECTS) $(pbbuttonsd_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = src distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done class_backlight.o: class_backlight.c ../config.h systems.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h class_backlight.h \ driver_backlight_pmu.h driver_backlight_sysfs.h config_manager.o: config_manager.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h gettext_macros.h \ input_manager.h ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h driver_backlight_pmu.o: driver_backlight_pmu.c ../config.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h module_pmac.h \ ../libpbbipc/pbbtaglist.h class_backlight.h \ driver_backlight_pmu.h support.h driver_backlight_sysfs.o: driver_backlight_sysfs.c ../config.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h class_backlight.h \ ../libpbbipc/pbbtaglist.h driver_backlight_sysfs.h debug.h ibam_stub.o: ibam_stub.cpp ../config.h debug.h ibam.hpp ibam.inl init.o: init.c ../config.h systems.h pbbinput.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h init.h \ gettext_macros.h input_manager.h ../libpbbipc/pbbtaglist.h \ config_manager.h ../libpbbipc/pbblist.h module_pmac.h \ class_backlight.h module_system.h module_powersave.h \ module_display.h debug.h module_cdrom.h module_mixer.h \ module_ossmixer.h module_alsamixer.h module_peep.h input_manager.o: input_manager.c ../config.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h systems.h init.h \ input_manager.h ../libpbbipc/pbbtaglist.h module_alsamixer.o: module_alsamixer.c ../config.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_mixer.h module_alsamixer.h \ support.h module_backlight.o: module_backlight.c ../config.h systems.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h module_pmac.h module_backlight.h \ support.h debug.h module_cdrom.o: module_cdrom.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h pbbinput.h \ gettext_macros.h input_manager.h ../libpbbipc/pbbtaglist.h \ config_manager.h ../libpbbipc/pbblist.h module_cdrom.h \ support.h debug.h module_display.o: module_display.c ../config.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h input_manager.h \ ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_display.h debug.h support.h \ gettext_macros.h module_mixer.o: module_mixer.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h gettext_macros.h \ input_manager.h ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_mixer.h module_ossmixer.h \ module_alsamixer.h support.h module_ossmixer.o: module_ossmixer.c ../config.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_mixer.h module_ossmixer.h \ support.h module_peep.o: module_peep.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h gettext_macros.h \ input_manager.h ../libpbbipc/pbbtaglist.h module_peep.h \ module_pmac.h support.h debug.h module_pmac.o: module_pmac.c ../config.h systems.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_pmac.h support.h debug.h module_powersave.o: module_powersave.c ../config.h pbbinput.h \ ../libpbbipc/pbb.h ../libpbbipc/pbbipc.h \ ../libpbbipc/pbbtaglist.h ../libpbbipc/pbberrno.h \ ../libpbbipc/pbbmisc.h ../libpbbipc/pbbtags.h \ ../libpbbipc/pbblist.h gettext_macros.h input_manager.h \ ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_powersave.h module_display.h \ debug.h support.h ibam_stub.h module_system.o: module_system.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h gettext_macros.h \ input_manager.h ../libpbbipc/pbbtaglist.h config_manager.h \ ../libpbbipc/pbblist.h module_system.h pbbuttonsd.o: pbbuttonsd.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h init.h \ input_manager.h ../libpbbipc/pbbtaglist.h gettext_macros.h support.o: support.c ../config.h ../libpbbipc/pbb.h \ ../libpbbipc/pbbipc.h ../libpbbipc/pbbtaglist.h \ ../libpbbipc/pbberrno.h ../libpbbipc/pbbmisc.h \ ../libpbbipc/pbbtags.h ../libpbbipc/pbblist.h support.h \ gettext_macros.h tcp.o: tcp.c ../config.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # 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: pbbuttonsd-0.7.9/src/Makefile.am0000644000175000017500000000226610506750756013500 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/libpbbipc @PACKAGE_CFLAGS@ bin_PROGRAMS = pbbuttonsd pbbuttonsd_SOURCES = \ pbbuttonsd.c \ init.c init.h systems.h \ input_manager.c input_manager.h \ support.c support.h \ config_manager.c config_manager.h \ module_pmac.c module_pmac.h \ module_system.c module_system.h \ module_powersave.c module_powersave.h \ module_display.c module_display.h \ module_cdrom.c module_cdrom.h \ module_mixer.c module_mixer.h \ module_ossmixer.c module_ossmixer.h \ module_alsamixer.c module_alsamixer.h \ class_backlight.c class_backlight.h \ driver_backlight_sysfs.c driver_backlight_sysfs.h \ driver_backlight_pmu.c driver_backlight_pmu.h \ gettext_macros.h pbbinput.h EXTRA_pbbuttonsd_SOURCES = ibam_stub.cpp ibam_stub.h ibam.hpp ibam.inl \ module_peep.c module_peep.h debug.h \ tcp.c tcp.h pbbuttonsd_LDADD = -lpbb $(INTLLIBS) $(ALSA_LIBS) $(PB_OBJECTS) $(PB_LIBS) @PACKAGE_LIBS@ pbbuttonsd_LDFLAGS = -L$(top_srcdir)/libpbbipc pbbuttonsd_DEPENDENCIES = $(PB_OBJECTS) if DEBUG AM_CFLAGS1 = -DDEBUG AM_CXXFLAGS = -DDEBUG endif AM_CFLAGS = $(AM_CFLAGS1) $(ALSA_CFLAGS) pbbuttonsd-0.7.9/src/pbbuttonsd.c0000644000175000017500000000460310451221764013760 00000000000000/* ---------------------------------------------------------------------------- * pbbuttons.c * Daemon to put the Apple Powerbook special keys into action. * This version works as deamon without any interface. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "init.h" #include "input_manager.h" #include "gettext_macros.h" int main(int argc, char *argv[]) { struct serverdata sdata, *sd = &sdata; gint timerid100, timerid1000; int rc = 1; long tval; #ifdef ENABLE_NLS setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR); textdomain(PACKAGE); #endif init_libpbb(); /* initialising pbblib */ init_serverdata (sd); /* fill serverdata structure with default values */ if ((rc = evaluate_args(sd, argc, argv)) == 0) { /* evaluate command line */ if ((rc = init_modules (sd)) == 0) { /* call known modules for initialisation */ tval = process_queue_single (QUERYQUEUE, TAG_IDENTITY, 0); if (!sd->quiet && tval) printf ("%s %s: %s\n", PACKAGE, VERSION, (char*) tval); if ((create_daemon ()) == 0) { if (tval) syslog (LOG_INFO, "INFO: %s %s: %s\n", PACKAGE, VERSION, (char*) tval); tval = process_queue_single (QUERYQUEUE, TAG_POWERSOURCE, 0); process_queue_single (CONFIGQUEUE, TAG_POWERCHANGED, tval); /* start profile changed script */ sd->mainloop = g_main_loop_new (NULL, TRUE); installSigHandler (sd); timerid100 = g_timeout_add (100, cb_timer100, NULL); timerid1000 = g_timeout_add (1000, cb_timer1000, NULL); g_main_loop_run (sd->mainloop); g_source_remove (timerid100); g_source_remove (timerid1000); g_main_loop_unref (sd->mainloop); } exit_modules (sd); /* let modules cleanup their stuff */ rc = 0; } } exit_libpbb(); /* cleanup library */ if (rc == E_INFO) rc = 0; /* E_INFO isn't a real error */ exit (rc); } pbbuttonsd-0.7.9/src/init.c0000644000175000017500000002752510507166001012541 00000000000000/* ---------------------------------------------------------------------------- * init.c * funtions that prepare program workflow and initialization * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "pbbinput.h" #include #include #include "init.h" #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #ifdef WITH_MODULE_PMAC # include "module_pmac.h" #endif #include "class_backlight.h" #include "module_system.h" #include "module_powersave.h" #include "module_display.h" #include "module_cdrom.h" #include "module_mixer.h" #include "module_ossmixer.h" #include "module_alsamixer.h" #ifdef DEBUG # include "module_peep.h" #endif void init_serverdata (struct serverdata *sd) { int n = 0; sd->prgname = NULL; sd->quiet = 0; sd->configreadfile = DEFAULT_CONFIG; sd->mainloop = NULL; sd->module[n].initfunc = inputmanager_init; sd->module[n].exitfunc = inputmanager_exit; /* pri 0 */ sd->module[n].openfunc = NULL; sd->module[n++].closefunc = NULL; sd->module[n].initfunc = configmanager_init; sd->module[n].exitfunc = configmanager_exit; /* pri 0 */ sd->module[n].openfunc = NULL; sd->module[n++].closefunc = NULL; sd->module[n].initfunc = NULL; sd->module[n].exitfunc = NULL; /* pri 0 */ sd->module[n].openfunc = ipc_init_stub; sd->module[n++].closefunc = ipc_exit; sd->module[n].initfunc = system_init; sd->module[n].exitfunc = system_exit; /* pri 1 */ sd->module[n].openfunc = system_open; sd->module[n++].closefunc = system_close; sd->module[n].initfunc = backlight_init; sd->module[n].exitfunc = backlight_exit; /* pri 1 */ sd->module[n].openfunc = backlight_open; sd->module[n++].closefunc = backlight_close; #ifdef WITH_MODULE_PMAC sd->module[n].initfunc = pmac_init; sd->module[n].exitfunc = pmac_exit; /* pri 1 */ sd->module[n].openfunc = pmac_open; sd->module[n++].closefunc = pmac_close; #endif sd->module[n].initfunc = power_init; sd->module[n].exitfunc = power_exit; /* pri 2 */ sd->module[n].openfunc = power_open; sd->module[n++].closefunc = power_close; sd->module[n].initfunc = display_init; sd->module[n].exitfunc = display_exit; /* pri 2 */ sd->module[n].openfunc = display_open; sd->module[n++].closefunc = display_close; sd->module[n].initfunc = cdrom_init; sd->module[n].exitfunc = cdrom_exit; /* pri 2 */ sd->module[n].openfunc = cdrom_open; sd->module[n++].closefunc = cdrom_close; sd->module[n].initfunc = mixer_init; sd->module[n].exitfunc = mixer_exit; /* pri 2 */ sd->module[n].openfunc = mixer_open; sd->module[n++].closefunc = mixer_close; #ifdef WITH_OSS sd->module[n].initfunc = ossmixer_init; sd->module[n].exitfunc = ossmixer_exit; /* pri 2 */ sd->module[n].openfunc = NULL; sd->module[n++].closefunc = NULL; #endif #ifdef WITH_ALSA sd->module[n].initfunc = alsamixer_init; sd->module[n].exitfunc = alsamixer_exit; /* pri 2 */ sd->module[n].openfunc = NULL; sd->module[n++].closefunc = NULL; #endif #ifdef DEBUG # if 1 sd->module[n].initfunc = peep_init; sd->module[n].exitfunc = peep_exit; /* pri 3 */ sd->module[n].openfunc = NULL; sd->module[n++].closefunc = NULL; # else sd->module[n].initfunc = NULL; sd->module[n].exitfunc = peep_exit; sd->module[n].openfunc = peep_open; sd->module[n++].closefunc = NULL; # endif #endif for (; n < MODULECOUNT; n++) { sd->module[n].initfunc = NULL; sd->module[n].openfunc = NULL; sd->module[n].closefunc = NULL; sd->module[n].exitfunc = NULL; } } /* This function calls every known module so that they initialize themselves * and prepare for configuration. If the initialization of a module failed, * all already loaded modules would be cleaned up. */ int init_modules(struct serverdata *sd) { struct tagitem *taglist, *tl1, tl2[2] = {{TAG_END, 0}, {TAG_END, 0}}; int n, rc = 0; for (n=0; n < MODULECOUNT; n++) if (sd->module[n].initfunc != NULL) if ((rc = sd->module[n].initfunc ())) { for (--n; n >= 0; n--) /* cleanup already initialized modules */ if (sd->module[n].exitfunc != NULL) sd->module[n].exitfunc (); break; /* critical error - program abortion */ } if (rc == 0) { taglist = tl1 = readConfigFile(sd->configreadfile); if (tl1 == NULL) taglist = tl2; taglist_add(taglist, TAG_CFGNAME, (long) sd->configreadfile); for (n=0; n < MODULECOUNT; n++) if (sd->module[n].openfunc != NULL) if ((rc = sd->module[n].openfunc (taglist))) { for (--n; n >= 0; n--) /* cleanup already initialized modules */ if (sd->module[n].closefunc != NULL) sd->module[n].closefunc (); for (n = MODULECOUNT-1; n >= 0; n--) if (sd->module[n].exitfunc != NULL) sd->module[n].exitfunc (); break; /* critical error - program abortion */ } if (rc == 0) { process_queue (CONFIGQUEUE, taglist); /* check if someone has set a tagerror and abort if necessary */ while (taglist->tag != TAG_END) { if (taglist->tag & FLG_ERROR) { if (taglist->data != E_NOSUPPORT) { exit_modules (sd); rc = taglist->data; /* error code */ break; /* critical error - program abortion */ } } taglist++; } } if (tl1 != NULL) free (tl1); } return rc; } /* This funcion calls the exit funcion of every know modules. The sequence * is from last to first, that means the module that was initialized first * will be cleaned up last. */ void exit_modules (struct serverdata *sd) { int n; for (n = MODULECOUNT-1; n >= 0; n--) if (sd->module[n].closefunc != NULL) sd->module[n].closefunc (); for (n = MODULECOUNT-1; n >= 0; n--) if (sd->module[n].exitfunc != NULL) sd->module[n].exitfunc (); } /* This function rereads the configuration file and sends the resulting taglist to all modules. */ void reconfig_modules(struct serverdata *sd) { struct tagitem *taglist; struct passwd *pwddata; long username; taglist = readConfigFile(sd->configreadfile); if (taglist != NULL) { ipc_filterclear(); process_queue (CONFIGQUEUE, taglist); if ((username = tagfind (taglist, TAG_USERALLOWED, -1)) != -1) { if ((pwddata = getpwnam((char *) username)) != NULL) ipc_filteruser(pwddata->pw_uid); else ipc_filterall(); /* switch off IPC-receive */ } free (taglist); } } int evaluate_args(struct serverdata *sd, int argc, char *argv[]) { struct option const long_options[] = { {"help", no_argument, 0, ARG_HELP}, {"version", no_argument, 0, ARG_VERSION}, {"detach", optional_argument, 0, ARG_DETACH}, {"quiet", no_argument, 0, ARG_QUIET}, {"configfile", required_argument, 0, ARG_CONFIG}, {NULL, 0, NULL, 0} }; int c, err; char *optarg2; if((sd->prgname = strrchr(argv[0],'/')) == NULL) sd->prgname = argv[0]; else sd->prgname++; /* ignore first slash*/ argv[0] = sd->prgname; while ((c = getopt_long (argc, argv, ARG_ALL, long_options, (int *) 0)) != EOF) { switch (c) { case ARG_VERSION: printf(_("%s, version %s"), PACKAGE, VERSION); printf(", (c) 2002-2005 Matthias Grimm\n"); return E_INFO; case ARG_DETACH: optarg2 = (optarg) ? optarg : argv[optind]; if (optarg2 == NULL || optarg2[0] == '-') optarg2 = DEFAULT_PIDFILE; prepare_daemon (sd->prgname, optarg2, PBBDF_FORCE); break; case ARG_QUIET: sd->quiet = 1; break; case ARG_CONFIG: if ((err = check_devorfile(sd->configreadfile = optarg, TYPE_FILE))) { printf (_("ERROR: Have problems reading configuration file [%s]: %s\n"), sd->configreadfile, strerror(errno)); return err; } break; case ARG_HELP: default: printf(_("%s - daemon to support special features of laptops and notebooks.\n"), sd->prgname); printf(_("Usage: %s [OPTION]... \n"), sd->prgname); printf (_("Options:\n" " -%c, --help display this help text and exit\n" " -%c, --version display version information and exit\n" " -%c, --quiet suppress welcome message\n" " -%c, --detach[=PIDFILE] start %s as background process and\n" " optional use an alternative pid-file\n" " (default: %s)\n" " -%c, --configfile=CONFIG use alternative configuration file\n" " (default: %s)\n" "see configuration file for more options.\n"), ARG_HELP, ARG_VERSION, ARG_QUIET, ARG_DETACH, sd->prgname, DEFAULT_PIDFILE, ARG_CONFIG, sd->configreadfile); return E_INFO; } } return 0; } /* --- Signal Handler --- */ /* Pipe must be global because there is no other way for the * signal handler to access this data */ static int SigHandlerPipe[2]; void cbSigHandlerTX (int signum) { write (SigHandlerPipe[1], &signum, sizeof(int)); } gboolean cbSigHandlerRD (int fd, gpointer user_data) { struct serverdata *base = user_data; int signum; gboolean rc = FALSE; if ((read (fd, &signum, sizeof(int))) == sizeof(int)) { switch (signum) { case SIGHUP: /* reload config file and reconfigure the modules */ scanEventDevices (); /* look which HID are available */ reconfig_modules (base); /* load config file again */ rc = TRUE; break; case SIGUSR1: /* reset hardware configuration */ process_queue_single (CONFIGQUEUE, TAG_REINIT, 0); rc = TRUE; break; case SIGINT: case SIGTERM: /* cleanup and exit the program */ close (SigHandlerPipe[0]); close (SigHandlerPipe[1]); g_main_loop_quit (base->mainloop); break; } } return rc; } void installSigHandler (struct serverdata *base) { struct sigaction sa = { {cbSigHandlerTX}, {{0}}, SA_RESTART, 0 }; InputSource *src; int n = 0; if ((pipe(SigHandlerPipe)) == 0) { src = addInputSource (SigHandlerPipe[0], cbSigHandlerRD, base, FALSE); if (!sigaction (SIGINT, &sa, NULL)) n++; if (!sigaction (SIGTERM, &sa, NULL)) n++; if (!sigaction (SIGHUP, &sa, NULL)) n++; if (!sigaction (SIGUSR1, &sa, NULL)) n++; if (n == 0) { g_source_remove (src->watch); close (SigHandlerPipe[0]); close (SigHandlerPipe[1]); } else if (n < 4) print_msg (PBB_WARN, _("Not all signal handlers could be installed.\n")); } else print_msg (PBB_WARN, _("Can't install any signal handler\n")); return; } int ipc_init_stub (struct tagitem *taglist) { int err; long username; struct passwd *pwddata; err = ipc_init (NULL, LIBMODE_SERVER, 0); switch (err) { case E_MSGPORT: print_msg (PBB_ERR, _("Can't create message port for server: %s.\n"), strerror(errno)); break; case E_TWICE: print_msg (PBB_ERR, _("Server is already running. Sorry, only one instance allowed.\n")); break; case E_OLDPORT: print_msg (PBB_WARN, _("Orphaned server port found and removed. All running clients have to be restarted.\n")); err = 0; case 0: if ((username = tagfind (taglist, TAG_USERALLOWED, -1)) != -1) { if ((pwddata = getpwnam((char *) username)) != NULL) ipc_filteruser(pwddata->pw_uid); else ipc_filterall(); /* switch off IPC-receive */ } break; } register_function (T100QUEUE, ipc_handler); /* input via IPC messages */ return err; } pbbuttonsd-0.7.9/src/init.h0000644000175000017500000000333710360306326012544 00000000000000#ifndef INCLUDE_INIT_H #define INCLUDE_INIT_H /* ---------------------------------------------------------------------------- * init.h * prototypes and definitions for init.c. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* short options for optarg */ #define ARG_ALL "hvqd::c:" #define ARG_HELP 'h' #define ARG_VERSION 'v' #define ARG_DETACH 'd' #define ARG_CONFIG 'c' #define ARG_QUIET 'q' #define DEFAULT_CONFIG SYS_CONF_DIR "/pbbuttonsd.conf" #define DEFAULT_PIDFILE "/var/run/" PACKAGE ".pid" #define MODULECOUNT 15 struct serverdata { char *prgname; char *configreadfile; /* configfile to read: eg. /etc/pbbuttonsd.conf * Writing the configfile will be controlled by * module_system. */ GMainLoop *mainloop; int quiet; struct { int (*initfunc)(); int (*openfunc)(struct tagitem *); int (*closefunc)(); int (*exitfunc)(); } module[MODULECOUNT]; }; /* prototypes */ void init_serverdata (struct serverdata *sd); int init_modules(struct serverdata *sd); void exit_modules(struct serverdata *sd); void reconfig_modules(struct serverdata *sd); int evaluate_args(struct serverdata *sd, int argc, char *argv[]); void cbSigHandlerTX (int signum); gboolean cbSigHandlerRD (int fd, gpointer user_data); void installSigHandler (struct serverdata *base); int ipc_init_stub (); #endif /* INCLUDE_INIT_H */ pbbuttonsd-0.7.9/src/systems.h0000644000175000017500000000137510054126562013312 00000000000000#ifndef INCLUDE_SYSTEMS_H #define INCLUDE_SYSTEMS_H /* ---------------------------------------------------------------------------- * systems.h * definitions for different laptop models. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef SYS_POWERBOOK # define WITH_MODULE_PMAC #endif #ifdef SYS_I386_ACPI #endif #ifdef SYS_I386_GENERIC #endif #endif /* INCLUDE_SYSTEMS_H */ pbbuttonsd-0.7.9/src/input_manager.c0000644000175000017500000002545010505730503014424 00000000000000/* ---------------------------------------------------------------------------- * input_manager.c * code to distribute input events to modules * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include "pbbinput.h" #include #include #include "gettext_macros.h" #include "systems.h" #include "init.h" #include "input_manager.h" extern volatile sig_atomic_t prgexit; /* --- private module data structure of the input manager --- */ struct moddata_inputmanager { GList *inputsources; struct { unsigned int shift:1; unsigned int ctrl:1; unsigned int alt:1; unsigned int :0; } flags; unsigned short lastkey; inputqueue_t *iqueues[QUEUECOUNT]; inputqueue_t kbdqueue[MODULECOUNT]; inputqueue_t mousequeue[MODULECOUNT]; inputqueue_t t100queue[MODULECOUNT]; inputqueue_t t1000queue[MODULECOUNT]; inputqueue_t queryqueue[MODULECOUNT]; inputqueue_t configqueue[MODULECOUNT]; inputqueue_t securequeue[MODULECOUNT]; } modbase_inputmanager; /* --- interface functions of the inputmanager --- */ /* Init function called by the program init procedure. Function is known by * the prginitab. It does module data initialisation. */ int inputmanager_init () { struct moddata_inputmanager *base = &modbase_inputmanager; int x, y, fd; base->inputsources = NULL; scanEventDevices(); #if 0 /* see mice_handler for comment */ if ((fd = open("/dev/input/mice", O_RDONLY)) >= 0) /* open mouse device */ addInputSource (fd, mice_handler, NULL, TRUE); #endif base->flags.shift = 0; base->flags.ctrl = 0; base->flags.alt = 0; base->lastkey = 0; base->iqueues[KBDQUEUE] = base->kbdqueue; base->iqueues[MOUSEQUEUE] = base->mousequeue; base->iqueues[T100QUEUE] = base->t100queue; base->iqueues[T1000QUEUE] = base->t1000queue; base->iqueues[QUERYQUEUE] = base->queryqueue; base->iqueues[CONFIGQUEUE] = base->configqueue; base->iqueues[SECUREQUEUE] = base->securequeue; for (y=0; y < QUEUECOUNT; y++) for (x=0; x < MODULECOUNT; x++) base->iqueues[y][x] = NULL; return 0; } void cbFreeInputSource (gpointer data, gpointer user_data) { InputSource *src = data; g_source_remove (src->watch); } int inputmanager_exit () { struct moddata_inputmanager *base = &modbase_inputmanager; g_list_foreach (base->inputsources, cbFreeInputSource, NULL); return 0; } /* ----------- */ int track_modifier(unsigned short code, unsigned int value) { struct moddata_inputmanager *base = &modbase_inputmanager; if (value > 1) value = 1; /* key repeated = pressed */ switch (code) { case KEY_RIGHTSHIFT: case KEY_LEFTSHIFT: base->flags.shift = value; break; case KEY_RIGHTCTRL: case KEY_LEFTCTRL: base->flags.ctrl = value; break; case KEY_RIGHTALT: case KEY_LEFTALT: base->flags.alt = value; break; } return (base->flags.ctrl << 2) | (base->flags.alt << 1) | (base->flags.shift << 0); } int get_modifier() { struct moddata_inputmanager *base = &modbase_inputmanager; return (base->flags.ctrl << 2) | (base->flags.alt << 1) | (base->flags.shift << 0); } /* --- event handler management --- */ gint cbEventDevices (gconstpointer a, gconstpointer venprod) { const InputSource *src = a; if (src->user_data == venprod) return 0; return 1; } void scanEventDevices () { struct moddata_inputmanager *base = &modbase_inputmanager; int n, fd, fcnt = 0; char filename[20]; gpointer evdevid; for (n = 0; n < EVDEVCOUNT; n++) { sprintf(filename, "/dev/input/event%d", n); if ((fd = open(filename, O_RDONLY)) >= 0) { evdevid = (gpointer) (0x45460000 | n); if ((g_list_find_custom (base->inputsources, evdevid, cbEventDevices)) == NULL) addInputSource (fd, event_handler, evdevid, TRUE); else close(fd); } else fcnt++; /* count number of event devices that could not be opened */ } if (fcnt == EVDEVCOUNT) /* none of the 32 devices can be opened */ print_msg (PBB_WARN, _("No event devices available. Please check your configuration.\n")); } /* --- input source --- */ void destroyInputSource (gpointer data) { struct moddata_inputmanager *base = &modbase_inputmanager; InputSource *src = data; #ifdef DEBUG print_msg (PBB_INFO, "DBG: InputSource removed: %08x\n", src->user_data); #endif base->inputsources = g_list_remove (base->inputsources, src); g_free (src); } gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data) { InputSource *src = data; gboolean rc = TRUE; if (condition & G_IO_IN) { /* call the appropriate handler. We assume that io = src->io. * In case of an error the InputSource will be removed to * prevent further problems reading invalid devices. */ rc = src->handler (g_io_channel_unix_get_fd (io), src->user_data); } else /* GIOChannel reported an error */ rc = FALSE; #ifdef DEBUG if (rc == FALSE) { print_msg (PBB_INFO, "DBG: InputSource received %s %s %s\n", (condition & G_IO_IN) ? "G_IO_IN" : "", (condition & G_IO_ERR) ? "G_IO_ERR" : "", (condition & G_IO_HUP) ? "G_IO_HUP" : ""); } #endif return rc; } InputSource* addInputSource (int fd, void *handler, gpointer user_data, gboolean close_on_exit) { struct moddata_inputmanager *base = &modbase_inputmanager; InputSource *src; src = g_new0 (InputSource, 1); src->io = g_io_channel_unix_new (fd); /* set channel encoding to binary */ g_io_channel_set_encoding (src->io, NULL, NULL); /* Bound the file handle to the IOChannel. The file handle will be * closed as soon as this IOChannel got obsolete. If this shouldn't * happen, give 'close_on_exit' = FALSE. */ if (close_on_exit == TRUE) g_io_channel_set_close_on_unref (src->io, TRUE); src->handler = handler; src->user_data = user_data; src->watch = g_io_add_watch_full (src->io, G_PRIORITY_DEFAULT, G_IO_IN | G_IO_ERR | G_IO_HUP, handleInputSource, src, destroyInputSource); /* g_io_channel_unix_new() and g_io_add_watch both increment the * ref counter but we want to get rid of the IOchannel too, when * the source will be removed. */ g_io_channel_unref (src->io); /* Attach the newly created InputSource to the global list */ base->inputsources = g_list_append (base->inputsources, src); #ifdef DEBUG print_msg (PBB_INFO, "DBG: InputSource added: %08x\n", src->user_data); #endif return src; } /* --- queue managers --- */ int register_function (int queueid, void *func) { struct moddata_inputmanager *base = &modbase_inputmanager; inputqueue_t *queue = base->iqueues[queueid]; int n; for (n=0; n < MODULECOUNT; n++) if (queue[n] == NULL) { queue[n] = (inputqueue_t) func; return 0; } return -1; } long process_queue_single (int queueid, long tag, long data) { struct tagitem taglist[2]; taglist_init (taglist); taglist_add (taglist, tag, data); process_queue (queueid, taglist); return taglist->data; } int process_queue (int queueid, struct tagitem *taglist) { struct moddata_inputmanager *base = &modbase_inputmanager; inputqueue_t *queue = base->iqueues[queueid]; int n=0; if (queueid == KBDQUEUE) { if ((tagfind (taglist, TAG_KEYREPEAT, 0))) { base->lastkey = tagfind (taglist, TAG_KEYCODE, 0); } else base->lastkey = 0; } while ((queue[n] != NULL) && (n < MODULECOUNT)) { queue[n++] (taglist); } return n; } /* --- input handlers --- */ void ipc_handler () { struct pbbmessage *msg; struct tagitem *source, *dest; char msgbuffer[8192]; if ((ipc_receive (msgbuffer, sizeof(msgbuffer))) == 0) { msg = (struct pbbmessage *) msgbuffer; switch (msg->action) { case READVALUE: process_queue (QUERYQUEUE, msg->taglist); ipc_send (msg->returnport, CHANGEVALUE, msg->taglist); break; case CHANGEVALUE: process_queue (CONFIGQUEUE, msg->taglist); source = dest = msg->taglist; while (source->tag != TAG_END) { if ((source->tag & FLG_ERROR)) { dest->tag = source->tag; dest->data = source->data; dest++; } source++; } dest->tag = TAG_END; dest->data = 0; ipc_send (msg->returnport, CHANGEERROR, msg->taglist); break; } } } gboolean event_handler (int fd, gpointer user_data) { struct input_event inp; struct tagitem taglist[10]; gboolean rc = FALSE; taglist_init(taglist); if (read(fd, &inp, sizeof(inp)) == sizeof(inp)) { switch (inp.type) { case EV_KEY: taglist_add (taglist, TAG_KEYCODE, (long) inp.code); taglist_add (taglist, TAG_KEYREPEAT,(long) inp.value); taglist_add (taglist, TAG_MODIFIER, (long) track_modifier (inp.code, inp.value)); process_queue (KBDQUEUE, taglist); break; case EV_REL: /* TAG_MOUSERELx are currently not used. Only the occourence * of this events will be used */ if (inp.code) taglist_add (taglist, TAG_MOUSERELY, (long) inp.value); else taglist_add (taglist, TAG_MOUSERELX, (long) inp.value); process_queue (MOUSEQUEUE, taglist); break; case EV_ABS: /* Mouse events are not used. Only the occurence of this events * will currently be used */ process_queue (MOUSEQUEUE, taglist); break; default: break; /* catch unknown event types */ } rc = TRUE; } return rc; } /* This function is a tribute to the buggy Xorg synaptics driver. * This driver blocks the event device of the trackpad for exclusive * use so pbbuttonsd won't get any events from the trackpad. This * function uses /dev/input/mice in parallel to the event device * so we hopefully tick the synaptics driver. * * Unfortunately the synaptics driver pushed the mouse events read * from the event device directly to X and doesn't mirrot them to * /dev/event/mice. This makes it impossible to work around this * problem and make the following handler useless. (2006-09-23 MG) */ #if 0 gboolean mice_handler (int fd, gpointer user_data) { signed char buffer[] = {0, 0, 0 ,0}; struct tagitem taglist[3]; int count; taglist_init(taglist); if ((count = read(fd, buffer, sizeof(buffer))) >= 3) { taglist_add (taglist, TAG_MOUSERELX, (long) buffer[1]); taglist_add (taglist, TAG_MOUSERELY, (long) buffer[2]); process_queue (MOUSEQUEUE, taglist); } return TRUE; } #endif gboolean cb_timer100 (gpointer data) { struct moddata_inputmanager *base = &modbase_inputmanager; struct tagitem taglist[] = { { TAG_END, 0 } }; int mod; process_queue (T100QUEUE, taglist); mod = get_modifier(); if ((mod == 0) && (base->lastkey == 0)) process_queue (SECUREQUEUE, taglist); return TRUE; } gboolean cb_timer1000 (gpointer data) { struct tagitem taglist[] = { { TAG_END, 0 } }; process_queue (T1000QUEUE, taglist); return TRUE; } pbbuttonsd-0.7.9/src/input_manager.h0000644000175000017500000000523410505717050014431 00000000000000#ifndef INCLUDE_INPUTMANAGER_H #define INCLUDE_INPUTMANAGER_H /* ---------------------------------------------------------------------------- * input_manager.h * prototypes and definitions for input_manager.c. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include typedef void (*inputqueue_t)(); #define MAXINPUTS 16 #define TIMERCOUNT 3 /* ATTENTION: keep an eye on the init routine */ #define EVDEVCOUNT 32 /* queue identifier */ #define KBDQUEUE 0 /* keyboard events */ #define MOUSEQUEUE 1 /* mouse events */ #define T100QUEUE 2 /* timer tic every 100ms */ #define T1000QUEUE 3 /* timer tic every second */ #define QUERYQUEUE 4 /* ask for properties */ #define CONFIGQUEUE 5 /* set properties */ #define SECUREQUEUE 6 /* called if user is idle */ #define QUEUECOUNT 7 #define MOD_NONE 0 #define MOD_SHIFT 1 /* 001 */ #define MOD_ALT 2 /* 010 */ #define MOD_SHIFTALT 3 #define MOD_CTRL 4 /* 100 */ #define MOD_SHIFTCTRL 5 #define MOD_ALTCTRL 6 #define MOD_SHIFTALTCTRL 7 #define BITS_PER_LONG (sizeof(long) * 8) #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) #define OFF(x) ((x)%BITS_PER_LONG) #define LONG(x) ((x)/BITS_PER_LONG) #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) typedef struct inputsource { GIOChannel *io; guint watch; int (*handler)(int fd, gpointer user_data); gpointer user_data; } InputSource; /* public prototypes */ int inputmanager_init (); void cbFreeInputSource (gpointer data, gpointer user_data); int inputmanager_exit (); int track_modifier(unsigned short code, unsigned int value); int get_modifier(); gint cbEventDevices (gconstpointer a, gconstpointer b); void scanEventDevices (); void destroyInputSource (gpointer data); gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data); InputSource *addInputSource (int fd, void *handler, gpointer user_data, gboolean close_on_exit); int register_function (int queueid, void *func); long process_queue_single (int queueid, long tag, long data); int process_queue (int queueid, struct tagitem *taglist); void ipc_handler (); gboolean event_handler (int fd, gpointer user_data); gboolean mice_handler (int fd, gpointer user_data); gboolean cb_timer100 (gpointer data); gboolean cb_timer1000 (gpointer data); #endif /* INCLUDE_INPUTMANAGER_H */ pbbuttonsd-0.7.9/src/support.c0000644000175000017500000001670110505514445013313 00000000000000/* ---------------------------------------------------------------------------- * support.c * funtions usefull for everybody * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include "support.h" #include "gettext_macros.h" /* the prototype for getpgid() should be in unistd.h but although it is * included above the compiler complains with "implicit declaration for * getpgid" if this line is missing. This must be further investigated. */ extern pid_t getpgid (pid_t pid); int copy_path (char *source, char *dest, int type, int flags) { char *whitespace = NULL; int rc = 0, perms = 0600; if (type == TYPE_DIR) perms = 0700; if (strlen (source) < STDBUFFERLEN) { if ((whitespace = strchr (source, ' ')) != NULL) *whitespace = 0; rc = check_devorfile (source, type); if ((rc == 0) && (flags & CPFLG_PBBONLY)) rc = check_permissions (source, geteuid(), perms, 022); if ((rc == E_NOEXIST) && (flags & CPFLG_MAYBEMISSED)) rc = 0; if (type == TYPE_FILE && strlen(source) == 0) rc = 0; /* empty _file_names are acceptable */ switch (rc) { case E_NOEXIST: print_msg (PBB_ERR, _("The object '%s' doesn't exist.\n"), source); break; case E_NOFILE: print_msg (PBB_ERR, _("The object '%s' is not a file.\n"), source); break; case E_NODIR: print_msg (PBB_ERR, _("The object '%s' is not a directory.\n"), source); break; case E_NOCHAR: print_msg (PBB_ERR, _("The object '%s' is not a character device.\n"), source); break; case E_NOBLK: print_msg (PBB_ERR, _("The object '%s' is not a block device.\n"), source); break; case E_USER: print_msg (PBB_WARN, _("SECURITY: %s must be owned by the same owner as pbbuttonsd.\n"), source); break; case E_RIGHTS: print_msg (PBB_WARN, _("SECURITY: %s must only be writable by the owner of pbbuttonsd.\n"), source); break; case E_PERM: print_msg (PBB_ERR, _("Insufficient permissions for object %s, at least '0%o' needed.\n"), source, perms); break; default: if (whitespace != NULL) *whitespace = ' '; if (dest) strncpy(dest, source, STDBUFFERLEN); break; } } else { print_msg (PBB_ERR, _("Path of '%s' is to long.\n"), source); rc = E_BUFOVL; } if (whitespace != NULL) *whitespace = ' '; return rc; } #if 0 /* lauching of external programs with glib functions. The program will be * executed asynchron but some applications in pbbuttond don't work with * asynchron calls. Synchron calls won't neither work because in some * cases the IPC system will be blocked. To make this work, a major * redesign of pbbuttonsd internal structure would be necessary. */ void cbChildSetup (gpointer data) { /* open own session so that pbbuttonsd can terminate the * script cleanly on error without killing itself */ setsid(); } void cbChildCleanup (gpointer data) { struct ChildData *cd = data; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d cleaned up (ref=%d), exitcode=%d.\n", cd->pid, cd->ref, cd->rc); #endif if (g_atomic_int_dec_and_test (&cd->ref)) { /* free resources */ g_spawn_close_pid(cd->pid), g_strfreev (cd->argv); g_free (cd); #ifdef DEBUG print_msg (PBB_INFO, "DBG: Resources freed.\n"); #endif } } gboolean cbChildTimeout (gpointer data) { struct ChildData *cd = data; int pgrp, status; gchar *cmd; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d, timeout handler called.\n", cd->pid); #endif /* remove child watch */ g_source_remove (cd->cwatch); pgrp = getpgid(cd->pid); /* get childs process group */ kill (-pgrp, SIGKILL); /* kill child and his childs */ waitpid (cd->pid, &status, 0); /* clean up zombie */ cmd = g_strjoinv (" ", cd->argv); print_msg (PBB_INFO, _("Script '%s' lauched but killed after %d seconds.\n"), cmd, get_timeforcmd()); g_free (cmd); /* remove timeout watch */ return FALSE; } void cbChildExit (GPid pin, gint status, gpointer data) { struct ChildData *cd = data; gchar *cmd; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Child %d, exit handler called.\n", cd->pid); #endif /* remove timeout watch */ g_source_remove (cd->twatch); cmd = g_strjoinv (" ", cd->argv); if (WIFEXITED(status)) { if ((cd->rc = WEXITSTATUS(status))) print_msg (PBB_INFO, _("Script '%s' lauched but exitcode is %d.\n"), cmd, cd->rc); else print_msg (PBB_INFO, _("Script '%s' launched and exited normally.\n"), cmd); } else if (WIFSIGNALED(status)) print_msg (PBB_INFO, _("Script '%s' lauched but exited by signal.\n"), cmd); g_free (cmd); } //struct ChildData* int call_script (char* template, ...) { GError *err = NULL; char cmd[MAXCMDLEN+1]; struct ChildData *cd; va_list list; int rc = 0; if (strlen(template) == 0) /* do nothing, if template is empty */ return 0; cd = g_new0 (struct ChildData, 1); cd->rc = -1; va_start(list, template); vsnprintf (cmd, MAXCMDLEN, template, list); cmd[MAXCMDLEN] = '\0'; cd->argv = g_strsplit (cmd, " ", 0); va_end (list); if ((rc = check_permissions (cd->argv[0], geteuid(), 0700, 022)) == 0) { g_spawn_async ("/", cd->argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD|G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL, cbChildSetup, (gpointer) cd, &cd->pid, &err); if (err == NULL) { g_atomic_int_inc (&cd->ref); cd->twatch = g_timeout_add_full (G_PRIORITY_DEFAULT, get_timeforcmd() * 1000, cbChildTimeout, (gpointer) cd, cbChildCleanup); g_atomic_int_inc (&cd->ref); cd->cwatch = g_child_watch_add_full (G_PRIORITY_DEFAULT, cd->pid, cbChildExit, (gpointer) cd, cbChildCleanup); // return cd; return rc; } else { print_msg (PBB_INFO, _("Script '%s' can't be launched - fork() failed.\n"), cmd); g_error_free (err); } } else if (rc == E_NOEXIST) { print_msg (PBB_INFO, _("Script '%s' doesn't exist.\n"), cmd); } else { /* E_PERM or E_RIGHTS or E_USER */ print_msg (PBB_INFO, _("Script '%s' skipped because it's not secure.\n"), cmd); } g_strfreev (cd->argv); g_free (cd); // return NULL; return rc; } #endif int call_script (char* template, ...) { int rc; char script[MAXCMDLEN+1], *ftext, buffer[STDBUFFERLEN]; va_list list; if (strlen(template) == 0) /* do nothing, if template is empty */ return 0; va_start(list, template); vsnprintf (script, MAXCMDLEN, template, list); script[MAXCMDLEN] = '\0'; va_end (list); rc = launch_program (script); switch (rc) { case 0: ftext = _("launched and exited normally"); break; case E_NOEXIST: ftext =_("doesn't exist"); break; case E_RIGHTS: case E_USER: case E_PERM: ftext =_("skipped because it's not secure"); break; case E_CLDKILL: snprintf (buffer, STDBUFFERLEN, _("lauched but killed after %d seconds"), get_timeforcmd()); ftext = buffer; break; case E_CLDEXIT: ftext =_("lauched but exitcode is not null"); break; case E_CLDFAIL: ftext =_("can't be launched - fork() failed"); break; case E_CLDSIG: ftext =_("lauched but exited by signal"); break; default: ftext =_("failed - unknown error code"); } print_msg (PBB_INFO, _("Script '%s' %s\n"), script, ftext); return rc; } pbbuttonsd-0.7.9/src/support.h0000644000175000017500000000170710364474001013314 00000000000000#ifndef INCLUDE_SUPPORT_H #define INCLUDE_SUPPORT_H /* ---------------------------------------------------------------------------- * support.h * prototypes and definitions for support.c. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #define CPFLG_NONE 0 #define CPFLG_MAYBEMISSED 1 #define CPFLG_PBBONLY 2 struct ChildData { char **argv; GPid pid; gint twatch; gint cwatch; gint ref; /* reference count */ gint rc; /* child's return code, or -1 */ }; /* prototypes */ int copy_path (char *source, char *dest, int type, int flags); int call_script (char* template, ...); #endif /* INCLUDE_SUPPORT_H */ pbbuttonsd-0.7.9/src/config_manager.c0000644000175000017500000003327710460457546014555 00000000000000/* ---------------------------------------------------------------------------- * config_manager.c * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" /* --- private module data structure of the config manager --- */ struct moddata_configmanager { struct listhead sectionlist; /* list of config sections */ struct listhead optionlist; /* list of config options */ } modbase_configmanager; /* Init function called by the program init procedure. Function is known by the prginitab. It does module data initialisation. */ int configmanager_init () { struct moddata_configmanager *base = &modbase_configmanager; initListHeader (&base->sectionlist); initListHeader (&base->optionlist); return 0; } int configmanager_exit () { struct moddata_configmanager *base = &modbase_configmanager; freeList (&base->sectionlist); freeList (&base->optionlist); return 0; } int registerCfgSection (char *name) { struct moddata_configmanager *base = &modbase_configmanager; struct listnode *it = base->sectionlist.first, *newnode; struct cfgsection *section; int newsecid = 0; while ((it = it->next)) { section = (struct cfgsection *) getNodeData (it->pred); if (strcasecmp (name, section->name) == 0) return section->sectionid; if (section->sectionid > newsecid) newsecid = section->sectionid; } if ((newnode = newListNode (sizeof (struct cfgsection) + strlen (name) + 1))) { section = (struct cfgsection *) getNodeData (newnode); section->sectionid = newsecid = newsecid + 1; section->name = (char*) section + sizeof (struct cfgsection); strcpy (section->name, name); appendListNode (&base->sectionlist, newnode); } return newsecid; } struct cfgoption * findCfgOption (char *name) { struct moddata_configmanager *base = &modbase_configmanager; struct listnode *it = base->optionlist.first; struct cfgoption *option; while ((it = it->next)) { option = (struct cfgoption *) getNodeData (it->pred); if (strcasecmp (name, option->name) == 0) return option; } return NULL; } char * prependString (char **address, char *text) { if (text) { /* text might be NULL */ *address -= strlen(text) + 1; strcpy (*address, text); return *address; } else return NULL; } int registerCfgOptionInt (int sid, char *name, long tag, int flags, char *comment) { return registerCfgOption (sid, name, DT_INT, tag, 0, flags, comment); } int registerCfgOptionString (int sid, char *name, long tag, int flags, char *comment) { return registerCfgOption (sid, name, DT_STRING, tag, 0, flags, comment); } int registerCfgOptionKey (int sid, char *name, long tag1, long tag2, int flags, char *comment) { return registerCfgOption (sid, name, DT_KEY, tag1, tag2, flags, comment); } int registerCfgOptionBool (int sid, char *name, long tag, int flags, char *comment) { if (flags & FLG_INVBOOL) return registerCfgOption (sid, name, DT_INVBOOL, tag, 0, flags, comment); else return registerCfgOption (sid, name, DT_BOOL, tag, 0, flags, comment); } int registerCfgOption (int sid, char *name, int datatype, long tag1, long tag2, int flags, char *comment) { struct moddata_configmanager *base = &modbase_configmanager; struct listnode *newnode; struct cfgoption* option; int datalen = 0; char *buffer; if ((option = findCfgOption (name))) return E_OPTEXISTS; /* option is already registered, not really an error */ if (name) datalen += strlen (name) + 1; if (comment) datalen += strlen(comment) + 1; if ((newnode = newListNode (sizeof (struct cfgoption) + datalen))) { option = (struct cfgoption *) getNodeData (newnode); option->type = datatype; option->sectionid = sid; option->tag1 = tag1; option->tag2 = tag2; option->readonly = (flags & FLG_RONLY) ? 1 : 0; buffer = getNodeDataEnd (newnode); option->name = prependString (&buffer, name); option->comment = prependString (&buffer, comment); appendListNode (&base->optionlist, newnode); return E_OK; } return E_NOMEM; } int registerCfgOptionList (int sid, char *name, long tag, int flags, char *comment, ...) { struct moddata_configmanager *base = &modbase_configmanager; struct listnode *newnode; struct cfgoption* option; int datalen = 0, n; va_list vargs; char *tmpstring, *buffer; if ((option = findCfgOption (name))) return E_OPTEXISTS; /* option is already registered, not really an error */ if (name) datalen += strlen (name) + 1; if (comment) datalen += strlen(comment) + 1; va_start (vargs, comment); while ((tmpstring = va_arg (vargs, char*))) datalen += strlen(tmpstring) + 1 + sizeof (char*); va_end (vargs); if ((newnode = newListNode (sizeof (struct cfgoption) + datalen))) { option = (struct cfgoption *) getNodeData (newnode); option->type = DT_LIST; option->sectionid = sid; option->tag1 = tag; option->readonly = (flags & FLG_RONLY) ? 1 : 0; buffer = getNodeDataEnd (newnode); option->name = prependString (&buffer, name); option->comment = prependString (&buffer, comment); option->items = (char **) ((char *)option + sizeof (struct cfgoption)); n = 0; va_start (vargs, comment); while ((tmpstring = va_arg (vargs, char*))) option->items[n++] = prependString (&buffer, tmpstring); va_end (vargs); option->itemscnt = n; appendListNode (&base->optionlist, newnode); return E_OK; } return E_NOMEM; } /* ------ */ struct tagitem * readConfigFile (char *filename) { struct moddata_configmanager *base = &modbase_configmanager; struct stat stat_buf; struct tagitem *taglist; struct listnode *it; struct cfgoption *option; char *buffer, *strptr, linebuffer[STDBUFFERLEN], *token, *arg; unsigned int bufferlen, n; FILE *fd; if ((stat(filename, &stat_buf)) == -1) { print_msg (PBB_WARN, _("Couldn't read configfile [%s, %s], using defaults.\n"), filename, strerror(errno)); return NULL; } bufferlen = stat_buf.st_size; if ((buffer = (char *) malloc (bufferlen)) == 0) { print_msg (PBB_WARN, _("Couldn't read configfile [%s, out of memory], using defaults.\n"), filename); return NULL; } taglist = (struct tagitem *) buffer; /* moving pointer */ strptr = buffer + bufferlen; /* moving pointer */ if ((fd = fopen(filename, "r"))) { while (fgets(linebuffer, sizeof(linebuffer), fd)) { if (linebuffer[0] != '#') { cleanup_buffer(linebuffer); for (n=0; n < strlen (linebuffer); n++) if (linebuffer[n] == ';' || linebuffer[n] == '#') { linebuffer[n] = 0; break; } if ((token = strtok(linebuffer, "=\n"))) { arg = strtok(0, "#;=\n"); it = base->optionlist.first; while ((it = it->next)) { option = (struct cfgoption *) getNodeData (it->pred); if (strcasecmp (token, option->name) == 0) { switch (option->type) { case DT_INT: readCfgInt (option, &taglist, &strptr, arg); break; case DT_STRING: readCfgString (option, &taglist, &strptr, arg); break; case DT_KEY: readCfgKey (option, &taglist, &strptr, arg); break; case DT_BOOL: case DT_INVBOOL: readCfgBool (option, &taglist, &strptr, arg); break; case DT_LIST: readCfgList (option, &taglist, &strptr, arg); break; } break; } } if (it == NULL) strtok(0,"=\n"); } } } taglist->tag = TAG_END; fclose(fd); } return (struct tagitem *) buffer; } void readCfgInt (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg) { (*taglist)->tag = option->tag1; (*taglist)->data = atoi (arg); (*taglist)++; } void readCfgString (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg) { char *empty = ""; if (!arg) arg = empty; *strptr = *strptr - strlen (arg) - 1; strcpy (*strptr, arg); /* copy argument before end of current stringbuffer */ (*taglist)->tag = option->tag1; (*taglist)->data = (long) *strptr; (*taglist)++; } void readCfgKey (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg) { int key, mod; decode_key_and_modifier(arg, &key, &mod); (*taglist)->tag = option->tag1; (*taglist)->data = (long) key; (*taglist)++; (*taglist)->tag = option->tag2; (*taglist)->data = (long) mod; (*taglist)++; } void decode_key_and_modifier(char *arg, int *key, int *mod) { char *tag; int k; *mod = 0; *key = 0; tag = strtok(arg, "+\n"); while (tag) { k = atoi (tag); if (k == 0) { /* while (*tag == ' ') tag++; ignore leading spaces */ if (!strncmp("shift", tag, 5)) *mod |= MOD_SHIFT; else if (!strncmp("alt", tag, 3)) *mod |= MOD_ALT; else if (!strncmp("ctrl", tag, 4)) *mod |= MOD_CTRL; } else *key = k; tag = strtok(0, "+\n"); } } void readCfgBool (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg) { (*taglist)->tag = option->tag1; if (!strncmp("yes", arg, 3)) (*taglist)->data = 1; else (*taglist)->data = 0; if (option->type == DT_INVBOOL) (*taglist)->data ^= 1; (*taglist)++; } void readCfgList (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg) { int cnt; (*taglist)->tag = option->tag1; for (cnt = 0; cnt < option->itemscnt; cnt++) if (!strcasecmp (option->items[cnt], arg)) { (*taglist)->data = cnt; (*taglist)++; break; } } /* ---- */ void writeConfigFile (char *filename) { struct moddata_configmanager *base = &modbase_configmanager; struct tagitem *taglist; struct listnode *secit, *optit; struct cfgsection *section; struct cfgoption *option; long fpos1, fpos2; FILE *fd; if ((taglist = (struct tagitem*) malloc (2 * sizeof(struct tagitem) * getNodeCount (&base->optionlist))) == 0) { print_msg (PBB_WARN, _("Couldn't write configfile [%s, out of memory].\n"), filename); return; } taglist_init (taglist); /* create taglist containing all possible config settings */ optit = base->optionlist.first; while ((optit = optit->next)) { option = (struct cfgoption *) getNodeData (optit->pred); taglist_add (taglist, option->tag1, -1); if (option->tag2 != 0) taglist_add (taglist, option->tag2, -1); } process_queue (QUERYQUEUE, taglist); /* ask modules for config settings */ if ((fd = fopen(filename, "w"))) { fputs (_("# Configuration file for pbbuttonsd >= version 0.5\n# for options see man pbbuttonsd.conf\n"), fd); secit = base->sectionlist.first; while ((secit = secit->next)) { section = (struct cfgsection *) getNodeData (secit->pred); fprintf (fd, "\n[%s]\n", section->name); optit = base->optionlist.first; while ((optit = optit->next)) { option = (struct cfgoption *) getNodeData (optit->pred); if (option->sectionid != section->sectionid) continue; if (option->readonly) continue; /* if the tag can't be found or the query functions sets it to * 0xffffffff, the option will be commented out. With next program * start this option will be set to default. */ if (tagfind (taglist, option->tag1, 0xffffffff) == 0xffffffff) fputs ("#", fd); fprintf (fd, "%-22s= ", option->name); fpos1 = ftell(fd); switch (option->type) { case DT_INT: writeCfgInt (fd, option, taglist); break; case DT_STRING: writeCfgString (fd, option, taglist); break; case DT_KEY: writeCfgKey (fd, option, taglist); break; case DT_BOOL: case DT_INVBOOL: writeCfgBool (fd, option, taglist); break; case DT_LIST: writeCfgList (fd, option, taglist); break; } if (option->comment) { fpos2 = ftell(fd); if ((fpos2 - fpos1) < 8) fprintf(fd, "\t"); fprintf (fd, "\t; %s", _(option->comment)); } fputs("\n", fd); } } fclose(fd); } free(taglist); /* free memory for taglist */ } void writeCfgInt (FILE *fd, struct cfgoption *option, struct tagitem *taglist) { int val; val = (int) tagfind (taglist, option->tag1, -1); fprintf (fd, "%d", val == -1 ? 0 : val); } void writeCfgString (FILE *fd, struct cfgoption *option, struct tagitem *taglist) { long val; val = tagfind (taglist, option->tag1, -1); if (val == -1 || val == 0) fprintf (fd, "\"\""); else fprintf (fd, "\"%s\"", (char *) val); } void writeCfgKey (FILE *fd, struct cfgoption *option, struct tagitem *taglist) { int key, mod; key = (int) tagfind (taglist, option->tag1, -1); mod = (int) tagfind (taglist, option->tag2, -1); fprintf (fd, "%s", code_key_and_modifier(key, mod)); } char* code_key_and_modifier (int key, int mod) { static char buffer[30]; if (key == -1) key = 0; if (mod == -1) mod = 0; snprintf (buffer, sizeof(buffer)-1, "%d", (key & 255)); if (mod & MOD_SHIFT) strcat (buffer, " + shift"); if (mod & MOD_ALT) strcat (buffer, " + alt"); if (mod & MOD_CTRL) strcat (buffer, " + ctrl"); return buffer; } void writeCfgBool (FILE *fd, struct cfgoption *option, struct tagitem *taglist) { int val; val = (int) tagfind (taglist, option->tag1, -1); if (val == -1) val = 0; if (option->type == DT_INVBOOL) val ^= 1; fprintf (fd, "%s", val ? "yes" : "no"); } void writeCfgList (FILE *fd, struct cfgoption *option, struct tagitem *taglist) { int val; val = (int) tagfind (taglist, option->tag1, -1); if (val < 0 || val >= option->itemscnt) val = 0; fprintf (fd, "%s", option->items[val]); } pbbuttonsd-0.7.9/src/config_manager.h0000644000175000017500000000614210217517212014534 00000000000000#ifndef INCLUDE_CONFIG_MANAGER_H #define INCLUDE_CONFIG_MANAGER_H /* ---------------------------------------------------------------------------- * config manager.h * prototypes and definitions for the configuration manager. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include "pbblist.h" #define FLG_RONLY 1<<0 #define FLG_INVBOOL 1<<1 enum datatype { DT_INT, DT_STRING, DT_KEY, DT_BOOL, DT_INVBOOL, DT_LIST }; struct cfgsection { int sectionid; char *name; }; struct cfgoption { int sectionid; char *name; long tag1; long tag2; enum datatype type; char *comment; char **items; int itemscnt; int readonly; }; /* prototypes */ int configmanager_init (); int configmanager_exit (); /* registers a new configuration file section or * get the section id of an existing one. */ int registerCfgSection (char *name); struct cfgoption *findCfgOption (char *name); char *prependString (char **address, char *text); /* register a new configuration option. The call will * be ignored, if the option has already been registered. */ int registerCfgOptionInt (int sid, char *name, long tag, int flags, char *comment); int registerCfgOptionString (int sid, char *name, long tag, int flags, char *comment); int registerCfgOptionKey (int sid, char *name, long tag1, long tag2, int flags, char *comment); int registerCfgOptionBool (int sid, char *name, long tag, int flags, char *comment); int registerCfgOptionList (int sid, char *name, long tag, int flags, char *comment, ...); int registerCfgOption (int sid, char *name, int datatype, long tag1, long tag2, int flags, char *comment); /* read configuration file and helpers */ struct tagitem *readConfigFile (char *filename); void readCfgInt (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg); void readCfgString (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg); void readCfgKey (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg); void decode_key_and_modifier(char *arg, int *key, int *mod); void readCfgBool (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg); void readCfgList (struct cfgoption *option, struct tagitem **taglist, char **strptr, char *arg); /* write configuration file and helpers */ void writeConfigFile (char *filename); void writeCfgInt (FILE *fd, struct cfgoption *option, struct tagitem *taglist); void writeCfgString (FILE *fd, struct cfgoption *option, struct tagitem *taglist); void writeCfgKey (FILE *fd, struct cfgoption *option, struct tagitem *taglist); char *code_key_and_modifier (int key, int mod); void writeCfgBool (FILE *fd, struct cfgoption *option, struct tagitem *taglist); void writeCfgList (FILE *fd, struct cfgoption *option, struct tagitem *taglist); #endif /* INCLUDE_CONFIG_MANAGER_H */ pbbuttonsd-0.7.9/src/module_pmac.c0000644000175000017500000014337610507220531014065 00000000000000/* -------------------------------------------------------------------------- * module_pmac.c * code for test module * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #ifdef WITH_MODULE_PMAC #include #include #include #include #include #include #include #include #include "pbbinput.h" #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_pmac.h" #include "support.h" #ifdef WITH_PMUD # include "tcp.h" #endif #include "debug.h" #define TRACKPAD_PAUSETIME 6 /* time in 1/100 of a second */ struct moddata_pmac { char *pmudev; /* pathname of the PMU device */ int fd_pmu; /* filehandle of the PMU device */ char *adbdev; /* pathname of the ADB device */ int fd_adb; /* filehandle of ADB device */ char *i2cdev; /* pathname of the I2C device with ambient sensor and KBD illu */ int version; /* PMU version */ char *identity; /* Identity string of this laptop */ int machine; /* OpenFirmware machine code */ int lmuaddr; /* i2c address of LMU Controller */ struct modflags_pmac flags; int flagschanged; /* PMU flags that have changed recently */ int oharevolbutton; /* level of volume button on OHARE PBs scaled to 0..100 */ int oharebrightbutton; /* level of brightness button on OHARE PBs scaled to 0..15 */ int charge[MAX_BATTERIES]; /* current battery charge */ int chargemax[MAX_BATTERIES]; /* max battery charge */ int current[MAX_BATTERIES]; /* electrical currrent out of the batteries */ int voltage[MAX_BATTERIES]; /* current battery voltage */ int timeleft; /* time until battery runs out of fuel. This value is low pass filtered to reduce fast signal fluctuation This filter doesn't reduce accuracy. */ unsigned short keytpmodeup; /* trackpad control values */ unsigned short modtpmodeup; unsigned short keytpmodedn; unsigned short modtpmodedn; int trackpad_mode; int trackpad_pause; /* trackpad switch-off timeout */ int keyboard_mode; /* keyboard mode for recent keyboards (0xC[0..4]) */ int batlog_mode; int batlog_cycle; int lcdfeedback; /* correction factor for ambient light sensor */ #if defined(DEBUG) && SIMUAMBIENT int ambient; #endif } modbase_pmac; int pmac_init () { struct moddata_pmac *base = &modbase_pmac; static char devbuffer_pmu[STDBUFFERLEN]; static char devbuffer_adb[STDBUFFERLEN]; static char devbuffer_i2c[STDBUFFERLEN]; static char identitystring[STDBUFFERLEN]; int sid; bzero (base, sizeof (struct moddata_pmac)); bzero (devbuffer_pmu, STDBUFFERLEN); bzero (devbuffer_adb, STDBUFFERLEN); bzero (devbuffer_i2c, STDBUFFERLEN); bzero (identitystring, STDBUFFERLEN); base->pmudev = devbuffer_pmu; base->adbdev = devbuffer_adb; base->i2cdev = devbuffer_i2c; base->identity = identitystring; if ((sid = registerCfgSection ("MODULE PMAC")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE PMAC"); return E_NOMEM; } else { registerCfgOptionString (sid, "dev_PMU", TAG_PMUDEVICE, 0, NULL); registerCfgOptionString (sid, "dev_ADB", TAG_ADBDEVICE, 0, NULL); registerCfgOptionKey (sid, "TPModeUpKey", TAG_TPMODEUPKEY, TAG_TPMODEUPMOD, 0, NULL); registerCfgOptionKey (sid, "TPModeDownKey", TAG_TPMODEDOWNKEY, TAG_TPMODEDOWNMOD, 0, NULL); registerCfgOptionList (sid, "TPMode", TAG_TPMODE, 0, N_("'"TRACKPAD_NOTAP_NAME"', '"TRACKPAD_TAP_NAME"', '"TRACKPAD_DRAG_NAME"' or '"TRACKPAD_LOCK_NAME"'"), TRACKPAD_NOTAP_NAME, TRACKPAD_TAP_NAME, TRACKPAD_DRAG_NAME, TRACKPAD_LOCK_NAME, NULL); registerCfgOptionList (sid, "KBDMode", TAG_KBDMODE, 0, N_("'"KEYBOARD_FNDISABLED_NAME"', '"KEYBOARD_FNBACK_NAME"' or '"KEYBOARD_FNTOP_NAME"'"), KEYBOARD_FNDISABLED_NAME, KEYBOARD_FNBACK_NAME, KEYBOARD_FNTOP_NAME, NULL); registerCfgOptionList (sid, "Batlog", TAG_BATLOG, 0, N_("'"BATLOG_NONE_NAME"', '"BATLOG_CYCLE_NAME"' or '"BATLOG_LOG_NAME"'"), BATLOG_NONE_NAME, BATLOG_CYCLE_NAME, BATLOG_LOG_NAME, NULL); registerCfgOptionBool (sid, "NoTapTyping", TAG_NOTAPTYPING, 0, N_("switch trackpad to 'notap-mode' while typing")); } register_function (QUERYQUEUE, pmac_query); register_function (CONFIGQUEUE, pmac_configure); return 0; } int pmac_open (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; char *devname; long DUMMY = 0; int val, rc; base->fd_pmu = -1; base->fd_adb = -1; base->flags.coveropen = 1; /* lid is open */ base->flags.sleepsupported = 0; /* sleep not supported by default */ base->flags.set_kbdmode = 0; /* request flags for delayed actions */ base->flags.goto_sleep = 0; /* / */ base->flags.notap_typing = 0; base->keytpmodeup = KEY_BRIGHTNESSUP; base->modtpmodeup = MOD_ALT; base->keytpmodedn = KEY_BRIGHTNESSDOWN; base->modtpmodedn = MOD_ALT; base->trackpad_mode = -1; base->trackpad_pause = 0; base->keyboard_mode = -1; base->batlog_mode = BATLOG_NONE; /* no batlog */ base->batlog_cycle = -1; /* cycle invalid */ base->timeleft = -1; base->machine = 0; #if defined(DEBUG) && SIMUAMBIENT base->ambient = 0; #endif #ifdef WITH_PMUD print_msg (PBB_INFO, _("pmud support compiled in and active.\n")); #endif devname = (char *) tagfind (taglist, TAG_PMUDEVICE, (long) DEFAULT_PMU); if ((rc = copy_path (devname, base->pmudev, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((base->fd_pmu = open(base->pmudev, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open PMU device %s: %s\n"), devname, strerror(errno)); return E_OPEN; } } else return rc; devname = (char *) tagfind (taglist, TAG_ADBDEVICE, (long) DEFAULT_ADB); if ((rc = copy_path (devname, base->adbdev, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((base->fd_adb = open(base->adbdev, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open ADB device %s: %s\n"), devname, strerror(errno)); return E_OPEN; } } else return rc; base->version = get_pmu_version(base->fd_adb); base->machine = getMachineID (base->version); snprintf(base->identity, STDBUFFERLEN, "%s - PMU version: %d", getMachineName(base->machine), base->version); ioctl(base->fd_pmu, PMU_IOC_CAN_SLEEP, &val); base->flags.sleepsupported = val == 1 ? 1 : 0; /* check if sleep is supported on this system */ /* If this PowerBook has an ambient light sensor connected * to the I2C bus, search for the device and save name and * bus address */ if ((base->lmuaddr = getLMUAddress()) != 0) strncpy (base->i2cdev, findLMUDevice(base->lmuaddr), STDBUFFERLEN); /* If we have an Ambient light sensor in this PowerBook, we * must measure the LCD feedback to this sensor in current * state. To do this we switch the backlight off for a moment * to measure the real ambient light level. */ if (haveI2CAmbient() || havePMUAmbient()) { print_msg (PBB_INFO, _("LMU found, ambient light sensor and keyboard illumination active.\n")); val = process_queue_single (QUERYQUEUE, TAG_HW_BACKLIGHT, -1); pmac_set_lcdbacklight (0); /* measure LCD feedback */ pmac_set_lcdbacklight (val); /* restore LCD backlight level */ } pmac_update_flags (); pmac_update_batteryinfo (); base->flagschanged = 0; #ifdef DEBUG print_msg (PBB_INFO, "DBG: Machine: %0x\n", base->machine); print_msg (PBB_INFO, "DBG: Keyboard: %s\n", haveADBKeyboard () ? "ADB" : "USB"); print_msg (PBB_INFO, "DBG: Trackpad: %s\n", haveADBTrackpad () ? "ADB" : "USB"); print_msg (PBB_INFO, "DBG: Ambient: %s\n", haveI2CAmbient () ? "I2C" : havePMUAmbient () ? "PMU" : "None"); #endif base->trackpad_mode = trackpad_get_config(); /* get trackpad mode */ if (base->version != OHARE_PMU) { base->keyboard_mode = keyboard_get_config(); /* get keyboard config*/ /* If the kernel has been compiled with CONFIG_PMAC_BACKLIGHT_LEGACY * the following ioctl is needed to disable the ancient backlight * control of the kernel. Otherwise the new sysfs interface to the * backlight will not work correctly on PowerBooks. * The ioctl doesn't matter if the PMU backlight driver is used or * the kernel legacy code was not compiled in. * Because this is a PowerBook speciality the ioctl is called here and * not in the sysfs backlight driver. */ ioctl(base->fd_pmu, PMU_IOC_GRAB_BACKLIGHT, &DUMMY); } if ((addInputSource (base->fd_pmu, pmac_pmu_handler, NULL, FALSE)) == NULL) print_msg (PBB_WARN, _("Can't install PMU input handler. Some functionality may be missing.\n")); /* register keyboard handler for trackpad control only if we have an ADB trackpad */ if (haveADBTrackpad ()) register_function (KBDQUEUE, pmac_keyboard); register_function (MOUSEQUEUE, pmac_mouse); register_function (T100QUEUE, pmac_timer100); register_function (T1000QUEUE, pmac_timer1000); register_function (SECUREQUEUE, pmac_secure); return 0; } int pmac_close () { struct moddata_pmac *base = &modbase_pmac; batlog_save(); /* save batlog info to disc */ if (base->fd_pmu != -1) close (base->fd_pmu); /* close PMU device */ if (base->fd_adb != -1) close (base->fd_adb); /* close ADB device */ return 0; } int pmac_exit () { return 0; } void pmac_keyboard (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value == 1 || value == 2) { /* trackpad tapping control * the left mouse button must be filtered out because it will * break NoTapTyping. The Trackpad will emulate a left mouse * button which causes that 'tapping' will be disabled. The * event system received a 'mouse button down' but a 'mouse * button up' will never be seen. This leads to a weird * trackpad behaviour. */ if (code != BTN_LEFT && !isModifier (code, mod) && base->flags.notap_typing) { if (base->trackpad_pause == 0) { trackpad_set_config(TRACKPAD_NOTAP); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping disabled\r"); fflush (stdout); #endif } base->trackpad_pause = TRACKPAD_PAUSETIME; } } if (value == 1) { /* trackpad mode keys */ if ((code == base->keytpmodeup) && (mod == base->modtpmodeup)) { if (++base->trackpad_mode > TRACKPAD_LAST) base->trackpad_mode = 0; } else if ((code == base->keytpmodedn) && (mod == base->modtpmodedn)) { if (--base->trackpad_mode < 0) base->trackpad_mode = TRACKPAD_LAST; } else return; trackpad_set_config(base->trackpad_mode); singletag_to_clients (CHANGEVALUE, TAG_TPMODE, base->trackpad_mode); } } void pmac_mouse (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; /* trackpad tapping control */ if (base->trackpad_pause) { base->trackpad_pause = 0; trackpad_set_config(base->trackpad_mode); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping enabled \r"); fflush (stdout); #endif } } /* This function is called when the user is idle. That means no key is pressed */ void pmac_secure (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; if (base->flags.set_kbdmode == 1) { base->flags.set_kbdmode = 0; keyboard_set_config(base->keyboard_mode); } else if (base->flags.goto_sleep == 1) { base->flags.goto_sleep = 0; if (base->flags.sleepsupported) { batlog_save(); process_queue_single (CONFIGQUEUE, TAG_PREPAREFORSLEEP, 0); #ifdef WITH_PMUD activate_sleepmode (); base->flagschanged = pmac_update_flags (); #else do { activate_sleepmode (); base->flagschanged = pmac_update_flags (); } while (base->flags.coveropen == 0); #endif base->timeleft = 7200; /* reset time value so that the */ /* filter approximate the real value from top. Otherwise */ /* an errornous battery warnlevel could be sent to */ /* clients because the filtered value doesn't cross the */ /* thresholds quick enough. This problem occours only */ /* after wakeup on battery after the battery had been */ /* recharged during sleep. */ pmac_update_batteryinfo (); process_queue_single (CONFIGQUEUE, TAG_WAKEUPFROMSLEEP, 0); base->batlog_cycle = batlog_setup(); } } } void pmac_query (struct tagitem *taglist) { pmac_handle_tags (MODE_QUERY, taglist); } void pmac_configure (struct tagitem *taglist) { pmac_handle_tags (MODE_CONFIG, taglist); } void pmac_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; int err; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_REINIT: /* system tag */ trackpad_set_config(base->trackpad_mode); base->flags.set_kbdmode = 1; /* reset keyboard mode */ break; case TAG_PMUDEVICE: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->pmudev, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); } else taglist->data = (long) base->pmudev; break; case TAG_ADBDEVICE: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->adbdev, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); } else taglist->data = (long) base->adbdev; break; case TAG_BACKLIGHTLEVEL: /* private tag */ if (cfgure) pmac_set_lcdbacklight (taglist->data); else taglist->data = process_queue_single (QUERYQUEUE, TAG_HW_BACKLIGHT, -1); break; case TAG_TPMODEUPKEY: if (cfgure) base->keytpmodeup = taglist->data; else taglist->data = base->keytpmodeup; break; case TAG_TPMODEUPMOD: if (cfgure) base->modtpmodeup = taglist->data; else taglist->data = base->modtpmodeup; break; case TAG_TPMODEDOWNKEY: if (cfgure) base->keytpmodedn = taglist->data; else taglist->data = base->keytpmodedn; break; case TAG_TPMODEDOWNMOD: if (cfgure) base->modtpmodedn = taglist->data; else taglist->data = base->modtpmodedn; break; case TAG_TPMODE: if (cfgure) { base->trackpad_mode = taglist->data > TRACKPAD_LAST ? 0 : taglist->data; trackpad_set_config(base->trackpad_mode); singletag_to_clients (CHANGEVALUE, TAG_TPMODE, base->trackpad_mode); } else taglist->data = base->trackpad_mode; break; case TAG_NOTAPTYPING: if (cfgure) base->flags.notap_typing = taglist->data & 1; else taglist->data = base->flags.notap_typing; break; case TAG_KBDMODE: if (cfgure) { if (base->version != OHARE_PMU) { base->keyboard_mode = taglist->data > KEYBOARD_LAST ? 0 : taglist->data; if (haveADBKeyboard() && !taglist->data) { print_msg (PBB_WARN, _("ADB keyboard can't disable fnmode, force mode to 'fkeyslast'.\n")); base->keyboard_mode = KEYBOARD_FNBACK; } base->flags.set_kbdmode = 1; /* request a secure function call */ } } else taglist->data = base->keyboard_mode; break; case TAG_BATLOG: if (cfgure) { batlog_save(); base->batlog_mode = taglist->data > BATLOG_LAST ? 0 : taglist->data; base->batlog_cycle = batlog_setup(); } else taglist->data = base->batlog_mode; break; case TAG_BATCYCLE: if (cfgure) tagerror(taglist, E_NOWRITE); else taglist->data = base->batlog_cycle; break; case TAG_REQUESTSLEEP: /* private tag */ if (cfgure) base->flags.goto_sleep = 1; /* trigger delayed sleep */ break; case TAG_IDENTITY: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = (long) base->identity; break; case TAG_SLEEPSUPPORTED: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.sleepsupported; break; #ifndef WITH_IBAM case TAG_TIMEREMAINING: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->timeleft; break; #endif case TAG_POWERSOURCE: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->flags.ac_power; break; case TAG_BATTERYPRESENT: if (cfgure) tagerror (taglist, E_NOWRITE); /* /proc/pmu is not reliable on machines with removable batteries. * If no batteries were plugged in, /proc/pmu would not be updated * anymore and contains the last battery data, which is not valid * anymore. * So pbbuttonsd ask the PMU for the existance of any battery and * report the values from /proc/pmu only if the answer was yes. */ else taglist->data = base->flags.batpresent ? base->flags.bat_present : 0; break; case TAG_AMBIENTLIGHT: if (!haveI2CAmbient() && !havePMUAmbient()) tagerror (taglist, E_NOSUPPORT); else if (cfgure) #if defined(DEBUG) && SIMUAMBIENT base->ambient = taglist->data; #else tagerror (taglist, E_NOWRITE); #endif else taglist->data = getAmbient(); break; case TAG_KEYBLIGHTLEVEL: /* private tag */ if (cfgure) setKBDIllumination (taglist->data); break; case TAG_KEYBLIGHTMAX: /* private tag */ if (cfgure) ; else taglist->data = KEYBLIGHTMAX; break; case TAG_SYSINFOSLAVE: if (cfgure) ; else { taglist->data |= haveADBKeyboard () ? 0 : SYSINFO_PB_USB_KBD; taglist->data |= haveADBTrackpad () ? 0 : SYSINFO_PB_USB_TPAD; } } taglist++; } } gboolean pmac_pmu_handler (int fd, gpointer user_data) { unsigned char intr[16]; struct tagitem taglist[4]; int n; static int PBpressed = 0; #if defined(DEBUG) && PMUINTR int i; #endif if ((n = read(fd, intr, sizeof(intr))) > 0) { switch (intr[0]) { case 4: if (n < 3 || intr[2] < 1 || intr[2] > 2) break; call_script ("/sbin/cardctl %s %d", "eject", intr[2]-1); break; case 0x40: /* timer interrupt */ /* no battery present -> no timer interrupts on G3 Pismo*/ /* n = 2 && intr[1] = 0x04 = %00100 std timer interrupt */ /* n = 2 && intr[1] = 0x14 = %10100 if a battery is present */ /* n = 2 && intr[1] = 0x0c = %01100 power button on mac-mini */ /* n = 6 && intr[1] = 0x1c = %11100 if power button is pressed */ /* n = 6 && intr[1] = 0x15 = %10101 after cover close */ if (n == 6 && ((intr[1] >> 3) & 1) != PBpressed) { PBpressed = (intr[1] >> 3) & 1; taglist_init (taglist); taglist_add (taglist, TAG_KEYCODE, KEY_POWER); taglist_add (taglist, TAG_KEYREPEAT, PBpressed ? 1 : 0); taglist_add (taglist, TAG_MODIFIER, 0); process_queue (KBDQUEUE, taglist); } break; } #if defined(DEBUG) && PMUINTR printf ("\nPMU interrupt: "); for (i=0; i < n; i++) printf ("%.2x ", intr[i]); printf ("\n"); #endif } return TRUE; /* we assume that the filehandle for /dev/pmu can't be closed from outside pbbuttonsd */ } void pmac_timer100 (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; struct tagitem args[6]; int val; taglist_init (args); if (base->version == OHARE_PMU) { /* PowerBook 3400, etc */ if ((val = get_button(base->fd_adb, PMU_GET_VOLBUTTON)) >= 0) { val = val > 64 ? 100 : val * 100 / 64; if (base->oharevolbutton != val) { base->oharevolbutton = val; taglist_add (args, TAG_VOLUME, val); } } if ((val = get_button(base->fd_adb, 0x49)) >= 0) { val = 18 - (val >> 2); /* This formula was derived for the usual pmac backlights */ if (val > 15) val = 15; /* which uses 16 brightness steps. 0=min, 15=max */ if (val < 0) val = 0; if (base->oharebrightbutton != val) { base->oharebrightbutton = val; taglist_add (args, TAG_LCDBRIGHTNESS, val); } } } /* trackpad tapping control */ if (base->trackpad_pause) { if ((--base->trackpad_pause) == 0) { trackpad_set_config(base->trackpad_mode); #if defined(DEBUG) && TRACKPAD printf ("Trackpad tapping enabled \r"); fflush (stdout); #endif } } if (args[0].tag != TAG_END) process_queue (CONFIGQUEUE, args); /* distribute changes to other modules */ } void pmac_timer1000 (struct tagitem *taglist) { struct moddata_pmac *base = &modbase_pmac; struct tagitem args[6]; int val; taglist_init (args); val = base->timeleft; if (base->flagschanged == 0) /* check if anybody else has already read the flags */ base->flagschanged = pmac_update_flags (); /* if not, get ac power and cover status */ pmac_update_batteryinfo (); #ifndef WITH_PMUD /* The COVERSTATUS must be sent before POWERCHANGED because the * POWERCHANGED code in module_powersave.c rely on the correct * cover status. */ if (base->flagschanged & PMU_ENV_LID_CLOSED) taglist_add (args, TAG_COVERSTATUS, base->flags.coveropen); #endif if (base->flagschanged & PMU_ENV_AC_POWER) { taglist_add (args, TAG_POWERCHANGED, base->flags.ac_power); if (!base->flags.ac_power) /* running on Battery */ base->batlog_cycle++; /* then increase cycle */ } if (val != base->timeleft && !base->flags.ac_power) { #ifndef WITH_IBAM taglist_add (args, TAG_TIMECHANGED, base->timeleft); #endif batlog_write(base->timeleft); } if (args[0].tag != TAG_END) process_queue (CONFIGQUEUE, args); /* distribute changes to other modules */ base->flagschanged = 0; } /* ------------------------------- MISCELLANEOUS FUNCTIONS ----------------------------------- */ /* This function put the machine into sleep mode. It tries pmud first. If it was not available, it would go directly over the PMU. Very importent is, that no modifier key is pressed, when this function is called, because this would confuse the input driver after wakeup. This case is not fully avoided, because this function is not atomic and with some fast actions the user could bypass our security gate. The second point is that current states of the trackpad and the keyboard will only stored locally. This will normally have no side effects but the global variables base->trackpad_mode and base->keyboard-mode won't be synchronized with the hardware here anymore. So the states set by external programs will survive sleep but also will be overwritten as soon as pbbuttonsd access one of the devices. */ void activate_sleepmode () { struct moddata_pmac *base = &modbase_pmac; int tpmode, kbdmode = 0; #ifdef WITH_PMUD char buf[35]; int fd; #endif tpmode = trackpad_get_config (); if (base->version != OHARE_PMU) kbdmode = keyboard_get_config (); sync(); #ifndef WITH_PMUD /* PMU_IOC_SLEEP only succeeds if called as root. * It returns immediatly if not, without putting * the mashine to sleep */ ioctl (base->fd_pmu, PMU_IOC_SLEEP, 0); /* returns after next awake */ trackpad_set_config(tpmode); #else if (((fd = tcp_open("localhost", "pmud", 879)) < 0)) { print_msg (PBB_WARN, _("Can't find pmud on port 879. Trigger PMU directly for sleep.\n")); ioctl (base->fd_pmu, PMU_IOC_SLEEP, 0); /* returns after next awake */ trackpad_set_config(tpmode); } else { tcp_printf(fd, "sleep\n"); /* read some bytes, in order to prevent pmud complaining about * dropped connections, before ever handling the 'sleep' command */ tcp_printf(fd, "\n"); sleep(6); /* give pmud time to snooze */ tcp_read(fd, buf, sizeof(buf)); tcp_close(fd); } #endif if (base->version != OHARE_PMU) keyboard_set_config(kbdmode); } /* This function gets the battery status from the PMU kernel driver via * /proc/pmu and fill all battery slots of moddata struct, also if less * batteries are present.The following flags were set accordingly: * ac_power, bat_present and charging. */ void pmac_update_batteryinfo () { struct moddata_pmac *base = &modbase_pmac; FILE *fd; char buffer[100], *token; int val, n, syscurrent, time_rem = 0; int charge, chargemax, current, voltage, timeleft[MAX_BATTERIES]; syscurrent = 0; for (n=0; n < MAX_BATTERIES; n++) { charge = chargemax = current = voltage = timeleft[n] = 0; base->flags.bat_present &= ~(1<flags.bat_present |= (val & 1) << n; base->flags.bat_charging = (base->flags.bat_charging & ~(1<> 1) << n); } else if (!strncmp ("charge", token, 6)) { charge = atoi(strtok(0, ":\n")); } else if (!strncmp ("max_charge", token, 9)) { chargemax = atoi (strtok(0,":\n")); } else if (!strncmp ("current", token, 7)) { current = atoi (strtok(0, ":\n")); } else if (!strncmp ("voltage", token, 7)) { voltage = atoi (strtok(0,":\n")); } else if (!strncmp ("time rem.", token, 8)) { timeleft[n] = atoi (strtok(0, ":\n")); } else strtok (0,":\n"); } } fclose(fd); } base->charge[n] = charge; base->chargemax[n] = chargemax; base->voltage[n] = voltage; syscurrent += base->current[n] = current; /* overall current out of the batteries */ } /* work around for kernel bug: After booting without batteries the kernel doesn't recognise the ac plug and thought by mistake the computer runs on batteries but there were no batteries connected. So we check for batteries here and if none were found it would have to be AC. */ if (!base->flags.ac_power && !base->flags.bat_present) base->flags.ac_power = 1; /* During plug and unplug of the AC connector it could happen that the pmu time remaining temporarely is set to zero. In this case we freeze the timeleft and wait until the pmu time remaining value returns to a valid value */ if (syscurrent < 0) { /* computer runs on battery */ for (n=0; n < MAX_BATTERIES; n++) { if ((timeleft[n] > 0) || (base->charge[n] == 0)) /* is /proc/pmu reliable ? */ time_rem += timeleft[n]; /* then use it */ else if (base->version == OHARE_PMU) /* otherwise calculate it by yourself */ time_rem += base->charge[n] * 274 / (-syscurrent); /* formula for old Notebooks */ else time_rem += base->charge[n] * 3600 / (-syscurrent); /* formula for modern Notebools */ } } else time_rem = -1; if (time_rem != -1) { if (base->timeleft >= 0) time_rem = base->timeleft + (time_rem - base->timeleft) / 8; /* very simple low pass filter */ base->timeleft = time_rem; } } /* use /proc/pmu/info as fallback, if PMU_GET_COVER did't work * As I know this has not happend yet and it is doubtable that * /proc/pmu/info will work correctly in this case. So this * routine may be removed in future versions. */ int pmac_get_procac () { FILE *fd; char buffer[100], *token; int ac = 0; /* return battery if anything fails */ if ((fd = fopen ("/proc/pmu/info","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { if (!strncmp ("AC Power", token, 8)) ac = atoi (strtok(0,":\n")); else strtok (0,":\n"); } fclose(fd); } return ac; } /* This funtion gets some important flags from the PMU driver. If the * driver doesn't support the ioctl or reports an error, power source * will be read from /proc/pmu/info as fallback, so that power source * should always be set correctly. */ int pmac_update_flags() { struct moddata_pmac *base = &modbase_pmac; int env, envold, envnew; envold = base->flags.ac_power ? PMU_ENV_AC_POWER : 0; envold |= base->flags.coveropen ? PMU_ENV_LID_CLOSED : 0; env = get_int_environment(base->fd_adb); if (env != -1) { base->flags.coveropen = (env & PMU_ENV_LID_CLOSED) ? 0 : 1; base->flags.ac_power = (env & PMU_ENV_AC_POWER) ? 1 : 0; base->flags.batpresent = (env & PMU_ENV_BATTERY_PRESENT) ? 1 : 0; } else base->flags.ac_power = pmac_get_procac(); /* the PB G3 lombard PMU doesn't support the AC power flag in * environment flags. We use the /proc entry instead. */ if (base->version < 12) base->flags.ac_power = pmac_get_procac(); envnew = base->flags.ac_power ? PMU_ENV_AC_POWER : 0; envnew |= base->flags.coveropen ? PMU_ENV_LID_CLOSED : 0; return (envold ^ envnew); } void pmac_set_lcdbacklight (int val) { struct moddata_pmac *base = &modbase_pmac; int ambient; if (val == -1) /* no backlight controller available */ return; ambient = getRawAmbient () - base->lcdfeedback; process_queue_single (CONFIGQUEUE, TAG_HW_BACKLIGHT, val); base->lcdfeedback = val ? getRawAmbient () - ambient : 0; #if defined(DEBUG) && (TESTAMBIENT || SIMUAMBIENT) ambient = getRawAmbient (); printf("LCD Level: %2d, Raw (%4d) - LCD Feedback (%4d) = Ambient (%4d or %2d%%)\n", val, ambient, base->lcdfeedback, ambient - base->lcdfeedback, getAmbient()); fflush(stdout); #endif return; } /* ---------------------------- GENERIC FUNCTIONS ----------------------------- */ int isModifier (int code, int mod) { if (mod) { switch (code) { case KEY_LEFTCTRL: case KEY_LEFTALT: case KEY_LEFTSHIFT: case KEY_LEFTMETA: case KEY_RIGHTCTRL: case KEY_RIGHTALT: case KEY_RIGHTSHIFT: case KEY_RIGHTMETA: case KEY_COMPOSE: case KEY_CAPSLOCK: case KEY_NUMLOCK: case KEY_SCROLLLOCK: return 1; /* key is modifier */ } } return 0; /* key is not a modifier */ } int haveADBKeyboard () { struct moddata_pmac *base = &modbase_pmac; if (base->machine > 0) { if (base->machine < 0x56) /* 0 - 56 -> true */ return 1; if (base->machine > 0x67) /* 68 - ?? -> false */ return 0; if (((base->machine >> 4) & 0xf) == 5) if (base->machine >= 0x56) /* 56 - 5f -> false */ return 0; if (((base->machine >> 4) & 0xf) == 6) if (base->machine <= 0x67) /* 60 - 67 -> true */ return 1; } return 0; } int haveADBTrackpad () { struct moddata_pmac *base = &modbase_pmac; if (base->machine > 0) { if (base->machine < 0x56) /* 0 - 55 -> true */ return 1; if (base->machine > 0x67) /* 68 - ?? -> false */ return 0; if (((base->machine >> 4) & 0xf) == 5) if (base->machine >= 0x56) /* 56 - 5f -> false */ return 0; if (((base->machine >> 4) & 0xf) == 6) if (base->machine <= 0x67) /* 60 - 67 -> true */ return 1; } return 0; } int haveI2CAmbient () { struct moddata_pmac *base = &modbase_pmac; #if defined(DEBUG) && SIMUAMBIENT return 1; #endif if ((base->machine >= 0x51) && (base->machine <= 0x57)) if (base->lmuaddr != 0 && strlen(base->i2cdev) > 0) return 1; return 0; } int havePMUAmbient () { struct moddata_pmac *base = &modbase_pmac; if ((base->machine >= 0x58) && (base->machine <= 0x59)) return 1; return 0; } /* ------------------ POWER MAC SPECIFIC KEYBOARD FUNCTIONS ------------------- */ int keyboard_get_config () { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int fd, n, dev, config = -1; if (haveADBKeyboard()) { if ((dev = keyboard_get_dev (base->fd_adb)) > 0) { if ((n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 1)) > 0) { config = ADBBuffer[3] & 0x01 ? KEYBOARD_FNTOP : KEYBOARD_FNBACK; } } } else if ((fd = open (PATH_FNMODE, O_RDONLY)) >= 0) { if ((n = read (fd, ADBBuffer, ADB_BUFSIZE-1)) > 0) { ADBBuffer[n] = 0; /* terminate read buffer */ config = atoi((const char*)ADBBuffer); #ifdef DEBUG printf ("DBG: Keyboard config read: '%s' -> %d.\n", ADBBuffer, config); #endif } close (fd); } return config; } void keyboard_set_config (int config) { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int fd, n, dev; if (haveADBKeyboard()) { if ((dev = keyboard_get_dev (base->fd_adb)) > 0) { n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 1); if (n > 0) { ADBBuffer[3] &= 0xfe; ADBBuffer[3] |= (config == KEYBOARD_FNTOP) ? 0x01 : 0x00; adb_write_reg (base->fd_adb, ADBBuffer, n, dev, 1); } } } else if ((fd = open (PATH_FNMODE, O_WRONLY)) >= 0) { sprintf ((char*)ADBBuffer, "%d", config); write (fd, ADBBuffer, strlen((const char*)ADBBuffer)); #ifdef DEBUG printf ("DBG: Keyboard config written: '%s' -> %d.\n", ADBBuffer, config); #endif close (fd); } } int keyboard_get_dev (int fd) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; for (n=1; n<16; n++) { if ((adb_read_reg (fd, ADBBuffer, n, 3)) > 0) { if (((ADBBuffer[2] & 0x0f) == 2) && /* device id = keyboard */ ((ADBBuffer[3] & 0xc0) == 0xc0)) { /* keyboard type */ return n; } } } return -1; } /* -------------------- POWER MAC SPECIFIC TRACKPAD FUNCTIONS ------------------ */ int trackpad_get_config () { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int n, dev, config = -1; if (haveADBTrackpad()) { if ((dev = trackpad_get_dev (base->fd_adb)) > 0) { trackpad_set_prgmode (base->fd_adb, dev, 1); n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 2); if (n > 0) { if (ADBBuffer[5] == 0xff) config = TRACKPAD_LOCK; else if (ADBBuffer[3] == 0x94) config = TRACKPAD_DRAG; else if (ADBBuffer[2] == 0x99) config = TRACKPAD_TAP; else config = TRACKPAD_NOTAP; } trackpad_set_prgmode (base->fd_adb, dev, 0); } } return config; } void trackpad_set_config (int config) { struct moddata_pmac *base = &modbase_pmac; unsigned char ADBBuffer[ADB_BUFSIZE]; int n, dev; if (haveADBTrackpad()) { if ((dev = trackpad_get_dev (base->fd_adb)) > 0) { trackpad_set_prgmode (base->fd_adb, dev, 1); n = adb_read_reg (base->fd_adb, ADBBuffer, dev, 2); if (n > 0) { ADBBuffer[2] = (config < TRACKPAD_TAP) ? 0x19 : 0x99; ADBBuffer[3] = (config < TRACKPAD_DRAG) ? 0x14 : 0x94; ADBBuffer[5] = (config < TRACKPAD_LOCK) ? 0xb2 : 0xff; adb_write_reg (base->fd_adb, ADBBuffer, n, dev, 2); } trackpad_set_prgmode (base->fd_adb, dev, 0); } } } int trackpad_get_dev (int fd) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; for (n=1; n<16; n++) { if ((adb_read_reg(fd, ADBBuffer, n, 1)) > 4) { if ((ADBBuffer[2] == 0x74) && (ADBBuffer[3] == 0x70) && /* 'tpad' */ (ADBBuffer[4] == 0x61) && (ADBBuffer[5] == 0x64) && (ADBBuffer[8] == 0x03)) { /* class:Trackpad */ return n; } } } return -1; } void trackpad_set_prgmode (int fd, int dev, int mode) { unsigned char ADBBuffer[ADB_BUFSIZE]; int n; n = adb_read_reg(fd, ADBBuffer, dev, 1); if (n > 0) { ADBBuffer[8] = mode ? 0x0d : 0x03; adb_write_reg(fd, ADBBuffer, n, dev, 1); adb_read_reg(fd, ADBBuffer, dev, 2); /* nessecary to activate program mode ! */ } } /* ----------------------------- LOW LEVEL ADB FUNCTIONS ---------------------------- */ #if defined(DEBUG) && PMUTALK /* Debug functions to track down mysterious shutdowns and freezes */ #define DEBUGLOG "/var/log/pbbuttonsd" void debug_wrtcmd (char *title, unsigned char *buffer, int size) { struct timeval tv; FILE *fd; int i; gettimeofday(&tv, NULL); if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ fprintf (fd, "%ld.%4d %-20s (%d)", tv.tv_sec, (int)tv.tv_usec/1000, title, size); for (i=0; i < size; i++) { fprintf (fd, " %02x", buffer[i]); } fclose(fd); } } void debug_wrtrc (int rc, int expected) { FILE *fd; if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ if (rc == -1 || rc != expected) fprintf(fd, "\t-- FAIL\n"); else fprintf(fd, "\t-- ok\n"); fclose(fd); } } void debug_rdcmd (char *title, unsigned char *buffer, int size) { struct timeval tv; FILE *fd; int i; gettimeofday(&tv, NULL); if ((fd = fopen(DEBUGLOG, "a")) != NULL) { /* open protocol file */ fprintf (fd, "%ld.%4d %-20s (%d)", tv.tv_sec, (int)tv.tv_usec/1000, title, size); if (size >= 0) { for (i=0; i < size; i++) { fprintf (fd, " %02x", buffer[i]); } fprintf(fd, "\t-- ok\n"); } else fprintf(fd, "\t-- FAIL\n"); fclose(fd); } } /* ---------------------------------------------------------------*/ #endif /* This function sends a request to the PMU via the ADB bus and reads the result. If successful the count of valid data bytes in the buffer will be returned, otherwise -1 */ int send_pmu_request(int fd, unsigned char *buffer, int params, ...) { va_list list; int n, x; if (params < 0 || params > 30) return -1; buffer[0] = PMU_PACKET; va_start(list, params); for (x = 0; x < params; ++x) buffer[x+1] = va_arg(list, int); va_end(list); #if defined(DEBUG) && PMUTALK debug_wrtcmd("PMU request", buffer, x+1); #endif n = write(fd, buffer, x+1); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, x+1); #endif if ((n != x+1) || (n == -1)) return -1; n = read(fd, buffer, ADB_BUFSIZE); #if defined(DEBUG) && PMUTALK debug_rdcmd("PMU answer", buffer, n); #endif if (n < 0) return -1; return n; } /* This function reads a register from an ADB device into a Buffer. The data starts at byte 1 in buffer. Byte 0 contains the Packettype and could be ignored. The funtion returns the count of valid data bytes in the buffer (excluding byte 0) */ int adb_read_reg(int fd, unsigned char *ADBBuffer, int dev, int reg) { int n; ADBBuffer[0] = ADB_PACKET; ADBBuffer[1] = ADB_READREG(dev, reg); #if defined(DEBUG) && PMUTALK debug_wrtcmd("ADB read register", ADBBuffer, 2); #endif n = write(fd, ADBBuffer, 2); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, 2); #endif if (n != 2) return -1; n = read(fd, ADBBuffer+1, ADB_BUFSIZE-1); #if defined(DEBUG) && PMUTALK debug_rdcmd("ADB read answer", ADBBuffer, n); #endif return n; } /* This function writes a register into an ADB device. The first two bytes of the buffer are set by this funtion. */ int adb_write_reg(int fd, unsigned char *ADBBuffer, int len, int dev, int reg) { int n; len++; /* take care about the command byte */ ADBBuffer[0] = ADB_PACKET; ADBBuffer[1] = ADB_WRITEREG(dev, reg); #if defined(DEBUG) && PMUTALK debug_wrtcmd("ADB write register", ADBBuffer, 2); #endif n = write(fd, ADBBuffer, len); #if defined(DEBUG) && PMUTALK debug_wrtrc(n, len); #endif if (n != len) return -1; n = read(fd, ADBBuffer+1, ADB_BUFSIZE-1); #if defined(DEBUG) && PMUTALK debug_rdcmd("ADB write answer", ADBBuffer, n); #endif return 0; } /* ----------------------------- LOW LEVEL PMU FUNCTIONS ---------------------------- */ int get_pmu_version(int fd) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, PMU_GET_VERSION); if (count == 2) return buffer[1]; else return -1; } int get_button(int fd, int button) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, button); if (count == 2) return buffer[1]; else return -1; /* not available or invalid */ } int get_int_environment(int fd) { int count; unsigned char buffer[ADB_BUFSIZE]; count = send_pmu_request(fd, buffer, 1, PMU_GET_COVER); if (count == 2) return buffer[1]; else return -1; /* not available or invalid */ } /* ----------------------------- LOW LEVEL LMU FUNCTIONS ---------------------------- */ int addPath(char *path, int maxlen, char *pattern) { DIR *dh; struct dirent *dir; int rc = 1; if ((dh = opendir(path))) { while ((dir = readdir(dh))) { if ((strncmp(dir->d_name, pattern, strlen(pattern)) == 0)) { strncat(path, "/", maxlen-1); strncat(path, dir->d_name, maxlen-1); rc = 0; break; } } closedir(dh); } return rc; } /* This function searches the device-tree for the lmu-controller to * read its I2C bus address. Two device paths are searched: * uni-n/i2c/lmu-controller/reg or * uni-n/i2c/i2c-bus/lmu-micro/reg * * If the file 'reg' is found it contents divided by two will be * returned. Otherwise the result is 0. */ int getLMUAddress() { char path[200]; long reg; int fd, n, rc = 0, err = 0; path[0] = 0; /* terminate path buffer */ strncat(path, OFBASE, sizeof(path)-1); if ((err = addPath(path, sizeof(path), "uni-n")) == 0) if ((err = addPath(path, sizeof(path), "i2c")) == 0) if ((err = addPath(path, sizeof(path), "lmu-controller")) != 0) if ((err = addPath(path, sizeof(path), "i2c-bus")) == 0) err = addPath(path, sizeof(path), "lmu-micro"); strncat(path, "/reg", sizeof(path)-1); if (err == 0 && (fd = open(path, O_RDONLY)) >= 0) { n = read(fd, ®, sizeof(long)); if (n == sizeof(long)) rc = (int) (reg >> 1); close(fd); } return rc; } int probeLMU(char *device, int addr) { char buffer[4]; int fd, rc = 0; if ((fd = open(device, O_RDWR)) >= 0) { if (ioctl(fd, I2C_SLAVE, addr) >= 0) { if (read (fd, buffer, 4) == 4) rc = 1; } close(fd); } else print_msg (PBB_ERR, _("Can't access i2c device %s - %s.\n"), device, strerror(errno)); return rc; } /* This function tries to find the I2C device that controls the keyboard * illumination and the ambient light sensor used in some alluminum PowerBooks * It returns the device file name on success or an empty string, if no LMU * controller could be found. * The function uses the sysfs to find the appropriate i2c device to which the * LMU controller is connected to. The kernel module i2c-dev must be loaded * for this function to work. */ const char* findLMUDevice(int addr) { static char buffer[40]; DIR *dh; struct dirent *dir; unsigned int n; int fd; if ((dh = opendir(SYSI2CDEV))) { while ((dir = readdir(dh))) { if (dir->d_name[0] == '.') continue; snprintf(buffer, sizeof(buffer), SYSI2CDEV"/%s/name", dir->d_name); if ((fd = open(buffer, O_RDONLY)) >= 0) { n = read(fd, buffer, sizeof(buffer)); close(fd); if (n > 0 && n < sizeof(buffer)) { buffer[n-1] = 0; if ((strncmp(I2CCHIP" ", buffer, 6) == 0)) { snprintf(buffer, sizeof(buffer), "/dev/%s", dir->d_name); if ((probeLMU(buffer, addr))) break; buffer[0] = 0; } } } } closedir(dh); } return buffer; } /* This function returns the a compensated ambient light sensor * value in percent. The reduce flickering through shadows or * spot lights at one of the sensors the sensor with the highest * value is choosen. */ int getAmbient () { struct moddata_pmac *base = &modbase_pmac; int rc, ambientmax; ambientmax = haveI2CAmbient() ? 1600 : 2048; rc = (int) (((getRawAmbient() - base->lcdfeedback) * 100) / ambientmax); if (rc < 0) rc = 0; if (rc > 100) rc = 100; return rc; } /* The first ambient light sensor was connected to the I2C * Bus but recent PowerBooks 5.8 and 5.9 have a new ambient * light sensor connected to the PMU. This functions reads * the current sensor value from the right interface. */ int getRawAmbient () { struct moddata_pmac *base = &modbase_pmac; unsigned char buf[ADB_BUFSIZE]; int fd, rc = -1, rc2; #if defined(DEBUG) && SIMUAMBIENT int ambient, level, idx, max; /* this array contains sensor values depending on the * LCD brightness without additional ambient light. * They simulate the LCD brightness influence on the * light sensors and are for debugging only. * * This function simulates an I2C ambient sensor and * will also work with more than 16 LCD brightness * levels. */ int asens[] = {2, 182, 217, 248, 309, 337, 381, 423, 461, 499, 538, 576, 620, 1072, 1073, 1077}; level = process_queue_single (QUERYQUEUE, TAG_HW_BACKLIGHT, -1); max = process_queue_single (QUERYQUEUE, TAG_BACKLIGHTMAX, -1); idx = level * sizeof(asens) / sizeof(int) / (max + 1); ambient = asens[level == -1 ? 0 : idx] + base->ambient; if (ambient > 1600) ambient = 1600; return ambient; #else if (haveI2CAmbient()) { if ((fd = open (base->i2cdev, O_RDWR)) >= 0 ) { if (ioctl (fd, I2C_SLAVE, base->lmuaddr) >= 0 ) if (read (fd, buf, 4 ) == 4) { rc = (buf[0] << 8) | buf[1]; rc2 = (buf[2] << 8) | buf[3]; rc = rc > rc2 ? rc : rc2; } close (fd); } } if (havePMUAmbient()) { if (send_pmu_request (base->fd_adb, buf, 2, 0x4F, 1) == 5) { rc = (buf[2] << 8) | buf[1]; rc2 = (buf[4] << 8) | buf[3]; rc = rc > rc2 ? rc : rc2; } } return rc; #endif } void setKBDIllumination (unsigned short level) { #if !(defined(DEBUG) && SIMUAMBIENT) struct moddata_pmac *base = &modbase_pmac; unsigned char buf[ADB_BUFSIZE]; int fd; if (level > KEYBLIGHTMAX) level = KEYBLIGHTMAX; /* check bounds */ if (haveI2CAmbient()) { buf[0] = 0x01; /* i2c register */ /* The format appears to be: * * byte 1 byte 2 * |<---->| |<---->| * xxxx7654 3210xxxx * |<----->| * ^-- brightness */ buf[1] = (unsigned char) level >> 4; buf[2] = (unsigned char) (level & 0x0F) << 4; if ((fd = open (base->i2cdev, O_RDWR)) >= 0 ) { if (ioctl (fd, I2C_SLAVE, base->lmuaddr) >= 0 ) write (fd, buf, 3); close (fd); } } if (havePMUAmbient ()) { send_pmu_request (base->fd_adb, buf, 4, 0x4F, 0, 0, level); } #else printf("KBD Level: %2d at %2d%% Ambient\n", level, getAmbient()); fflush(stdout); #endif } /* -------------------- LOW LEVEL OPEN FIRMWARE FUNCTIONS -------------------- */ int getMachineID(int pmu) { char buffer[32]; int fd, n, machine = 0; if ((fd = open(OFBASE"/model", O_RDONLY))) { if ((n = read(fd, buffer, sizeof(buffer) - 1)) != -1) { buffer[n] = 0; /* terminate buffer, only to be sure */ if (strncmp("PowerBook", buffer, 9) == 0) { if (buffer[9] == 0) /* Dummy codes for pre-Lombard PowerBooks */ machine = pmu - OHARE_PMU + 1; else { machine = (atoi(&buffer[9]) & 0xf) << 4; for (n = 9; buffer[n] != ',' && buffer[n] != '\0'; ++n); if (buffer[n] == ',') machine |= atoi(&buffer[n+1]) & 0xf; } } } close(fd); } return machine; } const char* getMachineName(int mid) { unsigned int x, y; static char *machines[7][10] = { { N_("Unknown PowerBook"), "PowerBook 3400", /* 0,1 */ "PowerBook 3500", /* 0,2 */ "PowerBook Wallstreet (Apr 1998)", /* 0,3 */ NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook 101 Lombard (Apr 1999)", /* 1,1 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "iBook (Feb 2000)", /* 2,1 */ "iBook FireWire (Sep 2000)", /* 2,2 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook G3 Pismo (Feb 2000)", /* 3,1 */ "PowerBook G4 Titanium (Dec 2000)", /* 3,2 */ "PowerBook G4 Titanium II (Oct 2001)", /* 3,3 */ "PowerBook G4 Titanium III (Apr 2002)", /* 3,4 */ "PowerBook G4 Titanium IV (Nov 2002)", /* 3,5 */ NULL, NULL, NULL, NULL }, { NULL, "iBook 2 (May 2001)", /* 4,1 */ "iBook 2 (May 2002)", /* 4,2 */ "iBook 2 rev. 2 (Nov 2002)", /* 4,3 */ NULL, NULL, NULL, NULL, NULL, NULL }, { NULL, "PowerBook G4 17\" (Mar 2003)", /* 5,1 */ "PowerBook G4 15\" (Sep 2003)", /* 5,2 */ "PowerBook G4 17\" (Sep 2003)", /* 5,3 */ "PowerBook G4 15\" (Apr 2004)", /* 5,4 */ "PowerBook G4 17\" (Apr 2004)", /* 5,5 */ "PowerBook G4 15\" (Feb 2005)", /* 5,6 */ "PowerBook G4 17\" (Feb 2005)", /* 5,7 */ "PowerBook G4 15\" (Oct 2005)", /* 5,8 */ "PowerBook G4 17\" (Oct 2005)" }, /* 5,9 */ { NULL, "PowerBook G4 12\" (Jan 2003)", /* 6,1 */ "PowerBook G4 12\" (Sep 2003)", /* 6,2 */ "iBook G4 (Oct 2003)", /* 6,3 */ "PowerBook G4 12\" (Apr 2004)", /* 6,4 */ "iBook G4 (Apr 2004)", /* 6,5 */ NULL, "iBook G4 (Jul 2005)", /* 6,7 */ "PowerBook G4 12\" (Oct 2005)", /* 6,8 */ NULL } }; x = mid >> 4 & 0x0f; y = mid & 0xf; if (x < 7 && y < 10 && machines[x][y] != NULL) return machines[x][y]; else return machines[0][0]; } /* --------------------- BATTERY LOGFILE DEBUG FUNCTIONS --------------------- */ int batlog_setup() { struct moddata_pmac *base = &modbase_pmac; FILE *fd; char buffer[100], *token; char batlog[STDBUFFERLEN]; int chargeold = 0, chargenew, cycle = -1; if (base->batlog_mode) { cycle = 1; if ((fd = fopen (DEFAULT_BATCYCLE,"r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { if (!strncmp ("cycle", token, 5)) cycle = atoi (strtok(0,":\n")); else if (!strncmp ("charge", token, 6)) chargeold = atoi(strtok(0, ":\n")); else strtok (0,":\n"); } fclose(fd); if (!base->flags.ac_power) { chargenew = base->charge[0] + base->charge[1]; if ((chargenew-chargeold) > 50) cycle++; /* start new cycle */ } } snprintf (batlog, STDBUFFERLEN, DEFAULT_BATLOG, cycle); print_msg (PBB_INFO, _("Current battery cycle: %d, active logfile: %s.\n"), cycle, base->batlog_mode == BATLOG_LOG ? batlog : "none"); } return cycle; } void batlog_save() { struct moddata_pmac *base = &modbase_pmac; FILE *fd; if (base->batlog_mode) if ((fd = fopen (DEFAULT_BATCYCLE,"w"))) { fprintf (fd,"cycle : %d\n", base->batlog_cycle); fprintf (fd,"charge : %d\n", base->charge[0] + base->charge[1]); fclose(fd); } } void batlog_write(long timerem) { struct moddata_pmac *base = &modbase_pmac; struct timeval tv; char batlog[STDBUFFERLEN]; FILE *fd; static long curtime = 0; int rc; if (base->batlog_mode != BATLOG_LOG) return; snprintf (batlog, STDBUFFERLEN, DEFAULT_BATLOG, base->batlog_cycle); rc = check_devorfile(batlog, TYPE_FILE); if (rc == E_NOEXIST) { if ((fd = fopen(batlog, "w")) != NULL) { /* open new protocol file */ fprintf(fd, "# battery cycle %d\n# time\tvoltage[0]\tcharge[0]\tchargemax[0]\tvoltage[1]\tcharge[1]\tchargemax[1]\ttimerem.\n", base->batlog_cycle); fclose(fd); rc = 0; } else rc = E_OPEN; } /* to evaluate battery degradation current battery values are written to a lofile for further investigation. Each battery charge/discharge cycle in a seperate file. */ if (rc == 0 && timerem > -1) { gettimeofday(&tv, NULL); if (tv.tv_sec != curtime) { curtime = tv.tv_sec; if ((fd = fopen(batlog, "a")) != NULL) { /* open protocol file */ fprintf(fd, "%ld\t%d\t%d\t%d\t%d\t%d\t%d\t%ld\n", tv.tv_sec, base->voltage[0], base->charge[0], base->chargemax[0], base->voltage[1], base->charge[1], base->chargemax[1], timerem); fclose(fd); } } } } #endif /* WITH_MODULE_PMAC */ pbbuttonsd-0.7.9/src/module_pmac.h0000644000175000017500000001120410506731620014057 00000000000000#ifndef INCLUDE_MODULE_PMAC_H #define INCLUDE_MODULE_PMAC_H /* ---------------------------------------------------------------------------- * module_pmac.h * prototypes and definitions for the laptop module pmac. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include #ifndef I2C_SLAVE #define I2C_SLAVE 0x0703 /* Change slave address (7 or 10 bits) */ #endif #define I2CCHIP "uni-n" #define ADB_BUFSIZE 32 /* Size of the ADB buffer, constant, must not be changed !! */ #define OHARE_PMU 9 #define KEYBLIGHTMAX 255 #define MAX_BATTERIES 2 #define DEFAULT_PMU "/dev/pmu" #define DEFAULT_ADB "/dev/adb" #define DEFAULT_BATLOG "/var/lib/pbbuttons/%03d_battery.log" #define DEFAULT_BATCYCLE "/var/lib/pbbuttons/battery.cycle" #define PATH_FNMODE "/sys/module/usbhid/parameters/pb_fnmode" #define OFBASE "/proc/device-tree" #define SYSI2CDEV "/sys/class/i2c-dev" /* definitions for input device config */ #define TRACKPAD_NOTAP_NAME "notap" #define TRACKPAD_TAP_NAME "tap" #define TRACKPAD_DRAG_NAME "drag" #define TRACKPAD_LOCK_NAME "lock" enum {TRACKPAD_NOTAP, TRACKPAD_TAP, TRACKPAD_DRAG, TRACKPAD_LOCK, TRACKPAD_LAST=TRACKPAD_LOCK}; #define KEYBOARD_FNDISABLED_NAME "disabled" #define KEYBOARD_FNBACK_NAME "fkeyslast" #define KEYBOARD_FNTOP_NAME "fkeysfirst" enum {KEYBOARD_FNDISABLED, KEYBOARD_FNBACK, KEYBOARD_FNTOP, KEYBOARD_LAST=KEYBOARD_FNTOP}; #define BATLOG_NONE_NAME "none" #define BATLOG_CYCLE_NAME "cycle" #define BATLOG_LOG_NAME "log" enum {BATLOG_NONE, BATLOG_CYCLE, BATLOG_LOG, BATLOG_LAST=BATLOG_LOG}; #ifndef PMU_IOC_GRAB_BACKLIGHT #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, 0) #endif #ifndef PMU_ENV_AC_POWER #define PMU_ENV_AC_POWER 0x04 #endif #ifndef PMU_ENV_BATTERY_PRESENT #define PMU_ENV_BATTERY_PRESENT 0x10 #endif struct modflags_pmac { unsigned int coveropen :1; unsigned int ac_power:1; unsigned int batpresent:1; /* set by pmu hardware */ unsigned int sleepsupported:1; unsigned int notap_typing:1; /* switch trackpad tap off while typing */ // unsigned int set_tpmode:1; /* delayed function triggered */ unsigned int set_kbdmode:1; /* delayed function triggered */ unsigned int goto_sleep:1; /* delayed function triggered */ unsigned int bat_present:MAX_BATTERIES; /* set by /proc/pmu/battery_% */ unsigned int bat_charging:MAX_BATTERIES; unsigned int :0; }; /* public prototypes */ int pmac_init (); int pmac_open (struct tagitem *taglist); int pmac_close (); int pmac_exit (); /* private prototypes */ void pmac_keyboard (struct tagitem *taglist); void pmac_mouse (struct tagitem *taglist); void pmac_secure (struct tagitem *taglist); void pmac_query (struct tagitem *taglist); void pmac_configure (struct tagitem *taglist); void pmac_handle_tags (int cfgure, struct tagitem *taglist); gboolean pmac_pmu_handler (int fd, gpointer user_data); void pmac_timer100 (struct tagitem *taglist); void pmac_timer1000 (struct tagitem *taglist); void pmac_update_batteryinfo (); int pmac_get_procac (); int pmac_update_flags (); void activate_sleepmode (); void pmac_set_lcdbacklight(int val); int getMachineID(int pmu); const char* getMachineName(int mid); int isModifier (int code, int mod); int haveADBKeyboard (); int haveADBTrackpad (); int haveI2CAmbient (); int havePMUAmbient (); int keyboard_get_config(); void keyboard_set_config(int config); int keyboard_get_dev(int fd); int trackpad_get_config(); void trackpad_set_config(int config); int trackpad_get_dev(int fd); void trackpad_set_prgmode(int fd, int dev, int mode); int send_pmu_request(int fd, unsigned char *buffer, int params, ...); int adb_read_reg(int fd, unsigned char *ADBBuffer, int dev, int reg); int adb_write_reg(int fd, unsigned char *ADBBuffer, int len, int dev, int reg); int get_pmu_version(int fd); int get_button(int fd, int button); int get_int_environment(int fd); #ifndef WITH_PMUD int get_cover_position(int fd); #endif int batlog_setup(); void batlog_save(); void batlog_write(long timerem); /* functions for ambient light sensor and keyboard illumination */ int addPath(char *path, int maxlen, char *pattern); int getLMUAddress(); int probeLMU(char *device, int addr); const char *findLMUDevice(int addr); int getAmbient (); int getRawAmbient (); void setKBDIllumination (unsigned short level); #endif /* INCLUDE_MODULE_PMAC_H */ pbbuttonsd-0.7.9/src/module_system.c0000644000175000017500000001316110507216726014470 00000000000000/* -------------------------------------------------------------------------- * module_system.c * code for general system functions * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_system.h" struct moddata_system { char *userallowed; /* remember system tag for config file saving */ char *configwritefile; /* configfile to write: eg. /etc/pbbuttonsd.conf */ int autorescan; int rescantimer; } modbase_system; int system_init () { struct moddata_system *base = &modbase_system; static char buf_userallowed[STDBUFFERLEN]; static char buf_configwritefile[STDBUFFERLEN]; int sid; bzero (buf_userallowed, STDBUFFERLEN); bzero (buf_configwritefile, STDBUFFERLEN); base->autorescan = 0; /* disable by default */ base->rescantimer = 0; base->userallowed = buf_userallowed; base->configwritefile = buf_configwritefile; if ((sid = registerCfgSection ("SYSTEM")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "SYSTEM"); return E_NOMEM; } else { registerCfgOptionString (sid, "userallowed", TAG_USERALLOWED, 0, N_("user who is allowed to use IPC")); registerCfgOptionBool (sid, "autorescan", TAG_AUTORESCAN, 0, N_("automatic rescan of event devices")); registerCfgOptionInt (sid, "CmdTimeout", TAG_TIMEFORCMD, 0, N_("timeout in seconds for launched scripts, etc.")); } register_function (QUERYQUEUE, system_query); register_function (CONFIGQUEUE, system_configure); return 0; } int system_open (struct tagitem *taglist) { ipc_protect_tag (TAG_SAVECONFIG); /* tags only for privileged use */ register_function (T1000QUEUE, system_timer1000); return 0; } int system_close () { return 0; } int system_exit () { return 0; } void system_query (struct tagitem *taglist) { system_handle_tags (MODE_QUERY, taglist); } void system_configure (struct tagitem *taglist) { system_handle_tags (MODE_CONFIG, taglist); } void system_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_system *base = &modbase_system; struct tagitem args[] = {{ TAG_AMBIENTLIGHT, 0 }, { TAG_SLEEPSUPPORTED, 0 }, { TAG_SYSINFOSLAVE, 0 }, { TAG_END, 0 }}; static char *version = VERSION; int val; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_SAVECONFIG: if (cfgure) { if (strlen(base->configwritefile) > 0) writeConfigFile (base->configwritefile); else tagerror (taglist, E_NOSUPPORT); } else tagerror (taglist, E_NOREAD); break; case TAG_USERALLOWED: /* private tag */ if (cfgure) strncpy(base->userallowed, (char*) taglist->data, STDBUFFERLEN); else if (strlen (base->userallowed) > 0) taglist->data = (long) base->userallowed; break; case TAG_VERSION: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = (long) version; break; case TAG_AUTORESCAN: if (cfgure) base->autorescan = taglist->data; else taglist->data = (long) base->autorescan; break; case TAG_TIMEFORCMD: if (cfgure) set_timeforcmd(taglist->data); else taglist->data = (long) get_timeforcmd(); break; case TAG_SYSINFO: if (cfgure) tagerror (taglist, E_NOWRITE); else { val = 0; if (strlen(base->configwritefile) > 0) val |= SYSINFO_CONFIGWRITABLE; process_queue (QUERYQUEUE, args); if (tagfind (args, TAG_AMBIENTLIGHT, 0xffffffff) != 0xffffffff) val |= SYSINFO_HAVELMU; if (tagfind (args, TAG_SLEEPSUPPORTED, 0xffffffff) != 0xffffffff) val |= SYSINFO_SLEEPSUPPORTED; /* TAG_SYSINFOSLAVE asks other modules if there are additiononal * machine dependent information that should be added. Currently * only module_pmac react to that. * */ val |= tagfind (args, TAG_SYSINFOSLAVE, 0); #ifdef WITH_PMUD val |= SYSINFO_PMUDSUPPORT; #endif #ifdef WITH_OSS val |= SYSINFO_HAVEOSS; #endif #ifdef WITH_ALSA val |= SYSINFO_HAVEALSA; #endif #ifdef WITH_IBAM val |= SYSINFO_HAVEIBAM; #endif taglist->data = val; } break; case TAG_CFGNAME: /* private tag */ if (cfgure) system_config_writable ((char*) taglist->data, base->configwritefile); break; } taglist++; } } void system_timer1000 (struct tagitem *taglist) { struct moddata_system *base = &modbase_system; if (base->autorescan) { base->rescantimer++; if (base->rescantimer > RESCANTIME) { base->rescantimer = 0; scanEventDevices (); } } } void system_config_writable (char *configreadfile, char *configwritefile) { unsigned int perms, owner; configwritefile[0] = '\0'; owner = get_owner(configreadfile); perms = get_permissions(configreadfile); if (owner != getuid() || (perms & 022)) print_msg (PBB_WARN, _("config file [%s] is insecure, saving of config disabled.\n"), configreadfile); else if (owner == getuid() && !(perms & 0200)) print_msg (PBB_WARN, _("config file [%s] is not writable, saving of config disabled.\n"), configreadfile); else { strcpy(configwritefile, configreadfile); print_msg (PBB_INFO, _("saving of config enabled to %s.\n"), configwritefile); return; /* config is writable, name in configwritefile */ } } pbbuttonsd-0.7.9/src/module_system.h0000644000175000017500000000217010217517136014470 00000000000000#ifndef INCLUDE_MODULE_SYSTEM_H #define INCLUDE_MODULE_SYSTEM_H /* ---------------------------------------------------------------------------- * module_system.h * prototypes and definitions for general system functions. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define RESCANTIME 5 /* in seconds */ /* public prototypes */ int system_init (); int system_open (struct tagitem *taglist); int system_close (); int system_exit (); /* private prototypes */ void system_configure (struct tagitem *taglist); void system_query (struct tagitem *taglist); void system_handle_tags (int cfgure, struct tagitem *taglist); void system_timer1000 (struct tagitem *taglist); void system_config_writable (char *configreadfile, char *configwritefile); #endif /* INCLUDE_MODULE_SYSTEM_H */ pbbuttonsd-0.7.9/src/module_powersave.c0000644000175000017500000010554210477314401015157 00000000000000/* -------------------------------------------------------------------------- * module_powersave.c * code for powermanagement module * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include "pbbinput.h" #ifdef HAVE_INITREQ_H # include #endif #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_powersave.h" #include "module_display.h" #include "support.h" #include "debug.h" #ifdef WITH_IBAM # include "ibam_stub.h" #endif /* --- private module data structure of module powermanagement --- */ struct moddata_power { struct modflags_power flags; struct powerprofile onAC; struct powerprofile onBattery; struct powerprofile *activeProfile; int policy; /* current power policy */ int powersource; /* REDUNDANT copy from module pmac */ int timeremaining; /* REDUNDANT copy from module pmac or filled by IBaM */ int mode; /* module mode: awake, sleep, dim. */ unsigned int sleeptime; /* counter */ int sleepcountdown; /* another counter */ int warnlevel; /* current battery warnlevel */ struct timeval tv; /* time of key press */ int sleepkeydelaytime; /* delay in ms */ unsigned short keysleep; /* keycode for sleepfunction */ unsigned short modsleep; /* modifier for sleepfunction */ int BWL1; int BWL2; int BWL3; int emergency; /* emergency action at low battery condition */ int cpuload_min; /* cpuload minimum level to lock sleep */ int cpuload_period; /* period of time for that cpu activity mut be below cpuload */ int netload_min; /* netload minimum level to lock sleep */ int netload_period; /* period of time for that net activity mut be below netload */ char *netload_dev; /* device to observe for netload sleeplock */ char *script_pmcs; /* command to call at certain event */ #ifdef WITH_IBAM char *ibam_datadir; int chargetime; /* time until battery is fully charged */ #endif } modbase_power; /* --- interface functions of module powermanagement --- */ /* Init function called by the program init procedure. Function is known by the prginitab. It does module data initialisation and registers the module at the needed input queues. */ int power_init () { struct moddata_power *base = &modbase_power; static char scriptbuffer1[STDBUFFERLEN]; static char scriptbuffer2[STDBUFFERLEN]; #ifdef WITH_IBAM static char scriptbuffer3[STDBUFFERLEN]; int err; #endif int sid; bzero (base, sizeof (struct moddata_power)); bzero (scriptbuffer1, STDBUFFERLEN); /* no default for script_pmcs */ base->script_pmcs = scriptbuffer1; sprintf (scriptbuffer2, DEFAULT_NETLOAD_DEV); base->netload_dev = scriptbuffer2; #ifdef WITH_IBAM base->ibam_datadir = scriptbuffer3; if ((err = copy_path (DEFAULT_IBAM_DATADIR, base->ibam_datadir, TYPE_DIR, CPFLG_PBBONLY))) return err; #endif base->mode = MODE_AWAKE; base->policy = POLICY_PERFORMANCE; if ((sid = registerCfgSection ("MODULE POWERSAVE")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE POWERSAVE"); return E_NOMEM; } else { registerCfgOptionList (sid, "onAC_Policy", TAG_ONAC_POLICY, 0, N_("'"POLICY_NONE_NAME"', '"POLICY_POWERSAVE_NAME"', '"POLICY_USER_NAME"' or '"POLICY_PERFORMANCE_NAME"'"), POLICY_NONE_NAME, POLICY_POWERSAVE_NAME, POLICY_USER_NAME, POLICY_PERFORMANCE_NAME, NULL); registerCfgOptionList (sid, "onAC_TimerAction", TAG_ONAC_TIMERACTION, 0, N_("'"ACTION_NONE_NAME"', '"ACTION_TORAM_NAME"', '"ACTION_TODISK_NAME"', '"ACTION_BLANK_NAME"' or '"ACTION_SHUTDOWN_NAME"'"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionList (sid, "onAC_CoverAction", TAG_ONAC_COVERACTION, 0, N_("see TimerAction for possible values"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionList (sid, "onAC_KeyAction", TAG_ONAC_KEYACTION, 0, N_("Action (see TimerAction) for the sleepkey"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionInt (sid, "onAC_SuspendTime", TAG_ONAC_TIMESUSPEND, 0, NULL); registerCfgOptionInt (sid, "onAC_DimTime", TAG_ONAC_TIMEDIM, 0, NULL); registerCfgOptionList (sid, "onBattery_Policy", TAG_ONBATT_POLICY, 0, N_("'"POLICY_NONE_NAME"', '"POLICY_POWERSAVE_NAME"', '"POLICY_USER_NAME"' or '"POLICY_PERFORMANCE_NAME"'"), POLICY_NONE_NAME, POLICY_POWERSAVE_NAME, POLICY_USER_NAME, POLICY_PERFORMANCE_NAME, NULL); registerCfgOptionList (sid, "onBattery_TimerAction", TAG_ONBATT_TIMERACTION, 0, N_("'"ACTION_NONE_NAME"', '"ACTION_TORAM_NAME"', '"ACTION_TODISK_NAME"', '"ACTION_BLANK_NAME"' or '"ACTION_SHUTDOWN_NAME"'"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionList (sid, "onBattery_CoverAction", TAG_ONBATT_COVERACTION, 0, N_("see TimerAction for possible values"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionList (sid, "onBattery_KeyAction", TAG_ONBATT_KEYACTION, 0, N_("Action (see TimerAction) for the sleepkey"), ACTION_NONE_NAME, ACTION_TORAM_NAME, ACTION_TODISK_NAME, ACTION_BLANK_NAME, ACTION_SHUTDOWN_NAME, NULL); registerCfgOptionInt (sid, "onBattery_SuspendTime", TAG_ONBATT_TIMESUSPEND, 0, NULL); registerCfgOptionInt (sid, "onBattery_DimTime", TAG_ONBATT_TIMEDIM, 0, NULL); registerCfgOptionKey (sid, "SleepKey", TAG_SLEEPKEY, TAG_SLEEPMOD, 0, NULL); registerCfgOptionInt (sid, "SleepKeyDelay", TAG_SLEEPKEYDELAY, 0, N_("values > 0 may be dangerous, if the power key is used to trigger sleep")); registerCfgOptionInt (sid, "BWL_first", TAG_BWLFIRST, 0, N_("first battery warnlevel, time in minutes")); registerCfgOptionInt (sid, "BWL_second", TAG_BWLSECOND, 0, N_("second battery warnlevel, time in minutes")); registerCfgOptionInt (sid, "BWL_last", TAG_BWLLAST, 0, N_("last battery warnlevel, time in minutes")); registerCfgOptionString (sid, "Script_PMCS", TAG_SCRIPTPMCS, 0, NULL); registerCfgOptionList (sid, "EmergencyAction", TAG_EMERGENCYACTION, 0, N_("action, if battery is critically low"), EMA_SLEEP_NAME, EMA_SIGNAL_NAME, EMA_COMMAND_NAME, NULL); registerCfgOptionBool (sid, "HeartbeatBeep", TAG_HEARTBEATBEEP, 0, N_("beep, if nothing else showed that the computer lives")); registerCfgOptionBool (sid, "CPULoad_sleeplock", TAG_CPULOADSLEEPLOCK, 0, NULL); registerCfgOptionInt (sid, "CPULoad_min", TAG_CPULOADMIN, 0, N_("value in percent")); registerCfgOptionInt (sid, "CPULoad_period", TAG_CPULOADPERIOD, 0, N_("time in seconds")); registerCfgOptionBool (sid, "NETLoad_sleeplock", TAG_NETLOADSLEEPLOCK, 0, NULL); registerCfgOptionInt (sid, "NETLoad_min", TAG_NETLOADMIN, 0, N_("traffic in Bytes/s")); registerCfgOptionInt (sid, "NETLoad_period", TAG_NETLOADPERIOD, 0, N_("time in seconds")); registerCfgOptionString (sid, "NETLoad_device", TAG_NETLOADDEV, 0, NULL); #ifdef WITH_IBAM registerCfgOptionString (sid, "IBAM_DataDir", TAG_IBAMDATADIR, 0, NULL); #endif } ipc_protect_tag (TAG_SCRIPTPMCS); /* tags only for privileged use */ ipc_protect_tag (TAG_IBAMDATADIR); register_function (QUERYQUEUE, power_query); register_function (CONFIGQUEUE, power_configure); return 0; } int power_open (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; power_sync(); /* synchronise some data with module_pmac */ /* default profile for running on AC power */ base->onAC.policy = POLICY_PERFORMANCE; base->onAC.timeraction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onAC.coveraction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onAC.keyaction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onAC.suspendtime = AC_TIME_SLEEP; base->onAC.dimtime = AC_TIME_DIM; /* default profile for running on battery */ base->onBattery.policy = POLICY_POWERSAVE; base->onBattery.timeraction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onBattery.coveraction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onBattery.keyaction = base->flags.sleep_supported ? ACTION_TORAM : ACTION_BLANK; base->onBattery.suspendtime = BATTERY_TIME_SLEEP; base->onBattery.dimtime = BATTERY_TIME_DIM; /* definitions for immediatly sleep function */ base->keysleep = KEY_POWER; base->modsleep = MOD_NONE; base->sleepkeydelaytime = 0; /* time delay till reaction */ base->sleeptime = 0; /* counter for time till sleep */ base->sleepcountdown = 60; /* counter for last 5 seconds before sleep */ /* definitions for battery supervising functions */ base->BWL1 = BAT_WARNLEVEL1; base->BWL2 = BAT_WARNLEVEL2; base->BWL3 = BAT_WARNLEVEL3; base->warnlevel = 0; /* current battery warnlevel */ base->emergency = base->flags.sleep_supported ? EMA_SLEEP : EMA_SIGNAL; /* default emergency action */ base->flags.sigpwr_sent = 0; /* currently no sigpwr in progress */ /* definitions for sleeplocks */ base->flags.cpuload_enable = 0; /* disabled by default */ base->flags.sleeplock_cpu = 0; /* lock open */ base->cpuload_min = 20; /* lock closed if cpuload <20% */ base->cpuload_period = 60; /* for >60s, if enabled */ base->flags.netload_enable = 0; /* disabled by default */ base->flags.sleeplock_net = 0; /* lock open */ base->netload_min = 4096; /* lock closed if netload <4 KB/s */ base->netload_period = 60; /* for >60s, if enabled */ base->flags.heartbeat = 0; /* heartbeat beep disabled */ base->flags.heartbeat_enable= 1; /* heartbeat beep is possible by default */ base->flags.coveropen = 1; /* cover open by default same as in laptop module */ base->powersource = 2; /* HACK: The pmcs script sould be started at startup but it will only start if the status has changed (policy or powersource). We set an impossible value here and pbbuttonsd.c will send a TAG_POWERCHANGE to correct it and start the script Not elegant but works */ #ifdef WITH_IBAM base->timeremaining = -1; /* will be updated from timer1000 */ base->chargetime = -1; if (!ibam_init(base->ibam_datadir)) { /* create ibam object */ print_msg (PBB_ERR, _("Can't create IBaM object, out of memory.\n")); return E_NOMEM; } #endif register_function (KBDQUEUE, power_keyboard); register_function (MOUSEQUEUE, power_mouse); register_function (T100QUEUE, power_timer); register_function (T1000QUEUE, power_timer1000); return 0; } int power_close () { #ifdef WITH_IBAM ibam_exit(); #endif return 0; } int power_exit () { return 0; } void power_mouse (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; if (base->flags.coveropen) power_awake (); /* call only if cover is open */ } void power_keyboard (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value && base->flags.coveropen) if (value == 1) { power_awake (); base->flags.sleeptriggered = 0; } if ((code == base->keysleep) && (mod == base->modsleep)) if ((base->sleepkeydelaytime == 0) || (keydelayms(&base->tv, value, base->sleepkeydelaytime))) if (base->flags.sleeptriggered == 0) { base->flags.sleeptriggered = 1; /* sleep should be triggered only once */ power_suspend (base->activeProfile->keyaction); } } /* This function will be called on every keyboard or mouse action. With other words the user is active if this function is called so sleeptimer is reset here. */ void power_awake () { struct moddata_power *base = &modbase_power; if (base->mode != MODE_AWAKE) { process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_RECOVER); base->flags.heartbeat = 0; /* disable heartbeat beep */ base->mode = MODE_AWAKE; } base->sleeptime = 0; } void power_sync () { struct moddata_power *base = &modbase_power; struct tagitem args[4]; taglist_init (args); taglist_add (args, TAG_SLEEPSUPPORTED, 0); taglist_add (args, TAG_POWERSOURCE, 0); #ifndef WITH_IBAM taglist_add (args, TAG_TIMEREMAINING, -1); #endif process_queue (QUERYQUEUE, args); base->flags.sleep_supported = tagfind (args, TAG_SLEEPSUPPORTED, 0); base->powersource = tagfind (args, TAG_POWERSOURCE, 0); #ifndef WITH_IBAM base->timeremaining = tagfind (args, TAG_TIMEREMAINING, -1); #endif base->activeProfile = base->powersource ? &base->onAC : &base->onBattery; } void power_query (struct tagitem *taglist) { power_handle_tags (MODE_QUERY, taglist); } void power_configure (struct tagitem *taglist) { power_handle_tags (MODE_CONFIG, taglist); } void power_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int err, val; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_REINIT: /* set power policy again after resume from suspend * to disk. */ power_setpolicy(taglist->data, base->powersource); break; case TAG_SCRIPTPMCS: if (cfgure) { if ((check_script ((char *) taglist->data, "sss")) == 0) { if ((err = copy_path ((char *) taglist->data, base->script_pmcs, TYPE_FILE, CPFLG_PBBONLY))) tagerror (taglist, err); } else { print_msg (PBB_ERR, _("Too many formatsigns. Max three %%s allowed in TAG_SCRIPTPMCS.\n")); tagerror (taglist, E_FORMAT); } } else taglist->data = (long) base->script_pmcs; break; #ifdef WITH_IBAM case TAG_IBAMDATADIR: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->ibam_datadir, TYPE_DIR, CPFLG_PBBONLY))) tagerror (taglist, err); } else taglist->data = (long) base->ibam_datadir; break; #endif /* Tags for power profiles */ case TAG_ONAC_POLICY: if (cfgure) { if (taglist->data > POLICY_LAST) tagerror(taglist, E_INVALID); else { base->onAC.policy = taglist->data; if (&base->onAC == base->activeProfile && !base->flags.usersetpolicy) power_setpolicy(taglist->data, base->powersource); } } else taglist->data = base->onAC.policy; break; case TAG_ONAC_TIMERACTION: if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onAC.timeraction = taglist->data; } else taglist->data = base->onAC.timeraction; break; case TAG_ONAC_COVERACTION: if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onAC.coveraction = taglist->data; } else taglist->data = base->onAC.coveraction; break; case TAG_ONAC_KEYACTION: /* sleepkey */ if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onAC.keyaction = taglist->data; } else taglist->data = base->onAC.keyaction; break; case TAG_ONAC_TIMESUSPEND: if (cfgure) base->onAC.suspendtime = taglist->data; else taglist->data = base->onAC.suspendtime; break; case TAG_ONAC_TIMEDIM: if (cfgure) base->onAC.dimtime = taglist->data; else taglist->data = base->onAC.dimtime; break; case TAG_ONBATT_POLICY: if (cfgure) { if (taglist->data > POLICY_LAST) tagerror(taglist, E_INVALID); else { base->onBattery.policy = taglist->data; if (&base->onBattery == base->activeProfile && !base->flags.usersetpolicy) power_setpolicy(taglist->data, base->powersource); } } else taglist->data = base->onBattery.policy; break; case TAG_ONBATT_TIMERACTION: if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onBattery.timeraction = taglist->data; } else taglist->data = base->onBattery.timeraction; break; case TAG_ONBATT_COVERACTION: if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onBattery.coveraction = taglist->data; } else taglist->data = base->onBattery.coveraction; break; case TAG_ONBATT_KEYACTION: /* sleepkey */ if (cfgure) { if (taglist->data > ACTION_LAST) tagerror(taglist, E_INVALID); else base->onBattery.keyaction = taglist->data; } else taglist->data = base->onBattery.keyaction; break; case TAG_ONBATT_TIMESUSPEND: if (cfgure) base->onBattery.suspendtime = taglist->data; else taglist->data = base->onBattery.suspendtime; break; case TAG_ONBATT_TIMEDIM: if (cfgure) base->onBattery.dimtime = taglist->data; else taglist->data = base->onBattery.dimtime; break; /* Tags for power profiles end */ case TAG_SLEEPKEY: if (cfgure) base->keysleep = taglist->data; else taglist->data = base->keysleep; break; case TAG_SLEEPMOD: if (cfgure) base->modsleep = taglist->data; else taglist->data = base->modsleep; break; case TAG_SLEEPKEYDELAY: if (cfgure) base->sleepkeydelaytime = taglist->data; else taglist->data = base->sleepkeydelaytime; break; case TAG_BWLFIRST: if (cfgure) base->BWL1 = taglist->data; else taglist->data = base->BWL1; break; case TAG_BWLSECOND: if (cfgure) base->BWL2 = taglist->data; else taglist->data = base->BWL2; break; case TAG_BWLLAST: if (cfgure) base->BWL3 = taglist->data; else taglist->data = base->BWL3; break; case TAG_CURRENTBWL: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->warnlevel; break; case TAG_CPULOADSLEEPLOCK: if (cfgure) { base->flags.cpuload_enable = taglist->data; base->flags.sleeplock_cpu = taglist->data; } else taglist->data = base->flags.cpuload_enable; break; case TAG_CPULOADMIN: if (cfgure) base->cpuload_min = taglist->data; else taglist->data = base->cpuload_min; break; case TAG_CPULOADPERIOD: if (cfgure) base->cpuload_period = taglist->data; else taglist->data = base->cpuload_period; break; case TAG_NETLOADSLEEPLOCK: if (cfgure) { base->flags.netload_enable = taglist->data; base->flags.sleeplock_net = taglist->data; } else taglist->data = base->flags.netload_enable; break; case TAG_NETLOADMIN: if (cfgure) base->netload_min = taglist->data; else taglist->data = base->netload_min; break; case TAG_NETLOADPERIOD: if (cfgure) base->netload_period = taglist->data; else taglist->data = base->netload_period; break; case TAG_NETLOADDEV: if (cfgure) strncpy (base->netload_dev, (char *) taglist->data, STDBUFFERLEN-1); else taglist->data = (long) base->netload_dev; break; case TAG_EMERGENCYACTION: if (cfgure) { if (taglist->data > EMA_LAST) tagerror(taglist, E_INVALID); else if (taglist->data == EMA_SLEEP) { if (base->flags.sleep_supported) /* sleep supported? */ base->emergency = EMA_SLEEP; /* then set to EMA_SLEEP */ else tagerror (taglist, E_NOSUPPORT); /* otherwise send error */ } else base->emergency = taglist->data; } else taglist->data = (long) base->emergency; break; case TAG_HEARTBEATBEEP: if (cfgure) base->flags.heartbeat_enable = taglist->data; else taglist->data = base->flags.heartbeat_enable; break; case TAG_POWERCHANGED: /* private tag */ if (cfgure) { if (taglist->data) base->activeProfile = &base->onAC; else base->activeProfile = &base->onBattery; power_setpolicy(base->activeProfile->policy, taglist->data); base->flags.usersetpolicy = 0; /* Due to changed timeout values of sleeping and * dimming the sleeptime counter have to be adjusted * to prevent unexpected jumps in behaviour. Depending * on the current mode the sleeptime counter will be * resetted to the begining of the current mode. */ if (base->mode == MODE_AWAKE) base->sleeptime = 0; else if (base->mode == MODE_DIM) base->sleeptime = base->activeProfile->dimtime; power_check_battery (base->timeremaining, base->powersource); /* If the power source changed during the cover is closed * the machine should follow the active profile. */ if (!base->flags.coveropen) power_suspend (base->activeProfile->coveraction); } break; #ifndef WITH_IBAM case TAG_TIMECHANGED: /* private tag */ if (cfgure) { base->timeremaining = taglist->data; power_check_battery (base->timeremaining, base->powersource); } break; #else case TAG_TIMEREMAINING: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->timeremaining; break; case TAG_CHARGETIME: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->chargetime; break; #endif case TAG_PREPAREFORSLEEP: /* private tag */ /* PMCS-script will be called in power_suspend() so that it's nothing left to do here */ break; case TAG_WAKEUPFROMSLEEP: /* private tag */ if (cfgure) { power_awake (); val = base->powersource; power_sync (); /* syncronise redundant data from module_pmac */ power_check_battery (-1, base->powersource); call_script (base->script_pmcs, "resume", base->powersource ? "ac" : "battery", "ram"); /* if power source changed during sleep call PMCS script * again to set power policy */ if (val != base->powersource) power_setpolicy(base->activeProfile->policy, base->powersource); } break; case TAG_COVERSTATUS: /* private tag */ if (cfgure) { base->flags.coveropen = taglist->data & 1; val = base->activeProfile->coveraction; if (val == ACTION_BLANK || ((val == ACTION_TORAM) && !base->flags.sleep_supported)) call_script (base->script_pmcs, base->flags.coveropen ? "cover-open" : "cover-close", base->powersource ? "ac" : "battery", base->flags.coveropen ? "open" : "close"); if (base->flags.coveropen) power_awake (); else { if (val != ACTION_BLANK) power_suspend (ACTION_BLANK); /* always blank screen if cover has been closed */ power_suspend (val); /* then follow user's will */ } } break; case TAG_GOTOSLEEP: if (cfgure) power_suspend (ACTION_TORAM); else tagerror (taglist, E_NOREAD); break; case TAG_GOTOHIBERNATE: if (cfgure) power_suspend (ACTION_TODISK); else tagerror (taglist, E_NOREAD); break; case TAG_POLICY: if (cfgure) { if (taglist->data == POLICY_NONE || taglist->data > POLICY_LAST) tagerror(taglist, E_INVALID); else { power_setpolicy(taglist->data, base->powersource); base->flags.usersetpolicy = 1; } } else taglist->data = base->policy; break; } taglist++; } } /* This routine will be called every 10ms */ void power_timer (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; int n; base->sleeptime++; switch (base->mode) { case MODE_AWAKE: if ((base->activeProfile->dimtime) && (base->sleeptime > base->activeProfile->dimtime)) { /* time to dim the display? */ process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_LIGHT); /* then dim */ base->mode = MODE_DIM; } case MODE_DIM: if ((base->activeProfile->suspendtime) && (base->sleeptime > base->activeProfile->suspendtime) && !base->flags.sleeplock_cpu && !base->flags.sleeplock_net) { /* time to sleep? */ base->mode = MODE_DOZY; base->sleepcountdown = 60; } break; case MODE_DOZY: if (base->activeProfile->timeraction != ACTION_NONE) { n = --base->sleepcountdown / 10; /* time left in seconds */ if (n == 0) power_suspend (base->activeProfile->timeraction); else singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, n); } case MODE_SUSPEND: base->sleeptime--; break; } } void power_timer1000 (struct tagitem *taglist) { struct moddata_power *base = &modbase_power; static int cputimer = 0, nettimer = 0, beeptimer = 0; int cpuload = 0, netload = 0; #ifdef WITH_IBAM int time; #endif if (base->flags.cpuload_enable) { cpuload = power_read_cpu (); if (cpuload < base->cpuload_min) { if (base->flags.sleeplock_cpu) { /* skip following if lock is already open */ cputimer++; if (cputimer > base->cpuload_period) base->flags.sleeplock_cpu = 0; /* open lock */ } } else { cputimer = 0; base->flags.sleeplock_cpu = 1; /* close lock */ } } else cputimer = 0; if (base->flags.netload_enable) { netload = power_read_net (base->netload_dev); if (netload < base->netload_min) { if (base->flags.sleeplock_net) { /* skip following if lock is already open */ nettimer++; if (nettimer > base->netload_period) base->flags.sleeplock_net = 0; /* open lock */ } } else { nettimer = 0; base->flags.sleeplock_net = 1; /* close lock */ } } else nettimer = 0; if (base->flags.heartbeat_enable) { /* user wants heartbeat beep ? */ if (base->flags.heartbeat) { beeptimer++; if (beeptimer > BEEPINTERVAL) { power_beep(); beeptimer = 0; } } else beeptimer = 0; } else beeptimer = 0; #ifdef WITH_IBAM ibam_recordProfile(); /* keep battery statistics up-to-date */ time = ibam_getBatteryTimeAdaptive() * 60; /* IBAM delivers minutes, we need seconds */ if (time != base->timeremaining) { base->timeremaining = time; power_check_battery (base->timeremaining, base->powersource); } base->chargetime = ibam_getChargeTimeAdaptive() * 60; # if defined(DEBUG) && IBAM int ctime = base->chargetime; printf("DBG: %s: Charge adaptive time: %2d:%2d, discharging adaptive time: %2d:%02d\r", base->powersource ? "AC " : "BAT", ctime/3600, (ctime%3600)/60, time/3600, (time%3600)/60); fflush(stdout); # endif #endif #if defined(DEBUG) && SLEEPLOCKS printf ("cpu: "); if (base->flags.cpuload_enable) printf ("%2d%% (lock %s)", cpuload, base->flags.sleeplock_cpu ? "closed" : "open "); else printf ("disabled"); printf (", net: "); if (base->flags.netload_enable) printf ("%8d B/s (lock %s)", netload, base->flags.sleeplock_net ? "closed" : "open "); else printf ("disabled"); printf ("\r"); fflush(stdout); #endif } void power_check_battery (int time, int psource) { struct moddata_power *base = &modbase_power; struct tagitem taglist[3]; int warnlevel[] = {1200, base->BWL1 + BAT_HYSTERESIS, base->BWL1, base->BWL2 + BAT_HYSTERESIS, base->BWL2, base->BWL3 + BAT_HYSTERESIS, base->BWL3, 1, 1, 0}; int n, wl; /* if pbbuttons was started with AC plugged in, timeleft would * remain at -1 and after AC pulled out the value wasn't changed * quick enough so that the warning level 4 was set due to * -1 / 60 = 0 -> wl = 4 -> shutdown. To prevent this the timeleft * value of -1 is filtered out here */ if (psource || time == -1) { /* if battery is charging or time is invalid */ wl = 0; /* we don't need to calculate warnlevels */ if (base->warnlevel) { /* but maybe have to inform clients */ taglist_init (taglist); taglist_add (taglist, TAG_CURRENTBWL, wl); distribute_to_clients(WARNING, taglist); } } else { time /= 60; /* calculate minutes */ wl = base->warnlevel; if (time >= 0) { for (n=4; n >= 0; n--) if (time < warnlevel[2*n]) if (time >= warnlevel[2*n+1]) { wl = n; break; } if (wl > base->warnlevel) { /* warnlevel increased ? */ taglist_init (taglist); taglist_add (taglist, TAG_CURRENTBWL, wl); taglist_add (taglist, TAG_TIMEREMAINING, time); distribute_to_clients(WARNING, taglist); if (wl == 4) { /* oh oh, battery is realy low */ switch (base->emergency) { case EMA_SLEEP: process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); break; case EMA_SIGNAL: if ((send_sigpwr('F')) != 0) { /* send init a SIGPWR signal */ if (base->flags.sleep_supported) { /* fallback to sleep if possible */ base->emergency = EMA_SLEEP; process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); } else { /* otherwise use the last way out */ base->emergency = EMA_COMMAND; call_script (base->script_pmcs, "emergency", base->powersource ? "ac" : "battery", ""); sleep (10); } } else { base->flags.sigpwr_sent = 1; /* sigpwr in progress */ sleep(5); /* give INIT a chance to react */ } break; case EMA_COMMAND: call_script (base->script_pmcs, "emergency", base->powersource ? "ac" : "battery", ""); sleep(10); /* give the script a chance to work */ break; } } } else if (wl < base->warnlevel && base->flags.sigpwr_sent) { /* battery has recovered */ send_sigpwr('O'); /* abort sigpwr action */ base->flags.sigpwr_sent = 0; /* sigpwr no longer in progress */ } } } base->warnlevel = wl; } int power_shutdown_in_progress () { struct utmp *ut; int runlevel=-1; setutent(); while ((ut = getutent()) != NULL) { if (ut->ut_type == RUN_LVL) { runlevel = ut->ut_pid % 256; break; } } endutent(); if (runlevel == '0' || runlevel == '6') return 1; /* shutdown or reboot in progress */ return 0; } /* This function requests sleep mode and take user configurations * like enable_blank into account. */ void power_suspend (int action) { struct moddata_power *base = &modbase_power; if (action == ACTION_NONE) /* no action, mode will not change */ return; /* If a shutdown is in progress allow only ACTION_BLANK * and reject all other actions. */ if (power_shutdown_in_progress() && action != ACTION_BLANK) return; base->mode = MODE_SUSPEND; sync(); switch (action) { case ACTION_TODISK: singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "suspend", base->powersource ? "ac" : "battery", "disk"); break; case ACTION_TORAM: if (base->flags.sleep_supported) { singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "suspend", base->powersource ? "ac" : "battery", "ram"); process_queue_single (CONFIGQUEUE, TAG_REQUESTSLEEP, 0); break; } /* else ACTION_BLANK */ case ACTION_BLANK: process_queue_single (CONFIGQUEUE, TAG_BRIGHTNESSOP, OP_DIM_OFF); if (base->flags.heartbeat_enable) { /* user wants heartbeat beep ? */ base->flags.heartbeat = 1; /* enable heartbeat beep */ power_beep(); } break; case ACTION_SHUTDOWN: /* action currently disabled */ singletag_to_clients(WARNING, TAG_SLEEPINSECONDS, 0); call_script (base->script_pmcs, "shutdown", base->powersource ? "ac" : "battery", ""); sleep (10); break; } } /* This function updates the power policy and the powersource * in the base data structure. If one of them changes the * pmcs script will be executed. The illegal POLICY_NONE will * be filtered. */ void power_setpolicy (int policy, int powersource) { struct moddata_power *base = &modbase_power; char *policies[] = {POLICY_NONE_NAME, POLICY_POWERSAVE_NAME, POLICY_USER_NAME, POLICY_PERFORMANCE_NAME}; char *powersrc[] = {"battery", "ac"}; int change = 0; if (policy != POLICY_NONE && base->policy != policy) { base->policy = policy; change = 1; } if (base->powersource != powersource) { base->powersource = powersource; change = 1; } if (change) call_script (base->script_pmcs, policies[base->policy], powersrc[base->powersource], ""); } int check_script (char *name, char *allowed) { while (*name != 0) { if (*name++ == '%') if ((*allowed == 0) || (*name++ != *allowed++)) return -1; } return 0; } int send_sigpwr (char mode) { FILE *fd; int err = -1; #ifdef HAVE_INITREQ_H struct init_request initreq; initreq.magic = INIT_MAGIC; initreq.cmd = mode == 'F' ? INIT_CMD_POWERFAIL : INIT_CMD_POWEROK; initreq.sleeptime = 5; if ((fd = fopen(INIT_FIFO, "r+")) != NULL) { err = 0; if ((fwrite(&initreq, sizeof(initreq), 1, fd)) != 1) err = -1; fclose(fd); } #endif if (err == -1) { if ((fd = fopen("/etc/powerstatus", "w")) != NULL) { err = 0; if ((fwrite(&mode, 1, 1, fd)) != 1) err = -1; fclose(fd); } err = kill(1, SIGPWR); /* send SIGPWR to the INIT process */ } return err; } /* This function reads /proc/stat and calculates the current * cpuload. If an error occured, the return value would be * '0', so that no program features especially sleep will * be blocked. */ int power_read_cpu (void) { static ulong pvalue = 0, ptotal = 0; char buffer[1024], *token; ulong value, total, user, nice, sys, idle, usn; FILE *fd; if ((fd = fopen ("/proc/stat","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer," \t\n"))) { if (!strncmp ("cpu", token, 3)) { sscanf(strtok (0, "\n"), "%lu %lu %lu %lu", &user, &nice, &sys, &idle); break; } else strtok (0,"\n"); } fclose(fd); usn = user + sys + nice; value = usn - pvalue; pvalue = usn; total = usn + idle - ptotal; ptotal = usn + idle; if (total) return (int) (value * 100 / total); } return 0; } /* This function reads /proc/net/dev and calculates the current trafic to and from net. Only the given network device will be observed and incomming and outgoing trafic would be combined to one single bytes/second value. If an error occured, the return value would be '0', so that no program features espacially sleep will be blocked. */ int power_read_net (char *dev) { static ulong ptrafic = 0; char buffer[1024], *token; ulong dummy, bytesread = 0, byteswrite = 0, trafic = 0; FILE *fd; if ((fd = fopen ("/proc/net/dev","r"))) { while (fgets (buffer, sizeof (buffer), fd)) if ((token = strtok (buffer,":\n"))) { cleanup_buffer (token); if (!strncmp (dev, token, strlen (dev))) { sscanf(strtok (0, "\n"), "%lu %lu %lu %lu %lu %lu %lu %lu %lu", &bytesread, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &dummy, &byteswrite); break; } else strtok (0,"\n"); } fclose(fd); if (ptrafic) trafic = bytesread + byteswrite - ptrafic; ptrafic = bytesread + byteswrite; return (int) trafic; } return 0; } void power_beep() { int arg, fd; unsigned int ms = 150; unsigned int freq = 5000; if ((fd = open("/dev/console", O_RDWR)) >= 0) { arg = (ms << 16) | freq; ioctl(fd, KDMKTONE, arg); usleep(ms*1000); close (fd); } } pbbuttonsd-0.7.9/src/module_powersave.h0000644000175000017500000001033510343146440015155 00000000000000#ifndef INCLUDE_MODULE_POWERSAVE_H #define INCLUDE_MODULE_POWERSAVE_H /* ---------------------------------------------------------------------------- * module_powersave.h * prototypes and definitions for the module powermanagement. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* power management policies */ #define POLICY_NONE_NAME "nochange" #define POLICY_POWERSAVE_NAME "powersave" #define POLICY_USER_NAME "custom" #define POLICY_PERFORMANCE_NAME "performance" enum {POLICY_NONE, POLICY_POWERSAVE, POLICY_USER, POLICY_PERFORMANCE, POLICY_LAST=POLICY_PERFORMANCE}; /* power management actions */ #define ACTION_NONE_NAME "none" #define ACTION_TORAM_NAME "suspend-to-ram" #define ACTION_TODISK_NAME "suspend-to-disk" #define ACTION_BLANK_NAME "blankscreen" #define ACTION_SHUTDOWN_NAME "shutdown" enum {ACTION_NONE, ACTION_TORAM, ACTION_TODISK, ACTION_BLANK, ACTION_SHUTDOWN, ACTION_LAST=ACTION_SHUTDOWN}; /* emergency action codes */ #define EMA_SLEEP_NAME "sleep" #define EMA_SIGNAL_NAME "signal" #define EMA_COMMAND_NAME "command" enum {EMA_SLEEP, EMA_SIGNAL, EMA_COMMAND, EMA_LAST=EMA_COMMAND}; #define DEFAULT_NETLOAD_DEV "ppp0" #define AC_TIME_DIM 200 /* 600=1 minutes, in 10th of a second */ #define AC_TIME_SLEEP 300 /* 3000=5 minutes, in 10th of a second */ #define BATTERY_TIME_DIM 200 /* 600=1 minutes, in 10th of a second */ #define BATTERY_TIME_SLEEP 300 /* 3000=5 minutes, in 10th of a second */ #define SLEEPCOUNTDOWN 60 /* (seconds + 1) * 10 */ #define BEEPINTERVAL 30 /* seconds */ /* Battery levels to check battery and signal warnings to the clients */ #define BAT_WARNLEVEL1 21 /* time remaining until shutdown*/ #define BAT_WARNLEVEL2 11 /* in minutes */ #define BAT_WARNLEVEL3 4 /* This value defined a hysteresis for the warnlevels. That means if for eg. the remaining time falls below BAT_WARNLEVEL2 the daemon switchs to warnlevel 2 and the time has to be raised above BAT_WARNLEVEL2 + this value to return to warnlevel 1. This reduces frequent battery warning popup windows around the BAT_WARNLEVELs due to power fluctuation. The hysteresis must not be greater than the lowest difference between two BAT_WARNLEVELs. */ #define BAT_HYSTERESIS 3 #define DEFAULT_IBAM_DATADIR "/var/lib/ibam" enum {MODE_AWAKE, MODE_DIM, MODE_DOZY, MODE_SUSPEND}; struct modflags_power { unsigned int sleep_supported:1; /* REDUNDANT copy from module pmac */ unsigned int sleeptriggered:1; unsigned int cpuload_enable:1; unsigned int netload_enable:1; unsigned int sleeplock_cpu:1; unsigned int sleeplock_net:1; unsigned int sigpwr_sent:1; unsigned int heartbeat_enable:1; unsigned int heartbeat:1; unsigned int coveropen:1; /* tracked signal from TAG_COVERSTATUS */ unsigned int usersetpolicy:1; unsigned int :0; }; struct powerprofile { unsigned int policy; unsigned int timeraction; unsigned int coveraction; unsigned int keyaction; /* sleepkey */ unsigned int suspendtime; unsigned int dimtime; }; /* public prototypes */ int power_init (); int power_open (struct tagitem *taglist); int power_close (); int power_exit (); /* private prototypes */ void power_keyboard (struct tagitem *taglist); void power_mouse (struct tagitem *taglist); void power_awake (); void power_sync (); void power_query (struct tagitem *taglist); void power_configure (struct tagitem *taglist); void power_handle_tags (int cfgure, struct tagitem *taglist); void power_timer (struct tagitem *taglist); void power_timer1000 (struct tagitem *taglist); void power_check_battery (int time, int psource); int power_shutdown_in_progress (); void power_suspend (int action); void power_setpolicy (int policy, int powersource); int check_script (char *name, char *allowed); int send_sigpwr (char mode); int power_read_cpu (void); int power_read_net (char *dev); void power_beep(); #endif /* INCLUDE_MODULE_POWERSAVE_H */ pbbuttonsd-0.7.9/src/module_display.c0000644000175000017500000007606710507175252014625 00000000000000/* -------------------------------------------------------------------------- * module_display.c * code for module display * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "pbbinput.h" #include #include "input_manager.h" #include "config_manager.h" #include "module_display.h" #include "support.h" #include "gettext_macros.h" #include #include "debug.h" #define VAL2PERCENT(x,max) (x * 100 / max) #define PERCENT2VAL(x,max) (x * max / 100) struct moddata_display { char *fbdev; /* pathname of the framebuffer device */ struct display_flags flags; struct display_light lcdlight; /* structures for LCD light control */ struct display_light kbdlight; /* structures for keyboard light control */ int autoadj_min_bat; /* autoadjustment range parameters */ int autoadj_max_bat; int autoadj_min_ac; int autoadj_max_ac; int kbdon_brightness; /* keyboard brightness after switch on */ unsigned short keylcdup; /* keycodes and modifiers */ unsigned short modlcdup; /* for LCD backlight controls */ unsigned short keylcddn; unsigned short modlcddn; unsigned short keykbdup; /* keycodes and modifiers */ unsigned short modkbdup; /* for keyboard illumination controls */ unsigned short keykbddn; unsigned short modkbddn; unsigned short keykbdon; unsigned short modkbdon; unsigned short keymirror; /* keycode for CRT mirror key */ unsigned short modmirror; } modbase_display; int display_init () { struct moddata_display *base = &modbase_display; static char devbuffer_fb[STDBUFFERLEN]; int sid; bzero (base, sizeof (struct moddata_display)); sprintf(devbuffer_fb, DEFAULT_FB_DEVICE); base->fbdev = devbuffer_fb; if ((sid = registerCfgSection ("MODULE DISPLAY")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE DISPLAY"); return E_NOMEM; } else { registerCfgOptionInt (sid, "LCD_Brightness", TAG_LCDBRIGHTNESS, 0, N_("initial LCD brightness level in percent")); registerCfgOptionInt (sid, "LCD_FadingSpeed", TAG_LCDFADINGSPEED, 0, N_("0 = no smooth fading")); registerCfgOptionBool (sid, "LCD_AutoAdjust", TAG_LCDAUTOADJUST, 0, N_("only on Aluminum PowerBooks")); registerCfgOptionKey (sid, "LCD_IllumUpKey", TAG_LCDILLUMUPKEY, TAG_LCDILLUMUPMOD, 0, NULL); registerCfgOptionKey (sid, "LCD_IllumDownKey", TAG_LCDILLUMDOWNKEY, TAG_LCDILLUMDOWNMOD, 0, NULL); registerCfgOptionInt (sid, "LCD_Threshold", TAG_LCDTHRESHOLD, 0, N_("ambient light threshold in percent for backlight autoadj.")); registerCfgOptionInt (sid, "LCD_AutoAdjMin_Bat", TAG_LCDAUTOADJMINBAT, 0, N_("autoadjustment range parameters")); registerCfgOptionInt (sid, "LCD_AutoAdjMax_Bat", TAG_LCDAUTOADJMAXBAT, 0, NULL); registerCfgOptionInt (sid, "LCD_AutoAdjMin_AC", TAG_LCDAUTOADJMINAC, 0, NULL); registerCfgOptionInt (sid, "LCD_AutoAdjMax_AC", TAG_LCDAUTOADJMAXAC, 0, NULL); registerCfgOptionInt (sid, "KBD_Brightness", TAG_KBDBRIGHTNESS, 0, N_("initial keyboard illumination level in percent")); registerCfgOptionInt (sid, "KBD_OnBrightness", TAG_KBDONBRIGHTNESS, 0, N_("initial level in percent if KBD on/off key is pressed")); registerCfgOptionInt (sid, "KBD_FadingSpeed", TAG_KBDFADINGSPEED, 0, N_("0 = no smooth fading")); registerCfgOptionBool (sid, "KBD_AutoAdjust", TAG_KBDAUTOADJUST, 0, N_("only on Aluminum PowerBooks")); registerCfgOptionKey (sid, "KBD_IllumUpKey", TAG_KBDILLUMUPKEY, TAG_KBDILLUMUPMOD, 0, NULL); registerCfgOptionKey (sid, "KBD_IllumDownKey", TAG_KBDILLUMDOWNKEY, TAG_KBDILLUMDOWNMOD, 0, NULL); registerCfgOptionKey (sid, "KBD_IllumOnKey", TAG_KBDILLUMONKEY, TAG_KBDILLUMONMOD, 0, NULL); registerCfgOptionInt (sid, "KBD_Threshold", TAG_KBDTHRESHOLD, 0, N_("ambient light threshold in percent for keyboard light autoadj.")); registerCfgOptionString (sid, "dev_FrameBuffer", TAG_FRAMEBUFFERDEVICE, 0, NULL); registerCfgOptionBool (sid, "UseFBBlank", TAG_BLANKFRAMEBUFFER, 0, NULL); registerCfgOptionBool (sid, "DimFullyDark", TAG_DIMFULLYDARK, 0, NULL); registerCfgOptionKey (sid, "CRT_MirrorKey", TAG_CRTMIRRORKEY, TAG_CRTMIRRORMOD, 0, NULL); } register_function (QUERYQUEUE, display_query); register_function (CONFIGQUEUE, display_configure); return 0; } int display_open (struct tagitem *taglist) { struct moddata_display *base = &modbase_display; struct tagitem args[] = {{ TAG_BACKLIGHTMAX, 0 }, { TAG_BACKLIGHTLEVEL, -1 }, { TAG_KEYBLIGHTMAX, 0 }, { TAG_AMBIENTLIGHT, -1 }, { TAG_END, 0 }}; int level; process_queue (QUERYQUEUE, args); /* get some information from hardware module */ /* if no backlight controller was registered TAG_BACKLIGHTLEVEL * would return -1 which must be converted to be in brightness * range. furtheron a flag saves this information. */ base->flags.nobacklight = 0; if ((level = (int) tagfind (args, TAG_BACKLIGHTLEVEL, -1)) == -1) { level = (int) tagfind (args, TAG_BACKLIGHTMAX, 0); base->flags.nobacklight = 1; } base->lcdlight.current = level; base->lcdlight.target = level; base->lcdlight.max = (int) tagfind (args, TAG_BACKLIGHTMAX, 0); base->lcdlight.backup = level; base->lcdlight.offset = 0; base->lcdlight.threshold = 94; /* value in percent */ base->lcdlight.isrunning = 0; display_set_fading (&base->lcdlight, (int) tagfind (taglist, TAG_LCDFADINGSPEED, 0)); base->kbdlight.current = 0; base->kbdlight.target = 0; base->kbdlight.max = (int) tagfind (args, TAG_KEYBLIGHTMAX, 0); base->kbdlight.backup = 0; base->kbdlight.offset = 0; base->kbdlight.threshold = 28; /* value in percent */ base->kbdlight.isrunning = 0; display_set_fading (&base->kbdlight, (int) tagfind (taglist, TAG_KBDFADINGSPEED, 0)); process_queue_single (CONFIGQUEUE, TAG_KEYBLIGHTLEVEL, base->kbdlight.current); base->keylcdup = KEY_BRIGHTNESSUP; base->modlcdup = MOD_NONE; base->keylcddn = KEY_BRIGHTNESSDOWN; base->modlcddn = MOD_NONE; base->keykbdup = KEY_KBDILLUMUP; /* key not officially supported yet */ base->modkbdup = MOD_NONE; base->keykbddn = KEY_KBDILLUMDOWN; /* key not officially supported yet */ base->modkbddn = MOD_NONE; base->keykbdon = KEY_KBDILLUMTOGGLE; /* key not officially supported yet */ base->modkbdon = MOD_NONE; base->keymirror = KEY_F7; base->modmirror = MOD_CTRL; base->autoadj_min_bat = 1; base->autoadj_max_bat = base->lcdlight.max / 2 + 1; base->autoadj_min_ac = 1; base->autoadj_max_ac = base->lcdlight.max; base->kbdon_brightness = KBD_BRIGHTNESS_MIN; /* saved brightness for kbd on/off key */ base->flags.status = STATUS_NORMAL; base->flags.lmu_enable = tagfind(args, TAG_AMBIENTLIGHT, 0xffffffff) == 0xffffffff ? 0 : 1; base->flags.ctrl_fb = 0; /* framebuffer disabled by default */ base->flags.dimfullydark = 0; /* don't dim to complete darkness by default */ base->flags.lcd_autoadjust = 1; /* lcd and keyboard should react on */ base->flags.kbd_autoadjust = 1; /* ambient light if available */ base->flags.coveropen = 1; /* cover open by default same as in laptop module */ /* This value must be set to 1 if the initial value of kbd_onbrightness should * take effect but this will block KBD autoadjustment mode. In KBD autoadjustement * mode the initial value makes no sense so we set the flag dependent of the * users autoadjustment settings. * In case somebody set the keyboard brightness from extern the kbd_switchedoff * flag will always be 0 except the current brightness is zero (dark). This flag * status is set by display_handle_tags(), TAG_KBDBRIGHTNESS. */ if (base->kbdlight.current == 0) base->flags.kbd_switchedoff= !base->flags.kbd_autoadjust; register_function (KBDQUEUE, display_keyboard); register_function (T1000QUEUE, display_ambienttimer); return 0; } int display_close () { return 0; } int display_exit () { return 0; } /* This functions handles keyboard events * The keyboard illumination can be switched on/off with a * special key. Because the current brightness value could * not be read from hardware, it is saved statically in * this function. This is not the best sollution, but this * won't conflicting with the backup value needed by the * automatic adjustment function. * In autoadjust mode the appropriate keys change their * meaning. Instead of modifying the brightness directly the * keys now modify an offset that will shift the characteristic * curve for automatic brightness adjustment up or down a bit. * Although automatic adjustment ist enable the user keep * control over the brightness. * Functions using the shift modifier is disabled during * automatic control. */ void display_keyboard (struct tagitem *taglist) { struct moddata_display *base = &modbase_display; int code, value, mod, lcdstep, kbdstep, tmp; int level = 0, changed = 0; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value && base->flags.coveropen) { lcdstep = (base->lcdlight.max >> 4) + 1; kbdstep = (base->kbdlight.max >> 4) + 1; /* key for video mirroring */ if ((code == base->keymirror) && (mod == base->modmirror)) if ((tmp = display_switchmirror ()) != -1) singletag_to_clients(CHANGEVALUE, TAG_CRTMIRROR, tmp); /* keys for LCD brightness control */ if ((code == base->keylcdup) && ((mod & ~MOD_SHIFT) == base->modlcdup)) { /* somebody might have changed the brightness level directly so * check if we are still synchron here */ display_sync_lcdbrightness (); /* .target and .current will normally be the same value synchronized * by the display_timer() function. We use .target here because the * powersave module might have given an order to change brightness. * In case fading was activated this order would not be fullfilled * yet (only .target has been set accordingly) and if we used * .current here we would overwrite it. */ level = mod & MOD_SHIFT ? base->lcdlight.max : base->lcdlight.target + lcdstep; changed = 1; } else if ((code == base->keylcddn) && ((mod & ~MOD_SHIFT) == base->modlcddn)) { display_sync_lcdbrightness (); /* same as brightness up */ level = mod & MOD_SHIFT ? LCD_BRIGHTNESS_MIN : base->lcdlight.target - lcdstep; changed = 1; } /* keys for KBD illumination control */ if ((code == base->keykbdup) && ((mod & ~MOD_SHIFT) == base->modkbdup)) { if (base->flags.kbd_switchedoff) { base->kbdlight.current = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } level = mod & MOD_SHIFT ? base->kbdlight.max : base->kbdlight.current + kbdstep; changed = 2; } else if ((code == base->keykbddn) && ((mod & ~MOD_SHIFT) == base->modkbddn)) { if (base->flags.kbd_switchedoff) { base->kbdlight.current = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } level = mod & MOD_SHIFT ? KBD_BRIGHTNESS_MIN : base->kbdlight.current - kbdstep; changed = 2; } else if (base->flags.lmu_enable && (code == base->keykbdon) && (mod == base->modkbdon)) { if (base->flags.kbd_switchedoff) { level = base->kbdon_brightness; base->flags.kbd_switchedoff = 0; } else { base->kbdon_brightness = base->kbdlight.current; base->flags.kbd_switchedoff = 1; level = KBD_BRIGHTNESS_OFF; } level = display_set_kbdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } switch (changed) { case 1: /* LCD brightness level changed by keys */ if (base->flags.lmu_enable && base->flags.lcd_autoadjust) { if (mod & MOD_SHIFT) break; /* shift modifier disabled in automatic mode */ tmp = base->lcdlight.current - base->lcdlight.offset; base->lcdlight.offset += (level - base->lcdlight.current) > 0 ? lcdstep : -lcdstep; if (tmp + base->lcdlight.offset > base->lcdlight.max) base->lcdlight.offset = base->lcdlight.max - tmp; if (tmp + base->lcdlight.offset < 1) base->lcdlight.offset = -tmp; /* CHECK: base->lcdlight.offset = -tmp + 1; */ level = tmp + base->lcdlight.offset; } level = display_set_lcdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_LCDBRIGHTNESS, VAL2PERCENT(level, base->lcdlight.max)); break; case 2: /* Keyboard illumination level changed by keys */ if (base->flags.lmu_enable) { if (base->flags.kbd_autoadjust) { if (mod & MOD_SHIFT) break; /* shift modifier disabled in automatic mode */ tmp = base->kbdlight.current - base->kbdlight.offset; base->kbdlight.offset += (level - base->kbdlight.current) > 0 ? kbdstep : -kbdstep; if (tmp + base->kbdlight.offset > base->kbdlight.max) base->kbdlight.offset = base->kbdlight.max - tmp; if (tmp + base->kbdlight.offset < 0) base->kbdlight.offset = -tmp; level = tmp + base->kbdlight.offset; } level = display_set_kbdbrightness(level); singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } break; } } } /* The following two timer functions will set the brightness * level for the LCD and keyboard backlight. The timer will * be dynamically configured to be able to switch the brightness * hard or smooth from one level to another. * After the timer function did their job it will disable itself. * A new brightness change request will launch another timer. */ gboolean display_lcdtimer (gpointer data) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->lcdlight; if (illu->current != illu->target) { if (illu->fading && abs(illu->current - illu->target) >= illu->fadingstep) { if (illu->current > illu->target) /* target is darker as current */ illu->current -= illu->fadingstep; else /* target is brighter as current */ illu->current += illu->fadingstep; } else illu->current = illu->target; process_queue_single (CONFIGQUEUE, TAG_BACKLIGHTLEVEL, illu->current); display_framebuffer (illu->current ? 1: 0); return TRUE; } #if defined(DEBUG) && DISPLAYTIMER struct timeval endtime; double time; gettimeofday (&endtime, NULL); time = (endtime.tv_sec - illu->start.tv_sec) * 1000 + (endtime.tv_usec - illu->start.tv_usec) / 1000; print_msg (PBB_INFO, "DBG: LCD Display total time: %fms, time per step: %fms\n", time, time / illu->steps); print_msg (PBB_INFO, "DBG: LCD Display Timer stopped.\n"); #endif illu->isrunning = 0; return FALSE; } gboolean display_kbdtimer (gpointer data) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->kbdlight; if (base->flags.lmu_enable) { if (illu->current != illu->target) { if (illu->fading && abs(illu->current - illu->target) >= illu->fadingstep) { if (illu->current > illu->target) /* target is darker as current */ illu->current -= illu->fadingstep; else /* target is brighter as current */ illu->current += illu->fadingstep; } else illu->current = illu->target; process_queue_single (CONFIGQUEUE, TAG_KEYBLIGHTLEVEL, illu->current); return TRUE; } #if defined(DEBUG) && DISPLAYTIMER struct timeval endtime; double time; gettimeofday (&endtime, NULL); time = (endtime.tv_sec - illu->start.tv_sec) * 1000 + (endtime.tv_usec - illu->start.tv_usec) / 1000; print_msg (PBB_INFO, "DBG: KBD Display total time: %fms, time per step: %fms\n", time, time / illu->steps); print_msg (PBB_INFO, "DBG: KBD Display Timer stopped.\n"); #endif } illu->isrunning = 0; return FALSE; } /* Timer function called every second * In this function the automatic brighness adjustments for * LCD and keyboard are done. * The equations to calculate the new values allow values * generated out of range. This doesn't matter as long as * the function display_set_lcdbrightness() clip them to the * valid range. */ void display_ambienttimer (struct tagitem *taglist) { struct moddata_display *base = &modbase_display; long ambient; int level, lcdmax, lcdmin, ac; if (base->flags.lmu_enable && base->flags.status == STATUS_NORMAL) { /* process this code only if a LMU is present and the display * is not dimmed or switched off */ ac = process_queue_single (QUERYQUEUE, TAG_POWERSOURCE, 1); lcdmin = ac ? base->autoadj_min_ac : base->autoadj_min_bat; lcdmax = ac ? base->autoadj_max_ac : base->autoadj_max_bat; if ((ambient = process_queue_single (QUERYQUEUE, TAG_AMBIENTLIGHT, -1)) > -1) { if (base->flags.kbd_autoadjust && !base->flags.kbd_switchedoff) { level = -base->kbdlight.max * ambient/base->kbdlight.threshold + base->kbdlight.max; if (level + base->kbdlight.offset > base->kbdlight.max) base->kbdlight.offset = base->kbdlight.max - level; if (level + base->kbdlight.offset < 1) base->kbdlight.offset = -level; level += base->kbdlight.offset; display_set_kbdbrightness(level); } /* CHECK: */ /* skip the autoadjustment if the current brightness level is zero. * It's users will and we don't want to interfere with it */ if (base->flags.lcd_autoadjust && base->lcdlight.current != 0) { level = (base->lcdlight.max * ambient/base->lcdlight.threshold) + 1; if (level > lcdmax) level = lcdmax; if (level < lcdmin) level = lcdmin; if (level + base->lcdlight.offset > base->lcdlight.max) base->lcdlight.offset = base->lcdlight.max - level; if (level + base->lcdlight.offset < 1) base->lcdlight.offset = -level + 1; level += base->lcdlight.offset; /* offset due to manual adjustment */ display_set_lcdbrightness(level); } } } } void display_query (struct tagitem *taglist) { display_handle_tags (MODE_QUERY, taglist); } void display_configure (struct tagitem *taglist) { display_handle_tags (MODE_CONFIG, taglist); } void display_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_display *base = &modbase_display; int err, level; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_BRIGHTNESSOP: /* private tag */ if (cfgure) display_change_brightness (taglist->data); break; case TAG_LCDBRIGHTNESS: if (cfgure) { level = taglist->data; /* level in percent */ if (level > 100) level = 100; if (level < 0) level = 0; level = display_set_lcdbrightness (PERCENT2VAL(level, base->lcdlight.max)); singletag_to_clients(CHANGEVALUE, TAG_LCDBRIGHTNESS, VAL2PERCENT(level, base->lcdlight.max)); } else taglist->data = base->flags.nobacklight ? -1 : VAL2PERCENT(base->lcdlight.current, base->lcdlight.max); break; // case TAG_LCDBRIGHTNESSMAX: /* deprecated */ // if (cfgure) tagerror (taglist, E_NOWRITE); // else taglist->data = base->lcdlight.max; // break; case TAG_LCDFADINGSPEED: if (cfgure) display_set_fading (&base->lcdlight, taglist->data); else taglist->data = display_get_fading (&base->lcdlight); break; case TAG_KBDBRIGHTNESS: if (cfgure) { level = taglist->data; /* level in percent */ if (level > 100) level = 100; if (level < 0) level = 0; level = display_set_kbdbrightness (PERCENT2VAL(level, base->kbdlight.max)); if (level > 0) base->flags.kbd_switchedoff = 0; singletag_to_clients(CHANGEVALUE, TAG_KBDBRIGHTNESS, VAL2PERCENT(level, base->kbdlight.max)); } else taglist->data = VAL2PERCENT(base->kbdlight.current, base->kbdlight.max); break; case TAG_KBDONBRIGHTNESS: if (cfgure) { level = taglist->data; /* level in percent */ if (level > 100) level = 100; if (level < 0) level = 0; base->kbdon_brightness = PERCENT2VAL(level, base->kbdlight.max); if (base->kbdon_brightness < KBD_BRIGHTNESS_MIN) base->kbdon_brightness = KBD_BRIGHTNESS_MIN; } else taglist->data = VAL2PERCENT(base->kbdon_brightness, base->kbdlight.max); break; // case TAG_KBDBRIGHTNESSMAX: /* deprecated */ // if (cfgure) tagerror (taglist, E_NOWRITE); // else taglist->data = base->kbdlight.max; // break; case TAG_KBDFADINGSPEED: if (cfgure) display_set_fading (&base->kbdlight, taglist->data); else taglist->data = display_get_fading (&base->kbdlight); break; case TAG_LCDILLUMUPKEY: if (cfgure) base->keylcdup = taglist->data; else taglist->data = base->keylcdup; break; case TAG_LCDILLUMUPMOD: if (cfgure) base->modlcdup = taglist->data; else taglist->data = base->modlcdup; break; case TAG_LCDILLUMDOWNKEY: if (cfgure) base->keylcddn = taglist->data; else taglist->data = base->keylcddn; break; case TAG_LCDILLUMDOWNMOD: if (cfgure) base->modlcddn = taglist->data; else taglist->data = base->modlcddn; break; case TAG_KBDILLUMUPKEY: if (cfgure) base->keykbdup = taglist->data; else taglist->data = base->keykbdup; break; case TAG_KBDILLUMUPMOD: if (cfgure) base->modkbdup = taglist->data; else taglist->data = base->modkbdup; break; case TAG_KBDILLUMDOWNKEY: if (cfgure) base->keykbddn = taglist->data; else taglist->data = base->keykbddn; break; case TAG_KBDILLUMDOWNMOD: if (cfgure) base->modkbddn = taglist->data; else taglist->data = base->modkbddn; break; case TAG_KBDILLUMONKEY: if (cfgure) base->keykbdon = taglist->data; else taglist->data = base->keykbdon; break; case TAG_KBDILLUMONMOD: if (cfgure) base->modkbdon = taglist->data; else taglist->data = base->modkbdon; break; case TAG_CRTMIRRORKEY: if (cfgure) base->keymirror = taglist->data; else taglist->data = base->keymirror; break; case TAG_CRTMIRRORMOD: if (cfgure) base->modmirror = taglist->data; else taglist->data = base->modmirror; break; case TAG_FRAMEBUFFERDEVICE: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->fbdev, TYPE_CHARDEV, CPFLG_NONE))) tagerror (taglist, err); } else taglist->data = (long) base->fbdev; break; case TAG_BLANKFRAMEBUFFER: if (cfgure) base->flags.ctrl_fb = taglist->data & 1; else taglist->data = base->flags.ctrl_fb; break; case TAG_DIMFULLYDARK: if (cfgure) base->flags.dimfullydark = taglist->data & 1; else taglist->data = base->flags.dimfullydark; break; case TAG_LCDAUTOADJUST: if (cfgure) { base->flags.lcd_autoadjust = taglist->data & 1; base->lcdlight.offset = 0; } else taglist->data = base->flags.lcd_autoadjust; break; case TAG_KBDAUTOADJUST: if (cfgure) { base->flags.kbd_autoadjust = taglist->data & 1; base->kbdlight.offset = 0; } else taglist->data = base->flags.kbd_autoadjust; break; case TAG_KBDTHRESHOLD: if (cfgure) { if (taglist->data > 99) base->kbdlight.threshold = 99; else if (taglist->data < 1) base->kbdlight.threshold = 1; else base->kbdlight.threshold = taglist->data; } else taglist->data = base->kbdlight.threshold; break; case TAG_LCDTHRESHOLD: if (cfgure) { if (taglist->data > 99) base->lcdlight.threshold = 99; else if (taglist->data < 1) base->lcdlight.threshold = 1; else base->lcdlight.threshold = taglist->data; } else taglist->data = base->lcdlight.threshold; break; case TAG_LCDAUTOADJMINBAT: if (cfgure) base->autoadj_min_bat = taglist->data; else taglist->data = base->autoadj_min_bat; break; case TAG_LCDAUTOADJMAXBAT: if (cfgure) base->autoadj_max_bat = taglist->data; else taglist->data = base->autoadj_max_bat; break; case TAG_LCDAUTOADJMINAC: if (cfgure) base->autoadj_min_ac = taglist->data; else taglist->data = base->autoadj_min_ac; break; case TAG_LCDAUTOADJMAXAC: if (cfgure) base->autoadj_max_ac = taglist->data; else taglist->data = base->autoadj_max_ac; break; case TAG_COVERSTATUS: /* private tag */ if (cfgure) base->flags.coveropen = taglist->data & 1; break; case TAG_PREPAREFORSLEEP: /* private tag */ if ((cfgure) && base->flags.nobacklight) { display_framebuffer (0); } break; case TAG_WAKEUPFROMSLEEP: /* private tag */ display_sync_lcdbrightness (); if ((cfgure) && base->lcdlight.current) { display_framebuffer (1); } /* base->coveropen must be synchronized after sleep. This is done * by the module_pmac. This module sends the WAKEUPFROMSLEEP tag * and after a short delay the COVERSTATUS tag so that no special * actions need to be taken here. */ break; } taglist++; } } /* This functions checks the limits of a given brightness level, * clip it if neseccary and set it as new target. */ int display_set_lcdbrightness(int level) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->lcdlight; int val; if (base->flags.nobacklight) { if (level > 0) level = illu->max; illu->target = level; return -1; } else { val = display_clip_brightness (illu, level); if (illu->isrunning == 0) { illu->isrunning = 1; #if defined(DEBUG) && DISPLAYTIMER illu->steps = abs(illu->target - illu->current); gettimeofday (&illu->start, NULL); print_msg (PBB_INFO, "DBG: LCD Display Timer started.\n"); #endif g_timeout_add (illu->fading ? illu->fading : 9, display_lcdtimer, NULL); } #if defined(DEBUG) && BRIGHTNESS print_msg (PBB_INFO, "DBG: LCD Brightness: %d\n", val); #endif return val; } } int display_set_kbdbrightness(int level) { struct moddata_display *base = &modbase_display; struct display_light *illu = &base->kbdlight; int val; val = display_clip_brightness (illu, level); if (illu->isrunning == 0) { illu->isrunning = 1; #if defined(DEBUG) && DISPLAYTIMER illu->steps = abs(illu->target - illu->current); gettimeofday (&illu->start, NULL); print_msg (PBB_INFO, "DBG: KBD Display Timer started.\n"); #endif g_timeout_add (illu->fading ? illu->fading : 9, display_kbdtimer, NULL); } #if defined(DEBUG) && BRIGHTNESS print_msg (PBB_INFO, "DBG: KBD Brightness: %d\n", val); #endif return val; } int display_clip_brightness(struct display_light *illu, int level) { if (level > illu->max) level = illu->max; if (level < 0) level = 0; illu->target = level; return level; } void display_set_fading (struct display_light *illu, int fading) { double timer, step; if (fading > 0) { timer = (double) fading / (illu->max + 1); step = ceil (5.0 / timer); if (step < illu->max) { illu->fading = floor (timer * step + 0.5) - 1; illu->fadingstep = step; goto out; } } illu->fading = 0; illu->fadingstep = 1; out: #if defined(DEBUG) && DISPLAYTIMER print_msg (PBB_INFO, "DBG: Timer: %d, step: %d\n", illu->fading, illu->fadingstep); #endif return; } int display_get_fading (struct display_light *illu) { return illu->fading * (illu->max + 1) / illu->fadingstep; } /* central control function for LCD backlight and keyboard * illumination interface to the outer world. Up to now only * module_powersave.c called this function. * status of the machine: * 0: normal operation, LCD on, KBD on * 1: dimmed, LCD min or off, KBD off * 2: off, LCD off, KBD off * The brightness level will be set by the display_timer() * function. */ void display_change_brightness(int op) { struct moddata_display *base = &modbase_display; /* somebody might have changed the brightness level directly so * check if we are still synchron here */ display_sync_lcdbrightness (); if (((op == OP_DIM_RECOVER) && (base->flags.status == STATUS_NORMAL)) || ((op == OP_DIM_LIGHT) && (base->flags.status != STATUS_NORMAL)) || ((op == OP_DIM_OFF) && (base->flags.status == STATUS_OFF))) return; /* if a backlight controller is not available try to dim to * complete darkness in hope the framebuffer device is able * to switch the backlight off. The framebuffer option must * be configured accordingly to make this work. */ if ((base->flags.dimfullydark || base->flags.nobacklight) && op == OP_DIM_LIGHT) op = OP_DIM_OFF; switch (op) { case OP_DIM_LIGHT: base->lcdlight.backup = base->lcdlight.current; /* if current LCD brightness level is 0 then let it * as it is because it is user's will */ if (base->lcdlight.current > LCD_BRIGHTNESS_OFF) base->lcdlight.target = LCD_BRIGHTNESS_MIN; base->kbdlight.backup = base->kbdlight.current; base->kbdlight.target = KBD_BRIGHTNESS_OFF; base->flags.status = STATUS_DIMMED; break; case OP_DIM_OFF: if (base->flags.status != STATUS_DIMMED) { base->lcdlight.backup = base->lcdlight.current; base->kbdlight.backup = base->kbdlight.current; } base->lcdlight.target = LCD_BRIGHTNESS_OFF; base->kbdlight.target = KBD_BRIGHTNESS_OFF; base->flags.status = STATUS_OFF; break; case OP_DIM_RECOVER: base->lcdlight.target = base->lcdlight.backup; /* don't recover zero display brightness * set to minimum brightness instead */ if (base->lcdlight.target == LCD_BRIGHTNESS_OFF) base->lcdlight.target = LCD_BRIGHTNESS_MIN; base->kbdlight.target = base->kbdlight.backup; base->flags.status = STATUS_NORMAL; break; } display_set_lcdbrightness(base->lcdlight.target); display_set_kbdbrightness(base->kbdlight.target); } void display_framebuffer (int on) { struct moddata_display *base = &modbase_display; int fd = -1, err; if (base->flags.ctrl_fb) { if ((fd = open(base->fbdev, O_RDWR)) >= 0) { /* open framebuffer device */ err = ioctl(fd, FBIOBLANK, on ? 0 : VESA_POWERDOWN + 1); // print_msg (PBB_INFO, "Framebuffer on: %d, error: %d\n", !on, err); close (fd); } else print_msg (PBB_ERR, _("Can't open framebuffer device '%s'.\n"), base->fbdev); } } void display_sync_lcdbrightness (void) { struct moddata_display *base = &modbase_display; int level; level = process_queue_single (QUERYQUEUE, TAG_BACKLIGHTLEVEL, -1); if (level != base->lcdlight.current) { base->flags.status = STATUS_NORMAL; if (level != -1) { /* Somebody else has changed the LCD brightness * so sync our system. */ base->lcdlight.current = level; base->lcdlight.target = level; base->flags.nobacklight = 0; } else { /* no backlight controller available */ base->lcdlight.current = base->lcdlight.max; base->lcdlight.target = base->lcdlight.max; base->flags.nobacklight = 1; } } } int display_switchmirror () { struct moddata_display *base = &modbase_display; unsigned long value; int fd, rc = -1; if ((fd = open(base->fbdev, O_RDWR)) >= 0) { /* open framebuffer device */ if (ioctl(fd, FBIO_ATY128_GET_MIRROR, &value) == 0) { value ^= ATY_MIRROR_CRT_ON; ioctl(fd, FBIO_ATY128_SET_MIRROR, &value); rc = value & ATY_MIRROR_CRT_ON ? 1 : 0; } else if (ioctl(fd, FBIO_RADEON_GET_MIRROR, &value) == 0) { value ^= ATY_RADEON_CRT_ON; ioctl(fd, FBIO_RADEON_SET_MIRROR, &value); rc = value & ATY_RADEON_CRT_ON ? 1 : 0; } close (fd); } else print_msg (PBB_ERR, _("Can't open framebuffer device '%s'.\n"), base->fbdev); return rc; } pbbuttonsd-0.7.9/src/module_display.h0000644000175000017500000000723110507173756014624 00000000000000#ifndef INCLUDE_MODULE_DISPLAY_H #define INCLUDE_MODULE_DISPLAY_H /* ---------------------------------------------------------------------------- * module_display.h * prototypes and definitions for the module display. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #include "debug.h" #define DEFAULT_FB_DEVICE "/dev/fb0" #ifndef KEY_KBDILLUMTOGGLE #define KEY_KBDILLUMTOGGLE 228 #endif #ifndef KEY_KBDILLUMDOWN #define KEY_KBDILLUMDOWN 229 #endif #ifndef KEY_KBDILLUMUP #define KEY_KBDILLUMUP 230 #endif #ifndef FBIOBLANK #define FBIOBLANK 0x4611 /* 0 or vesa-level+1 */ #endif #ifndef VESA_POWERDOWN /* vesa level for FBIOBLANK */ #define VESA_POWERDOWN 3 #endif /* Definitions to control ATI Framebuffer, because they aren't * available as linux include file. Definitions for the radeon * framebuffer are placed in linux/radeonfb.h */ #define ATY_MIRROR_CRT_ON 0x00000002 #define FBIO_ATY128_GET_MIRROR _IOR('@', 1, __u32) #define FBIO_ATY128_SET_MIRROR _IOW('@', 2, __u32) /* operation codes (OP) for display_setlevel() */ #define OP_DIM_LIGHT 1 #define OP_DIM_RECOVER 2 #define OP_DIM_OFF 3 #define LCD_BRIGHTNESS_OFF 0 /* lower ranges for light sources */ #define LCD_BRIGHTNESS_MIN 1 /* of 16 steps */ #define KBD_BRIGHTNESS_OFF 0 #define KBD_BRIGHTNESS_MIN 16 /* of 256 steps */ /* definitions for status */ #define STATUS_NORMAL 0 #define STATUS_DIMMED 1 #define STATUS_OFF 2 struct display_flags { unsigned int lmu_enable:1; unsigned int lcd_autoadjust:1; unsigned int kbd_autoadjust:1; unsigned int kbd_switchedoff:1; unsigned int ctrl_fb:1; /* 1, if framebuffer should be blanked too */ unsigned int dimfullydark:1; unsigned int status:2; unsigned int coveropen:1; /* track signal from TAG_COVERSTATUS */ unsigned int nobacklight:1; /* no backlight controller available */ unsigned int :0; }; struct display_light { int current; /* current brightness value */ int target; /* brightness to set to */ int max; /* maximum brightness value */ int backup; int offset; /* users influence on automatic adjustment */ int fading; /* timer interval or 0 for no fading */ int fadingstep; int threshold; /* ambient threshold for automatic adjustment */ int isrunning; /* display timer currently running */ #if defined(DEBUG) && DISPLAYTIMER struct timeval start; /* for profiling fading routines */ int steps; #endif }; /* public prototypes */ int display_init (); int display_open (struct tagitem *taglist); int display_close (); int display_exit (); /* private prototypes */ void display_keyboard (struct tagitem *taglist); void display_query (struct tagitem *taglist); void display_configure (struct tagitem *taglist); /*void display_timer (struct tagitem *taglist);*/ gboolean display_timer (gpointer data); void display_ambienttimer (struct tagitem *taglist); void display_handle_tags (int mode, struct tagitem *taglist); int display_set_lcdbrightness(int level); int display_set_kbdbrightness(int level); int display_clip_brightness(struct display_light *illu, int level); void display_set_fading (struct display_light *illu, int fading); int display_get_fading (struct display_light *illu); void display_change_brightness(int op); void display_framebuffer (int on); void display_sync_lcdbrightness (void); int display_switchmirror (); #endif /* INCLUDE_MODULE_DISPLAY_H */ pbbuttonsd-0.7.9/src/module_cdrom.c0000644000175000017500000002537610317472203014254 00000000000000/* -------------------------------------------------------------------------- * module_cdrom.c * code for module cdrom * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include "pbbinput.h" #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_cdrom.h" #include "support.h" #include "debug.h" struct moddata_cdrom { char *cdromdev; /* pathname of the cdrom device */ unsigned short keyejectcd; unsigned short modejectcd; struct timeval tv; /* time of key press */ int keydelaytime; /* delay in ms */ int cdejected; } modbase_cdrom; int cdrom_init () { struct moddata_cdrom *base = &modbase_cdrom; static char devbuffer_cdrom[STDBUFFERLEN]; int sid; sprintf(devbuffer_cdrom, DEFAULT_CDROM); base->cdromdev = devbuffer_cdrom; base->keyejectcd = KEY_EJECTCD; base->modejectcd = MOD_NONE; base->keydelaytime = 0; if ((sid = registerCfgSection ("MODULE CDROM")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE CDROM"); return E_NOMEM; } else { registerCfgOptionString (sid, "dev_CDROM", TAG_CDROMDEVICE, 0, NULL); registerCfgOptionKey (sid, "EjectCDKey", TAG_EJECTCDKEY, TAG_EJECTCDMOD, 0, NULL); registerCfgOptionInt (sid, "EjectCDKeyDelay", TAG_EJECTCDKEYDELAY, 0, NULL); } register_function (QUERYQUEUE, cdrom_query); register_function (CONFIGQUEUE, cdrom_configure); return 0; } int cdrom_open (struct tagitem *taglist) { struct moddata_cdrom *base = &modbase_cdrom; char *devname; int rc; devname = (char *) tagfind (taglist, TAG_CDROMDEVICE, (long) DEFAULT_CDROM); if ((rc = copy_path (devname, base->cdromdev, TYPE_BLKDEV, CPFLG_MAYBEMISSED))) { print_msg (PBB_ERR, _("Please check your CDROM settings in configuration file.\n")); return rc; } #if defined(DEBUG) && CDROMPERF cdrom_testperformance (); #endif register_function (KBDQUEUE, cdrom_keyboard); return 0; } int cdrom_close () { return 0; } int cdrom_exit () { return 0; } void cdrom_keyboard (struct tagitem *taglist) { struct moddata_cdrom *base = &modbase_cdrom; int code, value, mod; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value) { if (value == 1) base->cdejected = 0; if ((code == base->keyejectcd) && (mod == base->modejectcd)) if ((base->keydelaytime == 0) || (keydelayms(&base->tv, value, base->keydelaytime))) if (base->cdejected == 0) { base->cdejected = 1; cdrom_eject (); } } } void cdrom_query (struct tagitem *taglist) { cdrom_handle_tags(MODE_QUERY, taglist); } void cdrom_configure (struct tagitem *taglist) { cdrom_handle_tags(MODE_CONFIG, taglist); } void cdrom_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_cdrom *base = &modbase_cdrom; int err; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_EJECTCD: if (cfgure) { singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 1); if ((cdrom_eject()) == 0) singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 0); } else tagerror (taglist, E_NOREAD); break; case TAG_CDROMDEVICE: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->cdromdev, TYPE_BLKDEV, CPFLG_MAYBEMISSED))) tagerror (taglist, err); } else taglist->data = (long) base->cdromdev; break; case TAG_EJECTCDKEY: if (cfgure) base->keyejectcd = taglist->data; else taglist->data = base->keyejectcd; break; case TAG_EJECTCDMOD: if (cfgure) base->modejectcd = taglist->data; else taglist->data = base->modejectcd; break; case TAG_EJECTCDKEYDELAY: if (cfgure) base->keydelaytime = taglist->data; else taglist->data = base->keydelaytime; break; } taglist++; } } /* This function checks is a given name could be found in * a list of names. It returns a boolean walue: * 1 = list contains name * 0 = name could not be found in list */ int cdrom_cmpDevName(struct listhead *list, char *name) { struct listnode *it = list->first; while ((it = it->next)) if (strcmp (name, (char*) getNodeData(it->pred)) == 0) return 1; return 0; } /* This function adds 'name' to a double linked list. The * memory for the node and the name is dynamically allocated. * The name is copied to the newly allocated memory so that * the caller must no longer take care about it. * The function returns -1 on error (out of memory). */ int cdrom_addDevName(struct listhead *list, char *name) { struct listnode *node; if((node = newListNode (strlen(name)+1))) { strcpy ((char*)getNodeData(node), name); appendListNode (list, node); return 0; } return -1; /* out of memory */ } /* This function gets the mountpoint of a given device. The source * of mountpoints is the file /proc/mounts. The function compares * if the device is mounted and where. Symlinks will be resolved * so that if a link to the device was mounted the mountpoint * would be found too. * * symlink chain: /dev/cdrom -> /dev/cd1 -> /dev/hdc * cdrom mounted: /dev/cd1 * * The mountpount will be found either /dev/cdrom or /dev/hdc is * given. */ char * cdrom_getmountpoint(char *device) { static char buffer[100]; struct listhead devs; char linkbuf[50], *mountpoint = NULL, *token; FILE *fd; int n; initListHeader (&devs); strcpy (buffer, device); do { if (cdrom_addDevName (&devs, buffer)) return NULL; /* out of memory */ if ((n = readlink(buffer, linkbuf, sizeof(linkbuf)-1)) >= 0) { linkbuf[n] = '\0'; /* readlink() doesn't terminate buffer */ if (linkbuf[0] == '/') /* link is absolute */ strcpy (buffer, linkbuf); else if ((token = strrchr (buffer, '/'))) { *(++token) = 0; /* terminate path behind last '/' */ strcat (buffer, linkbuf); } else /* this should never happen. It means the startpath is already * relative, so that we can't evaluate the path */ break; } } while (n != -1); if ((fd = fopen ("/proc/mounts","r"))) { while (fgets (buffer, sizeof (buffer), fd)) { if (buffer[0] != '/') continue; /* check only real devices */ #if defined(DEBUG) && CDROM printf("mount = %s", buffer); #endif if ((token = strtok (buffer," \n"))) { strcpy (buffer, token); do { #if defined(DEBUG) && CDROM printf(" dev = %s\n", buffer); #endif if ((cdrom_cmpDevName (&devs, buffer))) { mountpoint = strtok(0," \n"); goto out; } if ((n = readlink(buffer, linkbuf, sizeof(linkbuf)-1)) >= 0) linkbuf[n] = '\0'; /* readlink() doesn't terminate buffer */ if (linkbuf[0] == '/') /* link is absolute */ strcpy (buffer, linkbuf); else if ((token = strrchr (buffer, '/'))) { *(++token) = 0; /* terminate path behind last '/' */ strcat (buffer, linkbuf); } else /* this should never happen. It means the startpath is already * relative, so that we can't evaluate the path */ break; } while (n != -1); } } out: fclose(fd); } freeList (&devs); return mountpoint; } /* This function eject the cdrom or close the tray if the CDROM is * already ejected. If neseccary the cdrom will be unmounted first. * Following return codes are possible: * 0: Drive is busy, * 1: CDROM has been ejected or the tray was opened, * 2: The Tray has been closed, * The external helper program umount is used because the system * call umount() doesn't update /etc/mtab and this conflicts with * umount's normal operation. */ int cdrom_eject() { struct moddata_cdrom *base = &modbase_cdrom; int fd, err = 0, rc = 0; unsigned int t1, t2; char *mp; singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 0); /* busy */ if ((mp = cdrom_getmountpoint(base->cdromdev))) err = call_script ("/bin/umount %.30s", mp); #if defined(DEBUG) && CDROM printf ("mp=%s, err=%d, %s (%d)\n", mp, err, strerror(errno), errno); #endif if (mp == NULL || err == 0 || errno == EINVAL) { if ((fd = open(base->cdromdev, O_RDONLY | O_NONBLOCK | O_NDELAY)) >= 0) { #if defined(DEBUG) && CDROMPERF err = ioctl (fd, CDROM_GET_CAPABILITY); printf ("capabilities: %x\n", err); #endif err = ioctl (fd, CDROM_DRIVE_STATUS); switch (err) { case 2: /* CDS_TRAY_OPEN */ default: singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 2); /* close */ t1 = cdrom_gettime (); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime (); #if defined(DEBUG) && CDROMPERF printf ("close Tray: %4d (%4u-%4u)\n", t2-t1, t2, t1); #endif rc = 2; if (t2-t1 > 100) break; case 1: /* CDS_NO_DISK */ case 4: /* CDS_DISK_OK */ singletag_to_clients(CHANGEVALUE, TAG_EJECTCD, 1); /* eject */ #if defined(DEBUG) && CDROMPERF t1 = cdrom_gettime (); #endif ioctl (fd, CDROMEJECT); #if defined(DEBUG) && CDROMPERF t2 = cdrom_gettime (); printf ("open Tray : %4d (%4u-%4u)\n", t2-t1, t2, t1); #endif rc = 1; } close (fd); } else print_msg (PBB_WARN, _("Can't open %s. Eject CDROM won't work.\n"), base->cdromdev); } return rc; } unsigned int cdrom_gettime () { struct timeval tv; gettimeofday(&tv, NULL); return (tv.tv_sec * 1000 + tv.tv_usec / 1000 ); } #if defined(DEBUG) && CDROMPERF void cdrom_testperformance () { struct moddata_cdrom *base = &modbase_cdrom; int fd; unsigned int t1, t2; printf ("\nCDROM Performancedata: \n"); if ((fd = open(base->cdromdev, O_RDONLY | O_NONBLOCK | O_NDELAY)) >= 0) { printf ("Close already closed Tray: "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Open closed Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMEJECT); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Open already open Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMEJECT); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Close open Tray : "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n", t2-t1, t2, t1); sleep(1); printf ("Close already closed Tray: "); t1 = cdrom_gettime(); ioctl (fd, CDROMCLOSETRAY); t2 = cdrom_gettime(); printf ("%4d (%4u-%4u)\n\n", t2-t1, t2, t1); close (fd); } else printf ("CDROM open failed!\n\n"); } #endif pbbuttonsd-0.7.9/src/module_cdrom.h0000644000175000017500000000221610217517037014251 00000000000000#ifndef INCLUDE_MODULE_CDROM_H #define INCLUDE_MODULE_CDROM_H /* ---------------------------------------------------------------------------- * module_cdrom.h * prototypes and definitions for the CDROM module. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define DEFAULT_CDROM "/dev/cdrom" /* public prototypes */ int cdrom_init (); int cdrom_open (struct tagitem *taglist); int cdrom_close (); int cdrom_exit (); /* private prototypes */ void cdrom_keyboard (struct tagitem *taglist); void cdrom_query (struct tagitem *taglist); void cdrom_configure (struct tagitem *taglist); void cdrom_handle_tags (int cfgure, struct tagitem *taglist); char *cdrom_getmountpoint(char *device); int cdrom_eject (); unsigned int cdrom_gettime (); void cdrom_testperformance (); #endif /* INCLUDE_MODULE_CDROM_H */ pbbuttonsd-0.7.9/src/module_mixer.c0000644000175000017500000001223610305554336014270 00000000000000/* -------------------------------------------------------------------------- * module_mixer.c * general code for the mixer module. This module doesn't control the * mixer device directly. It delegates all actions to the configured or * detected mixer module (OSS or ALSA) and keep only generic actions for * itself * * Copyright 2002-2004 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_mixer.h" #include "module_ossmixer.h" #include "module_alsamixer.h" #include "support.h" struct moddata_mixer { int soundsystem; /* currently active sound system */ int soundsystemcfg; /* soundsystem to write to configfile */ } modbase_mixer; int mixer_init () { struct moddata_mixer *base = &modbase_mixer; int sid; base->soundsystem = SOUNDSYSTEM_NONE; base->soundsystemcfg = SOUNDSYSTEM_AUTO; if ((sid = registerCfgSection ("MODULE MIXER")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE MIXER"); return E_NOMEM; } else { registerCfgOptionList (sid, "SoundSystem", TAG_SOUNDSYSTEMCFG, 0, N_("'"SOUNDSYSTEM_NONE_NAME"', '"SOUNDSYSTEM_AUTO_NAME"', '"SOUNDSYSTEM_OSS_NAME"' or '"SOUNDSYSTEM_ALSA_NAME"'"), SOUNDSYSTEM_NONE_NAME, SOUNDSYSTEM_AUTO_NAME, SOUNDSYSTEM_OSS_NAME, SOUNDSYSTEM_ALSA_NAME, NULL); } register_function (QUERYQUEUE, mixer_query); register_function (CONFIGQUEUE, mixer_configure); return 0; } int mixer_open (struct tagitem *taglist) { struct moddata_mixer *base = &modbase_mixer; char *names[] = {SOUNDSYSTEM_NONE_NAME, SOUNDSYSTEM_AUTO_NAME, SOUNDSYSTEM_OSS_NAME, SOUNDSYSTEM_ALSA_NAME}; int rc = 0, requested, soundsystem, autodetect = 0; requested = soundsystem = (int) tagfind (taglist, TAG_SOUNDSYSTEMCFG, SOUNDSYSTEM_NONE); #if defined(WITH_ALSA) && defined(WITH_OSS) int fd; char *mixerdev; if (soundsystem == SOUNDSYSTEM_AUTO) { soundsystem = SOUNDSYSTEM_NONE; autodetect = 1; if ((tagfind (taglist, TAG_MIXERINITDELAY, 0)) == 1) { print_msg (PBB_WARN, _("MixerInitDelay is not possible with automatic mixer detection; option disabled.\n")); tagskip (taglist, TAG_MIXERINITDELAY); } if ((check_devorfile ("/proc/asound", TYPE_DIR)) == E_OK) { soundsystem = SOUNDSYSTEM_ALSA; } else { mixerdev = (char *) tagfind (taglist, TAG_MIXERDEVICE, (long) DEFAULT_MIXER); if ((check_devorfile (mixerdev, TYPE_CHARDEV)) == E_OK) if ((fd = open (mixerdev, O_RDWR)) >= 0) { soundsystem = SOUNDSYSTEM_OSS; close (fd); } } } #endif switch (soundsystem) { case SOUNDSYSTEM_NONE: default: rc = 0; break; case SOUNDSYSTEM_AUTO: #ifndef WITH_OSS case SOUNDSYSTEM_OSS: /* if OSS is not compiled in, give ALSA a try. * ALSA would do the same with OSS. */ #endif case SOUNDSYSTEM_ALSA: /* ALSA */ #ifdef WITH_ALSA rc = alsamixer_open (taglist); if (!rc || (rc && !autodetect)) { base->soundsystem = rc ? SOUNDSYSTEM_NONE : SOUNDSYSTEM_ALSA; break; } #endif #ifdef WITH_OSS case SOUNDSYSTEM_OSS: /* OSS */ rc = ossmixer_open (taglist); base->soundsystem = rc ? SOUNDSYSTEM_NONE : SOUNDSYSTEM_OSS; #endif break; } if (autodetect) print_msg (PBB_INFO, _("Soundsystem requested: %s, detected: %s and at least activated: %s.\n"), names[requested], names[soundsystem], names[base->soundsystem]); else print_msg (PBB_INFO, _("Soundsystem requested: %s and at least activated: %s.\n"), names[requested], names[base->soundsystem]); return 0; /* don't report an error, if soundsystem can't be initialized */ } int mixer_close () { struct moddata_mixer *base = &modbase_mixer; switch (base->soundsystem) { case SOUNDSYSTEM_ALSA: #ifdef WITH_ALSA alsamixer_close (); break; #endif case SOUNDSYSTEM_OSS: #ifdef WITH_OSS ossmixer_close (); break; #endif default: break; } return 0; } int mixer_exit () { return 0; } void mixer_query (struct tagitem *taglist) { mixer_handle_tags (MODE_QUERY, taglist); } void mixer_configure (struct tagitem *taglist) { mixer_handle_tags (MODE_CONFIG, taglist); } void mixer_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_mixer *base = &modbase_mixer; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_SOUNDSYSTEM: if (cfgure) tagerror (taglist, E_NOWRITE); else taglist->data = base->soundsystem; break; case TAG_SOUNDSYSTEMCFG: /* This tag configures the soundsystem. This change has to written to * the configfile first and become active with next server start. * Changing the soundsystem on the fly is not possible. */ if (cfgure) base->soundsystemcfg = taglist->data; else taglist->data = base->soundsystemcfg; break; } taglist++; } } pbbuttonsd-0.7.9/src/module_mixer.h0000644000175000017500000000227710217517175014303 00000000000000#ifndef INCLUDE_MODULE_MIXER_H #define INCLUDE_MODULE_MIXER_H /* ---------------------------------------------------------------------------- * module_mixer.h * general definitions for all mixer modules * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define SOUNDSYSTEM_NONE_NAME "none" #define SOUNDSYSTEM_AUTO_NAME "auto" #define SOUNDSYSTEM_OSS_NAME "OSS" #define SOUNDSYSTEM_ALSA_NAME "ALSA" enum {SOUNDSYSTEM_NONE, SOUNDSYSTEM_AUTO, SOUNDSYSTEM_OSS, SOUNDSYSTEM_ALSA, SOUNDSYSTEM_LAST=SOUNDSYSTEM_ALSA}; /* public prototypes */ int mixer_init (); int mixer_open (struct tagitem *taglist); int mixer_close (); int mixer_exit (); /* private prototypes */ void mixer_query (struct tagitem *taglist); void mixer_configure (struct tagitem *taglist); void mixer_handle_tags (int cfgure, struct tagitem *taglist); #endif /* INCLUDE_MODULE_MIXER_H */ pbbuttonsd-0.7.9/src/module_ossmixer.c0000644000175000017500000003206310265762151015016 00000000000000/* -------------------------------------------------------------------------- * module_mixer.c * code for the OSS mixer module, controling volume levels * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_OSS #include #include #include #include #include #include #include #include "pbbinput.h" #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_mixer.h" #include "module_ossmixer.h" #include "support.h" struct moddata_ossmixer { char *mixerdev; /* name of the mixer device */ unsigned short keyvolup; unsigned short modvolup; unsigned short keyvoldn; unsigned short modvoldn; unsigned short keymute; unsigned short modmute; struct modflags_ossmixer flags; int mixerdevmask; /* supported channels from mixer */ int userdevmask; /* desired channels from user */ int volume; /* last volume set */ int master; /* master sound channel */ } modbase_ossmixer; #define COUNT_MIXERCHANNELS 25 char *mixerchannels[] = {"volume", "bass", "treble", "synth", "pcm", "speaker", \ "line", "mic", "cd", "imix", "altpcm", "reclev", "igain", "ogain", \ "line1", "line2", "line3", "digital1", "digital2", "digital3", "phonein", \ "phoneout", "video", "radio", "monitor"}; int ossmixer_init () { struct moddata_ossmixer *base = &modbase_ossmixer; static char devbuffer_mixer[STDBUFFERLEN]; int sid; base->mixerdev = devbuffer_mixer; base->keyvolup = KEY_VOLUMEUP; base->modvolup = MOD_NONE; base->keyvoldn = KEY_VOLUMEDOWN; base->modvoldn = MOD_NONE; base->keymute = KEY_MUTE; base->modmute = MOD_NONE; base->master = SOUND_MIXER_VOLUME; base->mixerdevmask = 1 << SOUND_MIXER_VOLUME; base->userdevmask = 0; base->volume = -1; base->flags.mute = 0; base->flags.mixer_delayed = 0; base->flags.init_complete = 0; base->flags.open = 0; devbuffer_mixer[0] = 0; if ((sid = registerCfgSection ("MODULE MIXER")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE MIXER"); return E_NOMEM; } else { /* options always to process */ registerCfgOptionString (sid, "OSS_Device", TAG_MIXERDEVICE, 0, NULL); registerCfgOptionString (sid, "OSS_Channels", TAG_MIXERCHANNELS, 0, NULL); registerCfgOptionString (sid, "dev_Mixer", TAG_MIXERDEVICE, FLG_RONLY, NULL); registerCfgOptionString (sid, "MixerChannels", TAG_MIXERCHANNELS, FLG_RONLY, NULL); /* options only to process if this module is active (open) */ registerCfgOptionInt (sid, "Volume", TAG_VOLUME, 0, N_("initial volume level")); registerCfgOptionBool (sid, "Speakers_muted", TAG_MUTE, 0, N_("mute after startup?")); registerCfgOptionKey (sid, "VolumeUpKey", TAG_VOLUMEUPKEY, TAG_VOLUMEUPMOD, 0, NULL); registerCfgOptionKey (sid, "VolumeDownKey", TAG_VOLUMEDOWNKEY, TAG_VOLUMEDOWNMOD, 0, NULL); registerCfgOptionKey (sid, "MuteKey", TAG_MUTEKEY, TAG_MUTEMOD, 0, NULL); registerCfgOptionBool (sid, "MixerInitDelay", TAG_MIXERINITDELAY, 0, NULL); } register_function (QUERYQUEUE, ossmixer_query); register_function (CONFIGQUEUE, ossmixer_configure); return 0; } int ossmixer_open (struct tagitem *taglist) { struct moddata_ossmixer *base = &modbase_ossmixer; char *devname; int rc; devname = (char *) tagfind (taglist, TAG_MIXERDEVICE, (long) DEFAULT_MIXER); if ((rc = copy_path (devname, base->mixerdev, TYPE_CHARDEV, CPFLG_MAYBEMISSED))) return rc; ossmixer_setuserdevmask ((char *) tagfind (taglist, TAG_MIXERCHANNELS, (long) "volume")); if ((base->flags.mixer_delayed = tagfind (taglist, TAG_MIXERINITDELAY, 0)) == 0) if (ossmixer_finish_init () == -1) return E_NOSUPPORT; if (!base->flags.init_complete) { /* can't set volume with only partly initialized mixer */ tagskip (taglist, TAG_VOLUME); tagskip (taglist, TAG_MUTE); } base->flags.open = 1; register_function (KBDQUEUE, ossmixer_keyboard); return 0; } int ossmixer_finish_init () { struct moddata_ossmixer *base = &modbase_ossmixer; int fd, devmask; if ((fd = open(base->mixerdev, O_RDWR)) >= 0) { /* open mixer device */ if ((base->volume = get_volume(fd, base->master)) != -1) { if ((devmask = get_mixer_devmask(fd)) != -1) base->mixerdevmask = devmask; else { base->mixerdevmask = 1 << SOUND_MIXER_VOLUME; print_msg (PBB_WARN, _("Can't get devmask from mixer [%s]; using default.\n"), base->mixerdev); } base->flags.init_complete = 1; /* mixer setup completed */ close (fd); return 0; } print_msg (PBB_ERR, _("Can't get volume of master channel [%s].\n"), mixerchannels[base->master]); close(fd); } else if (base->flags.mixer_delayed == 0) print_msg (PBB_ERR, _("Can't open mixer device [%s]. %s\n"), base->mixerdev, strerror(errno)); return -1; } int ossmixer_close () { struct moddata_ossmixer *base = &modbase_ossmixer; base->flags.open = 0; return 0; } int ossmixer_exit () { return 0; } /* ---- */ void ossmixer_keyboard (struct tagitem *taglist) { struct moddata_ossmixer *base = &modbase_ossmixer; int code, value, mod, step; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value) { if ((code == base->keyvolup) && ((mod & ~MOD_SHIFT) == base->modvolup)) { step = (mod & MOD_SHIFT) ? +1 : +10; } else if ((code == base->keyvoldn) && ((mod & ~MOD_SHIFT) == base->modvoldn)) { step = (mod & MOD_SHIFT) ? -1 : -10; } else if ((code == base->keymute) && (mod == base->modmute) && (value == 1)) { step = 0; } else return; ossmixer_set_and_send (step); } } void ossmixer_query (struct tagitem *taglist) { ossmixer_handle_tags (MODE_QUERY, taglist); } void ossmixer_configure (struct tagitem *taglist) { ossmixer_handle_tags (MODE_CONFIG, taglist); } void ossmixer_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_ossmixer *base = &modbase_ossmixer; int err; while (taglist->tag != TAG_END) { /* tags that would always be processed even if this module was closed */ switch (taglist->tag) { case TAG_MIXERDEVICE: if (cfgure) { if ((err = copy_path ((char *) taglist->data, base->mixerdev, TYPE_CHARDEV, CPFLG_MAYBEMISSED))) tagerror (taglist, err); } else taglist->data = (long) base->mixerdev; break; case TAG_MIXERCHANNELS: if (cfgure) ossmixer_setuserdevmask ((char *) taglist->data); else taglist->data = (long) ossmixer_getuserdevmask(base->userdevmask); /* else taglist->data = (long) ossmixer_getuserdevmask(base->userdevmask & base->mixerdevmask);*/ break; } /* tags that will be processed only if the module is open. */ if (base->flags.open) { switch (taglist->tag) { case TAG_VOLUME: if (cfgure) { if ((taglist->data - base->volume) != 0) ossmixer_set_and_send (taglist->data - base->volume); } else taglist->data = base->volume; break; case TAG_MUTE: if (cfgure) { if (base->flags.mute != taglist->data) ossmixer_set_and_send (0); } else taglist->data = base->flags.mute; break; } } /* tags that could be configured even if the module is closed but only be * read if the module is open. */ if (cfgure || base->flags.open) { switch (taglist->tag) { case TAG_VOLUMEUPKEY: if (cfgure) base->keyvolup = taglist->data; else taglist->data = base->keyvolup; break; case TAG_VOLUMEUPMOD: if (cfgure) base->modvolup = taglist->data; else taglist->data = base->modvolup; break; case TAG_VOLUMEDOWNKEY: if (cfgure) base->keyvoldn = taglist->data; else taglist->data = base->keyvoldn; break; case TAG_VOLUMEDOWNMOD: if (cfgure) base->modvoldn = taglist->data; else taglist->data = base->modvoldn; break; case TAG_MUTEKEY: if (cfgure) base->keymute = taglist->data; else taglist->data = base->keymute; break; case TAG_MUTEMOD: if (cfgure) base->modmute = taglist->data; else taglist->data = base->modmute; break; case TAG_MIXERINITDELAY: if (cfgure) base->flags.mixer_delayed = taglist->data; else taglist->data = base->flags.mixer_delayed; break; } } taglist++; } } void ossmixer_setuserdevmask (char *channels) { struct moddata_ossmixer *base = &modbase_ossmixer; char *token, buffer[200]; int n; base->userdevmask = 0; strncpy (buffer, channels, 200); cleanup_buffer (buffer); if ((token = strtok(buffer, ",\n"))) do { for (n=COUNT_MIXERCHANNELS -1; n >= 0; n--) if (!strcasecmp (mixerchannels[n], token)) { if (base->userdevmask == 0) base->master = n; /* first channel in list becomes master */ base->userdevmask |= 1 << n; break; } } while ((token = strtok(0,",\n")) != NULL); } char* ossmixer_getuserdevmask (int devmask) { static char channels[200]; int n; channels[0] = 0; for (n=0; n < COUNT_MIXERCHANNELS; n++) { if ((devmask >> n & 1) == 1) { if (channels[0] != 0) strcat(channels, ", "); strcat (channels, mixerchannels[n]); } } return channels; } int ossmixer_set_and_send (int increment) { struct moddata_ossmixer *base = &modbase_ossmixer; int volume; if ((volume = increment_master_volume (increment)) != -1) { set_slaves_volume (); singletag_to_clients (CHANGEVALUE, base->flags.mute ? TAG_MUTE : TAG_VOLUME, volume); } return volume; } /* This function increases, decreases or mute/unmute sound channels. It opens the mixer devices as long as it is needed. The volume level is tracked internal and only syncronized time by time with the hardware volume level to take external mixer adjustments into account. If everything was alright the new volume level would be returned. If the mixer device could not be opened the function will return -1 without changing the internal volume level. If the mixer isn't already set up, this function will do it. */ int increment_master_volume(int increment) { struct moddata_ossmixer *base = &modbase_ossmixer; int volume = base->volume; int fd; if (base->flags.init_complete == 0) /* is mixer setup already completed? */ if ((ossmixer_finish_init ()) != 0) /* no, then do it now */ return volume; /* Oops, try it again later */ if ((fd = open(base->mixerdev, O_RDWR)) >= 0) { /* open mixer device */ if ((volume = get_volume(fd, base->master)) != -1) { if ((volume != 0) && (base->flags.mute)) /* someone else increased volume? */ base->flags.mute = 0; /* so we can't stay muted. */ if (base->flags.mute == 0) if ((base->volume < volume - VOLUME_FR) || (base->volume > volume + VOLUME_FR)) /* someone else changed volume */ base->volume = volume; /* so we must sychonize our volume level */ } volume = base->volume + increment; if (volume > VOLUME_MAX) volume = VOLUME_MAX; if (volume < VOLUME_MIN) volume = VOLUME_MIN; if (increment != 0) { /* volume should be increased/decreased? */ base->volume = volume; /* store new volume level */ base->flags.mute = 0; /* unmute channels */ } else { if (base->flags.mute == 0) { /* channels not already muted? */ volume = 0; base->flags.mute = 1; /* channels are muted. */ } else { volume = base->volume; /* set former volume level again */ base->flags.mute = 0; /* unmute channels */ } } set_volume(fd, base->master, volume); close(fd); } else volume = -1; return volume; } /* This function sets the volume level of every slave to the same level as the master. If the mixer device couldn't be opened, nothing would be done. */ void set_slaves_volume () { struct moddata_ossmixer *base = &modbase_ossmixer; int volume = (base->flags.mute ? 0 : base->volume); int n, fd, devmask; devmask = base->userdevmask & base->mixerdevmask; if ((fd = open(base->mixerdev, O_RDWR)) >= 0) { /* open mixer device */ for (n=0; n < COUNT_MIXERCHANNELS; n++) if ((devmask >> n & 1) == 1) set_volume (fd, n, volume); close(fd); } } /* This function sets a channel's volume level */ int set_volume(int fd, int channel, int volume) { volume += 256*volume; if (ioctl (fd, MIXER_WRITE(channel), &volume) >= 0) return (volume & 255); return -1; } /* This function asks the mixer for a channel's volume level It returns the average volume of the left and right channel */ int get_volume(int fd, int channel) { int volume; if (ioctl (fd, MIXER_READ(channel), &volume) >= 0) return ((volume & 255) + ((volume >> 8) & 255)) >> 1; return -1; } /* This function asks the mixer which sound channels it supports */ int get_mixer_devmask(int fd) { int devmask; if (ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devmask) >= 0) return devmask; return -1; } #endif /* WITH_OSS */ pbbuttonsd-0.7.9/src/module_ossmixer.h0000644000175000017500000000346010217517064015020 00000000000000#ifndef INCLUDE_MODULE_OSSMIXER_H #define INCLUDE_MODULE_OSSMIXER_H /* ---------------------------------------------------------------------------- * module_ossmixer.h * prototypes and definitions for the OSS mixer module. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define DEFAULT_MIXER "/dev/mixer" #define VOLUME_MAX 100 #define VOLUME_MIN 0 #define VOLUME_FR 6 /* volume failure range defines */ /* how wide the hardware volume level */ /* is allowed to jitter without adjustment */ struct modflags_ossmixer { unsigned int mixer_delayed:1; unsigned int init_complete:1; unsigned int mute:1; unsigned int open:1; /* module open ? */ unsigned int:0; }; /* public prototypes */ int ossmixer_init (); int ossmixer_open (struct tagitem *taglist); int ossmixer_close (); int ossmixer_exit (); /* private prototypes */ int ossmixer_finish_init (); void ossmixer_keyboard (struct tagitem *taglist); void ossmixer_query (struct tagitem *taglist); void ossmixer_configure (struct tagitem *taglist); void ossmixer_handle_tags (int cfgure, struct tagitem *taglist); int ossmixer_set_and_send (int increment); int increment_master_volume(int increment); void set_slaves_volume (); int set_volume(int fd, int channel, int volume); int get_volume(int fd, int channel); int get_mixer_devmask(int fd); void ossmixer_setuserdevmask (char *channels); char* ossmixer_getuserdevmask (int devmask); #endif /* INCLUDE_MODULE_OSSMIXER_H */ pbbuttonsd-0.7.9/src/module_alsamixer.c0000644000175000017500000003622010460456322015126 00000000000000/* -------------------------------------------------------------------------- * module_alsamixer.c * code for the ALSA mixer module, controling volume levels * * Copyright 2004 John Steele Scott * Copyright 2002 Matthias Grimm * Copyright 1999-2000 by Jaroslav Kysela * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_ALSA #include #include "pbbinput.h" #include #include #include "gettext_macros.h" #include "input_manager.h" #include "config_manager.h" #include "module_mixer.h" #include "module_alsamixer.h" #include "support.h" struct moddata_alsamixer { char *card; /* name of the soundcard (usually "default" is fine) */ char *channels; /* the "MixerChannels" config string */ unsigned short keyvolup; unsigned short modvolup; unsigned short keyvoldn; unsigned short modvoldn; unsigned short keymute; unsigned short modmute; unsigned int init_complete; unsigned int mixer_delayed; unsigned int mute; unsigned int open; snd_mixer_t *mixer; snd_mixer_elem_t **elements; /* points to a NULL terminated list, first is master */ } modbase_alsamixer; int alsamixer_init () { struct moddata_alsamixer *base = &modbase_alsamixer; static char devbuffer_mixer[STDBUFFERLEN]; static char mixer_channels[STDBUFFERLEN]; int sid; base->card = devbuffer_mixer; base->channels = mixer_channels; base->elements = NULL; base->mixer = NULL; base->keyvolup = KEY_VOLUMEUP; base->modvolup = MOD_NONE; base->keyvoldn = KEY_VOLUMEDOWN; base->modvoldn = MOD_NONE; base->keymute = KEY_MUTE; base->modmute = MOD_NONE; base->mixer_delayed = 0; base->init_complete = 0; base->open = 0; if ((sid = registerCfgSection ("MODULE MIXER")) == 0) { print_msg (PBB_ERR, _("Can't register configuration section %s, out of memory."), "MODULE MIXER"); return E_NOMEM; } else { /* options always to process */ registerCfgOptionString (sid, "ALSA_Card", TAG_MIXERCARD, 0, NULL); registerCfgOptionString (sid, "ALSA_Elements", TAG_MIXERELEMENTS, 0, NULL); registerCfgOptionString (sid, "MixerCard", TAG_MIXERCARD, FLG_RONLY, NULL); /* options only to process if this module is active (open) */ registerCfgOptionInt (sid, "Volume", TAG_VOLUME, 0, N_("initial volume level")); registerCfgOptionBool (sid, "Speakers_muted", TAG_MUTE, 0, N_("mute after startup?")); registerCfgOptionKey (sid, "VolumeUpKey", TAG_VOLUMEUPKEY, TAG_VOLUMEUPMOD, 0, NULL); registerCfgOptionKey (sid, "VolumeDownKey", TAG_VOLUMEDOWNKEY, TAG_VOLUMEDOWNMOD, 0, NULL); registerCfgOptionKey (sid, "MuteKey", TAG_MUTEKEY, TAG_MUTEMOD, 0, NULL); registerCfgOptionBool (sid, "MixerInitDelay", TAG_MIXERINITDELAY, 0, NULL); } register_function (QUERYQUEUE, alsamixer_query); register_function (CONFIGQUEUE, alsamixer_configure); return 0; } int alsamixer_exit () { return 0; } /* initialise the list of elements, based on the "channels" string */ static int alsamixer_setup_elements_internal (char * channels, snd_mixer_selem_id_t *sid) { struct moddata_alsamixer *base = &modbase_alsamixer; char *token; char buffer[STDBUFFERLEN]; int n; /* get rid of old list */ if (base->elements) { free (base->elements); base->elements = NULL; } base->init_complete = 0; n = 0; /* this copy we save for returning in alsamixer_handle_tags */ if (base->channels != channels) /* don't copy base->channels on top of itself */ strncpy (base->channels, channels, STDBUFFERLEN); /* this copy we use for strtok */ strncpy (buffer, channels, STDBUFFERLEN); cleanup_buffer (buffer); if ((token = strtok(buffer, ",\n"))) { do { /* ensure we have enough memory to store pointer + terminator */ base->elements = realloc (base->elements, (n+2)*sizeof (snd_mixer_elem_t *)); if (base->elements == NULL) { print_msg (PBB_ERR, _("Memory allocation failed.\n")); return -1; } /* find element */ for (base->elements[n] = snd_mixer_first_elem (base->mixer); base->elements[n] != NULL; base->elements[n] = snd_mixer_elem_next (base->elements[n])) { snd_mixer_selem_get_id (base->elements[n], sid); if (strcasecmp (snd_mixer_selem_id_get_name (sid), token) == 0) break; } if (base->elements[n] == NULL) { /* report any element we can't find */ print_msg (PBB_WARN, _("Card '%s' has no '%s' element.\n"), base->card, token); } else { n++; } } while ((token = strtok(0,",\n")) != NULL); /* terminate list */ base->elements[n] = NULL; /* check that we have a master element */ if (!base->elements[0]) { print_msg (PBB_WARN, _("Option 'ALSA_Elements' contains no valid elements\n")); return -1; } /* check that master element has a playback volume */ if (!snd_mixer_selem_has_playback_volume (base->elements[0])) { snd_mixer_selem_get_id (base->elements[0], sid); print_msg (PBB_WARN, _("Mixer element '%s' has no playback volume control.\n"), snd_mixer_selem_id_get_name (sid)); return -1; } base->init_complete = 1; return 0; } else { /* no tokens? */ return -1; } } /* wrapper arround alsamixer_setup_elements_internal so we can be sure to free the sid. */ static int alsamixer_setup_elements (char * channels) { snd_mixer_selem_id_t *sid; int err, result; /* create a selem_id to extract names from */ if ((err = snd_mixer_selem_id_malloc (&sid))){ print_msg (PBB_ERR, _("Memory allocation failed: %s\n"), snd_strerror (err)); return -1; } result = alsamixer_setup_elements_internal (channels, sid); snd_mixer_selem_id_free (sid); return result; } static int alsamixer_finish_init () { struct moddata_alsamixer *base = &modbase_alsamixer; snd_mixer_t *mixer; int err; /* setup mixer */ if ((err = snd_mixer_open (&mixer, 0)) < 0) { print_msg (PBB_ERR, _("Can't open card '%s': %s\n"), base->card, snd_strerror (err)); return -1; } if ((err = snd_mixer_attach (mixer, base->card)) < 0) { print_msg (PBB_ERR, _("Can't attach card '%s': %s\n"), base->card, snd_strerror (err)); snd_mixer_close (mixer); return -1; } if ((err = snd_mixer_selem_register (mixer, NULL, NULL)) < 0) { print_msg (PBB_ERR, _("Can't register mixer: %s\n"), snd_strerror (err)); snd_mixer_detach (mixer, base->card); snd_mixer_close (mixer); return -1; } if ((err = snd_mixer_load (mixer)) < 0) { print_msg (PBB_ERR, _("Can't load card '%s': %s\n"), base->card, snd_strerror (err)); snd_mixer_detach (mixer, base->card); snd_mixer_close (mixer); return -1; } base->mixer = mixer; return alsamixer_setup_elements (base->channels); } /* Converts an ALSA volume to a number in the range [0, +/-100]. This function * assumes that the mixer has already been setup successfully. */ static int alsamixer_vol_to_percentage (snd_mixer_elem_t * elem, long volume) { long volmin, volmax; int pct; snd_mixer_selem_get_playback_volume_range (elem, &volmin, &volmax); pct = volmax == volmin ? 0 : rint(volume*100.0/(volmax-volmin)); if (pct > 100) pct = 100; if (pct < 0) pct = 0; return pct; } /* Converts a number in the range [0, +/-100] to an ALSA volume. This function * assumes that the mixer has already been setup successfully. */ static long alsamixer_percentage_to_vol (snd_mixer_elem_t * elem, int pct) { long volmin, volmax; snd_mixer_selem_get_playback_volume_range (elem, &volmin, &volmax); return rint((volmax-volmin)*pct/100.0); } /* Saves the current mute status in base->mute, and returns the volume of the first playback channel of the master element */ static int alsamixer_get_volume () { struct moddata_alsamixer *base = &modbase_alsamixer; long volume; int mute; if (base->init_complete == 0) /* is mixer setup already completed? */ if ((alsamixer_finish_init ()) != 0) /* no, then do it now */ return -1; /* Oops, try it again later */ /* force simple mixer to update its values from audio driver */ snd_mixer_handle_events (base->mixer); /* read values */ snd_mixer_selem_get_playback_switch (base->elements[0], 0, &mute); snd_mixer_selem_get_playback_volume (base->elements[0], 0, &volume); base->mute = !mute; return volume; } /* same as alsamixer_get_volume, but returns the volume as number between 0 and 100 */ static int alsamixer_get_volume_as_percentage () { struct moddata_alsamixer *base = &modbase_alsamixer; int volume; volume = alsamixer_get_volume (); return volume < 0 ? volume : alsamixer_vol_to_percentage (base->elements[0], volume); } static void alsamixer_set_and_send (enum alsainc type, int value) { struct moddata_alsamixer *base = &modbase_alsamixer; long master = 0, vol, min, max; int n; if (base->init_complete == 0) /* is mixer setup already completed? */ if ((alsamixer_finish_init ()) != 0) /* no, then do it now */ return; /* Oops, try it again later */ base->mute = value ? 0 : !base->mute; /* cycle through elements */ for (n=0; base->elements[n] != NULL; n++) { /* sync playback switch */ snd_mixer_selem_set_playback_switch_all (base->elements[n], !base->mute); if (n == 0) { switch (type) { case ALSAMIXER_REL: snd_mixer_selem_get_playback_volume_range (base->elements[0], &min, &max); if (max > 100) value *= max/100 + 1; value += alsamixer_get_volume (); case ALSAMIXER_ABS: master = alsamixer_vol_to_percentage (base->elements[0], value); break; case ALSAMIXER_REL_PERCENT: value += alsamixer_get_volume_as_percentage (); case ALSAMIXER_ABS_PERCENT: if (value > 100) value = 100; if (value < 0) value = 0; master = value; break; } } /* sync volume with master element, if not muted */ if (!base->mute && snd_mixer_selem_has_playback_volume (base->elements[n])) { vol = alsamixer_percentage_to_vol (base->elements[n], master); snd_mixer_selem_set_playback_volume_all (base->elements[n], vol); } } if (base->mute) singletag_to_clients (CHANGEVALUE, TAG_MUTE, 0); else singletag_to_clients (CHANGEVALUE, TAG_VOLUME, master); } void alsamixer_handle_tags (int cfgure, struct tagitem *taglist) { struct moddata_alsamixer *base = &modbase_alsamixer; char *cardname, *elements; while (taglist->tag != TAG_END) { /* tags that would always be processed even if this module is not open */ switch (taglist->tag) { case TAG_MIXERCARD: if (cfgure) { cardname = (char *) taglist->data; if (strlen (cardname) < STDBUFFERLEN) { strcpy (base->card, cardname); alsamixer_close (); /* reinit mixer with next use */ } else { print_msg (PBB_ERR, _("ALSA Card name too long. Buffer overflow\n")); tagerror (taglist, E_BUFOVL); } } else taglist->data = (long) base->card; break; case TAG_MIXERELEMENTS: if (cfgure) { elements = (char *) taglist->data; if (strlen (elements) < STDBUFFERLEN) { strcpy (base->channels, elements); alsamixer_close (); /* reinit mixer with next use */ } else { print_msg (PBB_ERR, _("Too much ALSA elements given. Buffer overflow.\n")); tagerror (taglist, E_BUFOVL); } } else taglist->data = (long) base->channels; break; } /* tags that will be processed only if the module is open. */ if (base->open) { switch (taglist->tag) { case TAG_VOLUME: if (cfgure) alsamixer_set_and_send (ALSAMIXER_ABS_PERCENT, taglist->data); else taglist->data = alsamixer_get_volume_as_percentage (); break; case TAG_MUTE: if (cfgure) { if (base->mute != taglist->data) alsamixer_set_and_send (ALSAMIXER_REL, 0); } else { /* update mute status */ alsamixer_get_volume (); taglist->data = base->mute; } break; } } /* tags that could be configured even the module is closed but only be read * if the module is open. */ if (cfgure || base->open) { switch (taglist->tag) { case TAG_VOLUMEUPKEY: if (cfgure) base->keyvolup = taglist->data; else taglist->data = base->keyvolup; break; case TAG_VOLUMEUPMOD: if (cfgure) base->modvolup = taglist->data; else taglist->data = base->modvolup; break; case TAG_VOLUMEDOWNKEY: if (cfgure) base->keyvoldn = taglist->data; else taglist->data = base->keyvoldn; break; case TAG_VOLUMEDOWNMOD: if (cfgure) base->modvoldn = taglist->data; else taglist->data = base->modvoldn; break; case TAG_MUTEKEY: if (cfgure) base->keymute = taglist->data; else taglist->data = base->keymute; break; case TAG_MUTEMOD: if (cfgure) base->modmute = taglist->data; else taglist->data = base->modmute; break; case TAG_MIXERINITDELAY: if (cfgure) base->mixer_delayed = taglist->data; else taglist->data = base->mixer_delayed; break; } } taglist++; } } int alsamixer_open (struct tagitem *taglist) { struct moddata_alsamixer *base = &modbase_alsamixer; char *cardname, *channels; cardname = (char *) tagfind (taglist, TAG_MIXERCARD, (long) "default"); if (strlen (cardname) < STDBUFFERLEN) strncpy (base->card, cardname, STDBUFFERLEN); else return E_BUFOVL; channels = (char *) tagfind (taglist, TAG_MIXERELEMENTS, (long) "Master"); if (strlen (channels) < STDBUFFERLEN) strncpy (base->channels, channels, STDBUFFERLEN); else return E_BUFOVL; if ((base->mixer_delayed = tagfind (taglist, TAG_MIXERINITDELAY, 0)) == 0) if (alsamixer_finish_init () == -1) return E_NOSUPPORT; if (!base->init_complete) { /* can't set volume with only partly initialized mixer */ tagskip (taglist, TAG_VOLUME); tagskip (taglist, TAG_MUTE); } base->open = 1; register_function (KBDQUEUE, alsamixer_keyboard); return 0; } int alsamixer_close () { struct moddata_alsamixer *base = &modbase_alsamixer; if (base->elements) { free (base->elements); base->elements = NULL; } if (base->mixer) { snd_mixer_detach (base->mixer, base->card); snd_mixer_close (base->mixer); base->mixer = NULL; } base->init_complete = 0; /* base->open = 0; */ return 0; } void alsamixer_keyboard (struct tagitem *taglist) { struct moddata_alsamixer *base = &modbase_alsamixer; int code, value, mod, step; code = (int) tagfind (taglist, TAG_KEYCODE, 0); value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); mod = (int) tagfind (taglist, TAG_MODIFIER, 0); if (value) { if ((code == base->keyvolup) && ((mod & ~MOD_SHIFT) == base->modvolup)) { step = (mod & MOD_SHIFT) ? +1 : +10; } else if ((code == base->keyvoldn) && ((mod & ~MOD_SHIFT) == base->modvoldn)) { step = (mod & MOD_SHIFT) ? -1 : -10; } else if ((code == base->keymute) && (mod == base->modmute) && (value == 1)) { step = 0; } else return; if ((step == 0) || (mod & MOD_SHIFT)) alsamixer_set_and_send(ALSAMIXER_REL, step); /* mute and fine tuning */ else alsamixer_set_and_send(ALSAMIXER_REL_PERCENT, step); /* normal control */ } } void alsamixer_query (struct tagitem *taglist) { alsamixer_handle_tags (MODE_QUERY, taglist); } void alsamixer_configure (struct tagitem *taglist) { alsamixer_handle_tags (MODE_CONFIG, taglist); } #endif /* WITH_ALSA */ pbbuttonsd-0.7.9/src/module_alsamixer.h0000644000175000017500000000213710262022506015124 00000000000000#ifndef INCLUDE_MODULE_ALSAMIXER_H #define INCLUDE_MODULE_ALSAMIXER_H /* ---------------------------------------------------------------------------- * module_alsamixer.h * prototypes and definitions for the ALSA mixer module. * * Copyright 2004 John Steele Scott * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include enum alsainc { ALSAMIXER_REL, ALSAMIXER_REL_PERCENT, ALSAMIXER_ABS, ALSAMIXER_ABS_PERCENT }; /* public prototypes */ int alsamixer_init (); int alsamixer_open (struct tagitem *taglist); int alsamixer_close (); int alsamixer_exit (); /* private prototypes */ void alsamixer_keyboard (struct tagitem *taglist); void alsamixer_query (struct tagitem *taglist); void alsamixer_configure (struct tagitem *taglist); #endif /* INCLUDE_MODULE_ALSAMIXER_H */ pbbuttonsd-0.7.9/src/class_backlight.c0000644000175000017500000000561110507673433014717 00000000000000/* -------------------------------------------------------------------------- * module_backlight.c * This module contains the class backlight which will define the interface * to a LCD backlight controller. Below the module are the backlight drivers * which implement the interface to the specific hardware or kernel interface. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include "systems.h" #include #include "gettext_macros.h" #include "input_manager.h" #include "class_backlight.h" #include "driver_backlight_pmu.h" #include "driver_backlight_sysfs.h" struct class_backlight { struct driver_backlight *driver; } modbase_backlight; int backlight_init () { struct class_backlight *base = &modbase_backlight; base->driver = NULL; register_function (QUERYQUEUE, backlight_query); register_function (CONFIGQUEUE, backlight_config); } int backlight_open (struct tagitem *taglist) { struct class_backlight *base = &modbase_backlight; if (!base->driver) base->driver = driver_backlight_sysfs_init (taglist); if (!base->driver) base->driver = driver_backlight_pmu_init (taglist); if (base->driver) print_msg (PBB_INFO, _("Initialized: %s\n"), _(base->driver->name)); else print_msg (PBB_WARN, _("No backlight driver available - check your Kernel configuration.\n")); return 0; } int backlight_close () { struct class_backlight *base = &modbase_backlight; if (base->driver) base->driver->driver_exit(); return 0; } int backlight_exit () { return 0; } void backlight_query (struct tagitem *taglist) { backlight_handle_tags (MODE_QUERY, taglist); } void backlight_config (struct tagitem *taglist) { backlight_handle_tags (MODE_CONFIG, taglist); } void backlight_handle_tags (int cfgure, struct tagitem *taglist) { struct class_backlight *base = &modbase_backlight; if (!base->driver) return; while (taglist->tag != TAG_END) { switch (taglist->tag) { case TAG_BACKLIGHTMAX: /* private tag */ if (cfgure) ; else taglist->data = base->driver->get_brightness_max(); break; /* The following construct is necessary to allow the module_pmac to slip * between the original caller and the hardware processing function. It is * really a hack but there is no other way with the current program structure * of pbbuttonsd. */ #ifndef WITH_MODULE_PMAC case TAG_BACKLIGHTLEVEL: /* private tag */ #endif case TAG_HW_BACKLIGHT: /* private tag */ if (cfgure) base->driver->set_brightness(taglist->data); else taglist->data = base->driver->get_brightness(); break; } taglist++; } } pbbuttonsd-0.7.9/src/class_backlight.h0000644000175000017500000000223710506750435014722 00000000000000#ifndef INCLUDE_CLASS_BACKLIGHT_H #define INCLUDE_CLASS_BACKLIGHT_H /* ---------------------------------------------------------------------------- * class_backlight.h * prototypes and definitions for the class backlight. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include struct driver_backlight { char *name; int (*get_brightness)(); int (*get_brightness_max)(); void (*set_brightness)(); void (*driver_exit)(); }; /* public prototypes class backlight*/ int backlight_init (); int backlight_open (struct tagitem *taglist); int backlight_close (); int backlight_exit (); /* private prototypes class backlight */ void backlight_query (struct tagitem *taglist); void backlight_config (struct tagitem *taglist); void backlight_handle_tags (int cfgure, struct tagitem *taglist); #endif /* INCLUDE_CLASS_BACKLIGHT_H */ pbbuttonsd-0.7.9/src/driver_backlight_sysfs.c0000644000175000017500000000710210507202572016321 00000000000000/* -------------------------------------------------------------------------- * driver_backlight_sysfs.c * This module contains the low level driver to control a LCD backlight via * /sys/class/backlight. The low level driver overloads methods of class * backlight. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "class_backlight.h" #include "driver_backlight_sysfs.h" #include "debug.h" /** Driver SysFS Backlight Interface **/ /* This driver uses the new kernel backlight interface introduced in kernel * version 2.6.18. It won't work on earlier kernels. * * It is also recommended to compile the kernel *wihtout* the kernel option * CONFIG_PMAC_BACKLIGHT_LEGACY to prevent conflicts with ancient kernel * features controlling the backlight. */ static GString *sysfs_backlight_path; void driver_backlight_sysfs_exit () { g_string_free (sysfs_backlight_path, TRUE); } int sysfsbl_get_brightness () { GString *var; FILE *fd; int brightness = -1; char buffer[5]; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/brightness"); if ((fd = fopen(var->str, "r")) >= 0) { fgets(buffer, sizeof(buffer), fd); buffer[4] = 0; /* to be safe, terminate the buffer */ brightness = atoi (buffer); fclose(fd); } g_string_free (var, TRUE); return brightness; } int sysfsbl_get_brightness_max () { GString *var; FILE *fd; int max_brightness = -1; char buffer[5]; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/max_brightness"); if ((fd = fopen(var->str, "r")) >= 0) { fgets(buffer, sizeof(buffer), fd); buffer[4] = 0; /* to be safe, terminate the buffer */ max_brightness = atoi (buffer); fclose(fd); } g_string_free (var, TRUE); return max_brightness; } void sysfsbl_set_brightness (int val) { GString *var; FILE *fd; char buffer[5]; if (val > 255) return; var = g_string_new (sysfs_backlight_path->str); var = g_string_append (var, "/brightness"); sprintf(buffer, "%d\n", val); if ((fd = fopen(var->str, "w")) >= 0) { fputs(buffer, fd); fclose(fd); } g_string_free (var, TRUE); } static struct driver_backlight driver_backlight_sysfs = { .name = N_("SysFS Backlight Driver"), .get_brightness = sysfsbl_get_brightness, .get_brightness_max = sysfsbl_get_brightness_max, .set_brightness = sysfsbl_set_brightness, .driver_exit = driver_backlight_sysfs_exit }; struct driver_backlight * driver_backlight_sysfs_init (struct tagitem *taglist) { DIR *dh; struct dirent *dir; sysfs_backlight_path = g_string_new ("/sys/class/backlight"); if ((dh = opendir(sysfs_backlight_path->str))) { while ((dir = readdir(dh))) { if (dir->d_name[0] == '.') continue; if (g_str_has_suffix(dir->d_name, "bl0") || g_str_has_suffix(dir->d_name, "bl")) { g_string_append_printf (sysfs_backlight_path, "/%s", dir->d_name); #if defined(DEBUG) print_msg (PBB_INFO, "DBG: SysFS Backlight Path: %s\n", sysfs_backlight_path->str); #endif return &driver_backlight_sysfs; } } } return NULL; } pbbuttonsd-0.7.9/src/driver_backlight_sysfs.h0000644000175000017500000000150510506750371016333 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_SYSFS_H #define INCLUDE_DRIVER_BACKLIGHT_SYSFS_H /* ---------------------------------------------------------------------------- * driver_backlight_sysfs.h * prototypes and definitions for a low level backlight driver. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include /* public prototypes driver SysFS backlight */ struct driver_backlight *driver_backlight_sysfs_init (struct tagitem *taglist); #endif /* INCLUDE_DRIVER_BACKLIGHT_SYSFS_H */ pbbuttonsd-0.7.9/src/driver_backlight_pmu.c0000644000175000017500000000670310507673211015763 00000000000000/* -------------------------------------------------------------------------- * driver_backlight_pmu.c * This module contains the low level driver to control a LCD backlight via * the PMU. The low level driver overloads methods of class backlight. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "gettext_macros.h" #include "module_pmac.h" #include "class_backlight.h" #include "driver_backlight_pmu.h" #include "support.h" /** Driver PMU Backlight **/ /* To make this driver work under kernel versions > 2.6.18 the kernel * option CONFIG_PMAC_BACKLIGHT_LEGACY must be set. This option includes * some old ioctls for /dev/pmu that are needed here. For older kernels * it will work out of the box. * * Every frame buffer driver could register a backlight controller, * but only the right one is accepted. Verification is done by checking * OpenFirmware's property "backlight-control" in register_backlight_controller(). * ioctl(base->fd_pmu, PMU_IOC_GET_BACKLIGHT, &val); returns -ENODEV if no * backlight device is registered. This could be used to check if a backlight * controller is installed or if we have to call our fallback functions. * TODO: This is not implemented yet. */ static int pmu_filehandle; void driver_backlight_pmu_exit () { if (pmu_filehandle != -1) close (pmu_filehandle); } int pmubl_get_brightness () { long val = 0; if ((ioctl(pmu_filehandle, PMU_IOC_GET_BACKLIGHT, &val)) == -1) return -1; return (int) val; } int pmubl_get_brightness_max () { return PMUBRIGHTNESSMAX; } void pmubl_set_brightness (int val) { if (val != -1) ioctl(pmu_filehandle, PMU_IOC_SET_BACKLIGHT, &val); } static struct driver_backlight driver_backlight_pmu = { .name = N_("PMU Backlight Driver"), .get_brightness = pmubl_get_brightness, .get_brightness_max = pmubl_get_brightness_max, .set_brightness = pmubl_set_brightness, .driver_exit = driver_backlight_pmu_exit, }; struct driver_backlight * driver_backlight_pmu_init (struct tagitem *taglist) { char *devname; int pmu_version = 0, fd; long DUMMY = 0; devname = (char *) tagfind (taglist, TAG_PMUDEVICE, (long) DEFAULT_PMU); if ((copy_path (devname, NULL, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((pmu_filehandle = open(devname, O_RDWR)) < 0) { print_msg (PBB_ERR, _("Can't open PMU device %s: %s\n"), devname, strerror(errno)); return NULL; } } else return NULL; devname = (char *) tagfind (taglist, TAG_ADBDEVICE, (long) DEFAULT_ADB); if ((copy_path (devname, NULL, TYPE_CHARDEV, CPFLG_NONE)) == 0) { if ((fd = open(devname, O_RDWR)) >= 0) { pmu_version = get_pmu_version(fd); close (fd); } else print_msg (PBB_WARN, _("Can't open ADB device %s: %s\n"), devname, strerror(errno)); }; if ((ioctl(pmu_filehandle, PMU_IOC_GET_BACKLIGHT, &DUMMY)) == -1) return NULL; if (pmu_version > OHARE_PMU) ioctl(pmu_filehandle, PMU_IOC_GRAB_BACKLIGHT, &DUMMY); return &driver_backlight_pmu; } pbbuttonsd-0.7.9/src/driver_backlight_pmu.h0000644000175000017500000000171410506750266015772 00000000000000#ifndef INCLUDE_DRIVER_BACKLIGHT_PMU_H #define INCLUDE_DRIVER_BACKLIGHT_PMU_H /* ---------------------------------------------------------------------------- * driver_backlight_pmu.h * prototypes and definitions for a low level backlight driver. * * Copyright 2002-2006 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #define PMUBRIGHTNESSMAX 15 /* from asm/backlight.h */ #ifndef PMU_IOC_GRAB_BACKLIGHT #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, 0) #endif /* public prototypes driver PMU backlight */ struct driver_backlight *driver_backlight_pmu_init (struct tagitem *taglist); #endif /* INCLUDE_DRIVER_BACKLIGHT_PMU_H */ pbbuttonsd-0.7.9/src/gettext_macros.h0000644000175000017500000000221710054126220014616 00000000000000#ifndef INCLUDE_GETTEXT_MACROS_H #define INCLUDE_GETTEXT_MACROS_H /* ---------------------------------------------------------------------------- * gettext:macros.h * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #ifdef ENABLE_NLS # include #endif /* Standard gettext macros */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif /* INCLUDE_GETTEXT_MACROS_H */ pbbuttonsd-0.7.9/src/pbbinput.h0000644000175000017500000000160510054126552013421 00000000000000#ifndef INCLUDE_PBBINPUT_H #define INCLUDE_PBBINPUT_H /* ---------------------------------------------------------------------------- * pbbinput.h * This includefile adds support for the brightnes keys * to the kernel input.h if they wasn't already supported. * This allows to compile pbbuttonsd on kernels before * 2.4.18-rc2-benh. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include #ifndef KEY_BRIGHTNESSUP #define KEY_BRIGHTNESSUP 225 #endif #ifndef KEY_BRIGHTNESSDOWN #define KEY_BRIGHTNESSDOWN 224 #endif #endif /* INCLUDE_PBBINPUT_H */ pbbuttonsd-0.7.9/src/ibam_stub.cpp0000644000175000017500000000337410344024330014074 00000000000000/* -------------------------------------------------------------------------- * ibam_stup.cpp * interface to integrate IBAM into pbbuttonsd * * Copyright 2005 Matthias Grimm * IBAM is Copyright by Sebastion Ritterbusch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_IBAM #include "debug.h" #if defined(DEBUG) && IBAM # define IBAM_DEBUG 1 #endif #define IBAM_VERSION "0.4" #include "ibam.hpp" extern "C" { static ibam *ObjIBAM = NULL; int ibam_init(const char *data_path) { int rc = 1; // SUCCESS if (!ObjIBAM) { // Object already created ? try { ObjIBAM = new ibam(data_path); } catch(...) { rc = 0; // ERROR } } return rc; } void ibam_exit() { if (ObjIBAM) { delete(ObjIBAM); ObjIBAM = NULL; } } void ibam_recordProfile() { static long lasttime = time(NULL); ObjIBAM->update(); if (ObjIBAM->valid()) { if (time(NULL) < lasttime+10) ObjIBAM->update_statistics(); else ObjIBAM->ignore_statistics(); lasttime = time(NULL); ObjIBAM->save(); } } int ibam_getBatteryTimeAdaptive() { if (!ObjIBAM->valid()) return 0; return (ObjIBAM->seconds_left_battery_adaptive() + ObjIBAM->seconds_battery_correction()+30)/60; } int ibam_getChargeTimeAdaptive() { if (!ObjIBAM->valid()) return 0; return (ObjIBAM->seconds_left_charge_adaptive() + ObjIBAM->seconds_charge_correction()+30)/60; } } /* extern "C" */ #endif /* WITH_IBAM */ pbbuttonsd-0.7.9/src/ibam_stub.h0000644000175000017500000000151210344024343013535 00000000000000#ifndef INCLUDE_IBAM_H #define INCLUDE_IBAM_H /* ---------------------------------------------------------------------------- * ibam_stub.h * prototypes and definitions for ibam integration. * * Copyright 2005 Matthias Grimm * IBAM is Copyright by Sebastion Ritterbusch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ /* prototypes */ int ibam_init(const char *data_path); void ibam_exit(); void ibam_recordProfile(); int ibam_getBatteryTimeAdaptive(); int ibam_getChargeTimeAdaptive(); #endif /* INCLUDE_IBAM_H */ pbbuttonsd-0.7.9/src/ibam.hpp0000644000175000017500000001304110344562274013052 00000000000000// IBAM, the Intelligent Battery Monitor // Copyright (C) 2001-2003, Sebastian Ritterbusch (IBAM@Ritterbusch.de) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #define IBAM_IGNORE_DATA_AFTER_X_SECONDS 3600 #define IBAM_MINIMAL_SECONDS_PER_PERCENT 10 #define IBAM_MAXIMAL_SECONDS_PER_PERCENT 800 #define IBAM_ASSUME_DEFAULT_BATTERY_MIN 120 #define IBAM_MAXIMAL_PROFILES 500 #include #include #include #include #include #include #include using namespace std; class battery_status { protected: int acLineStatus; int batteryStatus; int chargeStatus; int remainingBatteryPercent; int remainingBatteryLifeSeconds; string Path; public: inline int onBattery(void) const; inline int charging(void) const; inline int percent(void) const; inline int seconds(void) const; virtual inline void update(void) = 0; inline battery_status(string path); virtual inline ~battery_status(void); }; class apm_status : public battery_status { public: inline void update(void); inline apm_status(string path="/proc/apm"); }; class pmu_status : public battery_status { public: inline void update(void); inline pmu_status(string path="/proc/pmu"); }; class acpi_status : public battery_status { public: inline void update(void); inline acpi_status(string path="/proc/acpi"); }; class percent_data { private: int maxpercents; double *time_for_percent; double *time_deriv_for_percent; int *time_samples; inline void size_to(int newpercents); public: inline percent_data(void); inline ~percent_data(void); friend inline ostream & operator <<(ostream & o,const percent_data & a); inline double add_data(int percent,double time_for,int samples=1); inline double average(int a,int b); // average from a to b inline double average_derivation(int a,int b); // standard derivation from a to b inline double add_data(int percent,double time_for,double time_deriv_for,int samples=1); friend inline istream & operator >>(istream & i,percent_data &a); inline istream & import(istream & i); inline double remain(int percent); inline double inverted_remain(int percent); inline double total(void); }; class ibam { private: percent_data data; int data_changed; // 1 if save of ibam.rc demanded battery_status *apm; percent_data battery; int battery_loaded; int battery_changed; percent_data charge; int charge_loaded; int charge_changed; int profile_changed; unsigned long lasttime; int lastpercent; double lastratio; int lastratiocount; int laststatus; double last_sec_per_min; double last_sec_per_min_prediction; unsigned long currenttime; int currentpercent; int currentstatus; string home; int isvalid; int profile_logging; // 1 if cycle shall be logged for later analysis int profile_number; // number of profile (increased on each cycle change) int profile_active; // data has been written to current profile public: inline ibam(const char *); inline void import(void); inline void load_battery(void); inline void load_charge(void); inline void update_statistics(void); inline void ignore_statistics(void); inline void save(void); inline string profile_filename(int n,int type) const; inline int current_profile_number(void) const; inline int current_profile_type(void) const; inline void set_profile_logging(int); inline int profile_logging_setting(void) const; inline int seconds_left_battery_bios(void); inline int seconds_left_battery(void); inline int seconds_left_battery_adaptive(void); inline int percent_battery_bios(void); inline int percent_battery(void); inline int seconds_left_charge(void); inline int seconds_left_charge_adaptive(void); inline int percent_charge(void); inline int seconds_battery_total(void); inline int seconds_battery_total_adaptive(void); inline int seconds_charge_total(void); inline int seconds_charge_total_adaptive(void); inline int seconds_battery_correction(void); inline int seconds_charge_correction(void); inline int onBattery(void); inline int charging(void); inline int valid(void) const; inline void update(void); }; #include "ibam.inl" pbbuttonsd-0.7.9/src/ibam.inl0000644000175000017500000007510710345141651013051 00000000000000// IBAM, the Intelligent Battery Monitor // Copyright (C) 2001-2003, Sebastian Ritterbusch (IBAM@Ritterbusch.de) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #include #include #include #include #include #include #include #include #include #include // for acpi multiple batteries /* Arguments, with symbols from linux/apm_bios.h. Information is + from the Get Power Status (0x0a) call unless otherwise noted. + + 0) Linux driver version (this will change if format changes) + 1) APM BIOS Version. Usually 1.0 or 1.1. + 2) APM flags from APM Installation Check (0x00): + bit 0: APM_16_BIT_SUPPORT + bit 1: APM_32_BIT_SUPPORT + bit 2: APM_IDLE_SLOWS_CLOCK + bit 3: APM_BIOS_DISABLED + bit 4: APM_BIOS_DISENGAGED + 3) AC line status + 0x00: Off-line + 0x01: On-line + 0x02: On backup power (APM BIOS 1.1 only) + 0xff: Unknown + 4) Battery status + 0x00: High + 0x01: Low + 0x02: Critical + 0x03: Charging + 0xff: Unknown + 5) Battery flag + bit 0: High + bit 1: Low + bit 2: Critical + bit 3: Charging + bit 7: No system battery + 0xff: Unknown + 6) Remaining battery life (percentage of charge): + 0-100: valid + -1: Unknown + 7) Remaining battery life (time units): + Number of remaining minutes or seconds + -1: Unknown + 8) min = minutes; sec = seconds */ inline int battery_status::onBattery(void) const { return acLineStatus==0; } inline int battery_status::charging(void) const { return chargeStatus; } inline int battery_status::percent(void) const { return remainingBatteryPercent; } inline int battery_status::seconds(void) const { return remainingBatteryLifeSeconds; } inline battery_status::battery_status(string path) { Path = path; } inline battery_status::~battery_status(void) { } inline void battery_status::update(void) { cout << "battery_status::update() called. This should never happen!" << endl; } inline apm_status::apm_status(string path) : battery_status(path) { update(); } inline pmu_status::pmu_status(string path) : battery_status(path) { update(); } inline acpi_status::acpi_status(string path) : battery_status(path) { update(); } inline void apm_status::update(void) { ifstream in; int i; in.open(Path.c_str()); for(i=0;i<10 && in.fail();i++) in.open(Path.c_str()); if(in.fail()) { acLineStatus=0; batteryStatus=0; chargeStatus=0; remainingBatteryPercent=-1; remainingBatteryLifeSeconds=-1; return; } string driverVersion, biosVersion; int apmFlags, batteryFlag; char c,d; in >> driverVersion; in >> biosVersion; in >> c >> d; // 0x in >> c >> d; apmFlags=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; acLineStatus=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; batteryStatus=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); in >> c >> d; // 0x in >> c >> d; batteryFlag=(c>'9'?c-'a'+10:c-'0')*16+(d>'9'?d-'a'+10:d-'0'); chargeStatus = (batteryStatus&8)!=0; in >> remainingBatteryPercent >> c; // % string minsec; in >> remainingBatteryLifeSeconds >> minsec; if(minsec=="min") remainingBatteryLifeSeconds*=60; #ifdef IBAM_DEBUG cout << "Driver Version: " << driverVersion << endl; cout << "Bios Version: " << biosVersion << endl; cout << "APM Flags: " << apmFlags << endl; cout << "AC Line Status: " << acLineStatus << endl; cout << "Battery Status: " << batteryStatus << endl; cout << "Battery Flag: " << batteryFlag << endl; cout << "Remaining Percent: " << remainingBatteryPercent << endl; cout << "Remaining Seconds: " << remainingBatteryLifeSeconds << endl; #endif } // PMU File-format // // 2 batteries, running on battery // // /proc/pmu/info: // // PMU driver version : 2 // PMU firmware version : 0c // AC Power : 0 // Battery count : 2 // // 1) Note that there are systems where AC Power may falsely show 0 if the // computer booted without any batteries plugged in. The battery-flags // are reported to be more reliable in that case. // This is *not* yet taken into account by ibam. // // 2) The battery count only reflects the number of theoretically available // battery slots and not the number of batteries currently in the system. // // /proc/pmu/battery_0: // // flags : 00000011 // charge : 5788 // max_charge : 5789 // current : 0 // voltage : 12549 // time rem. : 0 // // /proc/pmu_battery_1: // // flags : 00000011 // charge : 518 // max_charge : 1112 // current : -1087 // voltage : 11324 // time rem. : 1715 // // case no battery: // // flags : 00000010 // charge : 0 // max_charge : 0 // current : 0 // voltage : 0 // time rem. : 0 // // 1) flags is to be read hexadeicmal (or binary perhaps?), bit 0 // denotes if this battery is present, bit 1 denotes reportingly // rather unreliable a charging state. // // 2) A positive current denotes charging more reliably. (unchecked) // This is *not* yet taken into account, because it's unclear how this // reading behaves with two batteries. // inline void pmu_status::update(void) { ifstream in; int i; in.open((Path+"/info").c_str()); if (in.fail()) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } stringbuf buf; char c; int d, cur_charge = 0, max_charge = 0; for (i = 0; i < 4; i++) { in.get(buf, ':'); in >> c >> d; if (i == 2) acLineStatus = d; } in.close(); in.open((Path+"/battery_0").c_str()); if (in.fail()) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } for (i = 0; i < 6; i++) { in.get(buf, ':'); in >> c >> d; if (i == 0) chargeStatus = (d&2)==0; if (i == 1) cur_charge = d; if (i == 2) max_charge = d; if (i == 5) remainingBatteryLifeSeconds = d; } in.close(); in.open((Path+"/battery_1").c_str()); if (in.fail()) { remainingBatteryPercent = (int)(cur_charge*100/max_charge); return; } for (i = 0; i < 6; i++) { in.get(buf, ':'); in >> c >> d; if (i == 0) chargeStatus = (d&2)==0; if (i == 1) cur_charge += d; if (i == 2) max_charge += d; if (i == 5) remainingBatteryLifeSeconds += d; } remainingBatteryPercent = (int)(cur_charge*100/max_charge); } // Acpi Percentage and Remaining time computation based upon // http://www.acpi.info/spec.htm V3.0 // // [...] // 3.9.3 Battery Gas Gauge // // At the most basic level, the OS calculates Remaining Battery // Percentage [%] using the following formula: // // Battery Remaining Capacity [mAh/mWh] // Remaining Battery Percentage [%] = ------------------------------------ * 100 // Last Full Charged Capacity [mAh/mWh] // // Control Method Battery also reports the Present Drain Rate [mA or mW] // for calculating the remaining battery life. At the most basic level, // Remaining Battery life is calculated by following formula: // // Battery Remaining Capacity [mAh/mWh] // Remaining Battery Life [h] = ------------------------------------ // Battery Present Drain Rate [mA/mW] // // Smart Batteries also report the present rate of drain, but since they // can directly report the estimated runtime, this function should be used // instead as it can more accurately account for variations specific to // the battery // [...] // // I don't have a "Smart Battery", so I don't know, how /proc/acpi would // report that. Contributions are greatly appreciated. // // See also http://www.tldp.org/HOWTO/ACPI-HOWTO/usingacpi.html // inline void acpi_status::update(void) { ifstream in; DIR *acpi_battery_dir; struct dirent *battery_entry; int i; acpi_battery_dir=opendir((Path+"/battery").c_str()); if (acpi_battery_dir==NULL) { acLineStatus = 0; chargeStatus = 0; remainingBatteryLifeSeconds = -1; remainingBatteryPercent = -1; return; } long total_capacity=0; long total_remain=0; long total_rate=0; while ((battery_entry=readdir(acpi_battery_dir))) { if(battery_entry->d_name!=string(".") && battery_entry->d_name!=string("..")) { in.open((((Path+"/battery/")+battery_entry->d_name)+"/info").c_str()); stringbuf buf; char c; int capacity=0; for (i=0; i<3; i++) { in.get(buf, ':'); in >> c; if (i==0) { in >> c; if(c!='y') // present: yes i=3; } else if(i==2) { in >> capacity; total_capacity+=capacity; } } in.close(); #ifdef IBAM_DEBUG cout << "Battery "<d_name<<": Capacity " << capacity; #endif if(capacity) { in.open((((Path+"/battery/")+battery_entry->d_name)+"/state").c_str()); for (i=0; i<5; i++) { in.get(buf, ':'); in >> c; if (i==2) { char d,e,f,g,h; in >> c >> d >> e >> f >> g >> h; // OUCH... #-} Somebody, please fix me if(c=='c' && h=='i') // charging state: charging { acLineStatus=1; batteryStatus=3; chargeStatus=1; #ifdef IBAM_DEBUG cout << " charging"; #endif } else if(c=='d') // charging state: discharge { acLineStatus=0; batteryStatus=0; chargeStatus=0; #ifdef IBAM_DEBUG cout << " discharging"; #endif } else if(c=='c' && h=='e') // charging state: charged { acLineStatus=1; batteryStatus=0; chargeStatus=0; #ifdef IBAM_DEBUG cout << " charged"; #endif } } else if(i==3) { int rate=0; in >> rate; total_rate+=rate; #ifdef IBAM_DEBUG cout << " Rate " << rate; #endif } else if(i==4) { int remain=0; in >> remain; total_remain+=remain; #ifdef IBAM_DEBUG cout << " Remain " << remain; #endif } } in.close(); } // has capacity #ifdef IBAM_DEBUG cout << endl; #endif } } closedir(acpi_battery_dir); if(total_capacity) remainingBatteryPercent=int((100.*total_remain)/total_capacity+.5); else remainingBatteryPercent=100; if(remainingBatteryPercent>100) remainingBatteryPercent=100; // Don't ask... if(remainingBatteryPercent<100 && acLineStatus==1 && chargeStatus==0) // Deal with strange Acpi-Data? { acLineStatus=1; batteryStatus=3; chargeStatus=1; } if(total_rate) remainingBatteryLifeSeconds=(total_remain*60*60)/total_rate; else remainingBatteryLifeSeconds=(remainingBatteryPercent*IBAM_ASSUME_DEFAULT_BATTERY_MIN*60)/100; #ifdef IBAM_DEBUG cout << "Remaining percent: " << remainingBatteryPercent << endl; cout << "Remaining battery life seconds: " << remainingBatteryLifeSeconds << endl; #endif } inline void percent_data::size_to(int newpercents) { if(newpercents>=maxpercents) { newpercents++; double *time_for=new double[newpercents]; double *time_deriv=new double[newpercents]; int *samples=new int[newpercents]; int i; for(i=0;i=0;i--) if(a.time_samples[i]) { if(a.time_deriv_for_percent[i]<0) a.time_deriv_for_percent[i]=0; o << i << '\t' << a.time_for_percent[i] << '\t' << sqrt(a.time_deriv_for_percent[i]) << '\t' << a.time_samples[i] << endl; } return o; } inline double percent_data::add_data(int percent,double time_for,int samples) { if(percent<0) return 0; size_to(percent); double ratio; if(time_samples[percent]) ratio=time_for/time_for_percent[percent]; else ratio=time_for/(IBAM_ASSUME_DEFAULT_BATTERY_MIN*60./100.); double old_time_for_percent=time_for_percent[percent]; time_for_percent[percent]= (time_for_percent[percent]*time_samples[percent] +time_for*samples )/(samples+time_samples[percent]); time_deriv_for_percent[percent]= ( (time_deriv_for_percent[percent]+old_time_for_percent*old_time_for_percent)*time_samples[percent] +time_for*time_for*samples )/(samples+time_samples[percent])-time_for_percent[percent]*time_for_percent[percent]; time_samples[percent]+=samples; return ratio; } inline double percent_data::average(int a,int b) // average from a to b { if(a>b) { int c=a;a=b;b=c; } if(a<0) { a=0; if(b<0) b=0; } if(b>=maxpercents) { b=maxpercents-1; if(a>=maxpercents) a=b; } int i; double su(0); int co(0); for(i=a;i<=b;i++) { if(time_samples[i]) { su+=time_for_percent[i]*time_samples[i]; co+=time_samples[i]; } } if(co) return (su/co); int gotdata=0; for(a--,b++;(a>0 || b=maxpercents) b=maxpercents-1; su+=time_for_percent[a]*time_samples[a] +time_for_percent[b]*time_samples[b]; co+=time_samples[a]+time_samples[b]; if(time_samples[a] || time_samples[b]) gotdata++; } if(co) return (su/co); return (IBAM_ASSUME_DEFAULT_BATTERY_MIN*60/100); } inline double percent_data::add_data(int percent,double time_for,double time_deriv_for,int samples) { if(percent<0) return 0; size_to(percent); double ratio; if(time_samples[percent]) ratio=time_for/time_for_percent[percent]; else ratio=time_for/average(percent,percent); double old_time_for_percent=time_for_percent[percent]; time_for_percent[percent]= (time_for_percent[percent]*time_samples[percent] +time_for*samples )/(samples+time_samples[percent]); time_deriv_for_percent[percent]= ( (time_deriv_for_percent[percent]+old_time_for_percent*old_time_for_percent)*time_samples[percent] + (time_deriv_for+time_for*time_for)*samples )/(samples+time_samples[percent])-time_for_percent[percent]*time_for_percent[percent]; time_samples[percent]+=samples; return ratio; } inline istream & operator >>(istream & i,percent_data &a) { while(!i.fail() && !i.eof()) { int percent; double time_for(-1); double time_deriv_for(-1); int samples; i >> percent >> time_for >> time_deriv_for>> samples; if(time_for>=0) a.add_data(percent,time_for,time_deriv_for*time_deriv_for,samples); } return i; } inline istream & percent_data::import(istream & i) { percent_data & a(*this); double maxval=0; while(!i.fail() && !i.eof()) { int val; double time_for(-1); int samples; i >> val >> time_for >> samples; if(val>maxval) maxval=val; if(time_for>=0) a.add_data(int(double(val)/maxval*100+.5),time_for*maxval/100,samples/10+1); } return i; } inline double percent_data::remain(int percent) { double r=0; size_to(percent); int i; for(i=percent;i>0;i--) { if(time_samples[i]) r+=time_for_percent[i]; else { int down=i-15; int up=i+15; if(down<0) down=0; if(up>=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline double percent_data::inverted_remain(int percent) { double r=0; size_to(percent); int i; for(i=percent+1;i=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline double percent_data::total(void) { double r=0; int i; for(i=maxpercents-1;i>0;i--) { if(time_samples[i]) r+=time_for_percent[i]; else { int down=i-15; int up=i+15; if(down<0) down=0; if(up>=maxpercents) up=maxpercents-1; r+=average(down,up); } } return r; } inline ibam::ibam(const char *data_path) : data_changed(0), battery_loaded(0),battery_changed(0), charge_loaded(0),charge_changed(0), profile_changed(0), lasttime(time(NULL)),lastpercent(0), lastratio(1),lastratiocount(1), laststatus(-1), currenttime(time(NULL)),isvalid(0),profile_logging(1), profile_number(0),profile_active(0) { string pmu_path = "/proc/pmu"; // These strings are already in ibam.hpp, string acpi_path = "/proc/acpi"; // maybe a static function should check this ifstream pmu,acpi; pmu.open((pmu_path+"/info").c_str()); acpi.open((acpi_path+"/info").c_str()); if (pmu.is_open()) { #ifdef IBAM_DEBUG cout << "using pmu" << endl; #endif pmu.close(); apm = new pmu_status(); } else if (acpi.is_open()) { #ifdef IBAM_DEBUG cout << "using acpi" << endl; #endif acpi.close(); apm = new acpi_status(); } else { #ifdef IBAM_DEBUG cout << "using apm" << endl; #endif apm = new apm_status(); } home = data_path; ifstream in((home+"/ibam.rc").c_str()); string saveversion; in >> saveversion; double dummy; if(saveversion==string("0.3")) { in >> lasttime >> lastpercent >> lastratio >> laststatus >> dummy >> dummy >> profile_logging >> profile_number >> profile_active; data_changed=1; } if(saveversion==IBAM_VERSION) in >> lasttime >> lastpercent >> lastratio >> lastratiocount >> laststatus >> profile_logging >> profile_number >> profile_active; else data_changed=1; // force update in.close(); currentpercent=apm->percent(); if(currentpercent!=-1) isvalid=1; currentstatus=apm->onBattery()?1:apm->charging()?2:0; if(currentstatus!=laststatus) { lastratio=1; lastratiocount=1; } } inline void ibam::update(void) { save(); apm->update(); currenttime=time(NULL); currentpercent=apm->percent(); if(currentpercent!=-1) isvalid=1; else isvalid=0; currentstatus=apm->onBattery()?1:apm->charging()?2:0; if(currentstatus!=laststatus) { lastratio=1; lastratiocount=1; } } inline int ibam::valid(void) const { return isvalid; } inline void ibam::import(void) { { ifstream in(".ibam.battery.rc"); battery.import(in); battery_changed=1; } { ifstream in(".ibam.charge.rc"); charge.import(in); charge_changed=1; } } inline void ibam::load_battery(void) { if(!battery_loaded) { ifstream in((home+"/battery.rc").c_str()); in >> battery; battery_loaded=1; } } inline void ibam::load_charge(void) { if(!charge_loaded) { ifstream in((home+"/charge.rc").c_str()); in >> charge; charge_loaded=1; } } inline void ibam::update_statistics(void) { if(currentstatus==laststatus && currenttime-lasttime=IBAM_MINIMAL_SECONDS_PER_PERCENT && sec_per_min<=IBAM_MAXIMAL_SECONDS_PER_PERCENT) { int i; last_sec_per_min=sec_per_min; last_sec_per_min_prediction=last_av; profile_changed=1; if(lastpercent-currentpercent>lastratiocount) lastratiocount=(lastpercent-currentpercent); for(i=currentpercent;i<=lastpercent;i++) { if(lastratiocount>2 || lastpercent==100) // Don't trust the first lastratio=(lastratio*lastratiocount+battery.add_data(i,sec_per_min))/(lastratiocount+1); lastratiocount++; } battery_changed=1; data_changed=1; } } else if(currentpercent>lastpercent) // strange data { data_changed=1; // discard if(profile_logging && profile_active) profile_number++; profile_active=0; } break; case 2: // charging if(currentpercent>lastpercent) { load_charge(); double sec_per_min; sec_per_min=(currenttime-lasttime)/double(currentpercent-lastpercent); double last_av=charge.average(lastpercent,currentpercent); if(sec_per_min<=IBAM_MAXIMAL_SECONDS_PER_PERCENT && sec_per_min>=IBAM_MINIMAL_SECONDS_PER_PERCENT) { int i; last_sec_per_min=sec_per_min; last_sec_per_min_prediction=last_av; profile_changed=1; if(currentpercent-lastpercent>lastratiocount) lastratiocount=(currentpercent-lastpercent); for(i=lastpercent;i<=currentpercent;i++) { if(lastratiocount>2) // Don't trust the first lastratio=(lastratio*lastratiocount+1./charge.add_data(i,sec_per_min))/(lastratiocount+1); lastratiocount++; } charge_changed=1; data_changed=1; } } else if(currentpercentseconds(); } inline int ibam::seconds_left_battery(void) { load_battery(); return int(battery.remain(currentpercent)+.5); } inline int ibam::seconds_left_battery_adaptive(void) { load_battery(); return int(battery.remain(currentpercent)*lastratio+.5); } inline int ibam::percent_battery_bios(void) { return apm->percent(); } inline int ibam::percent_battery(void) { load_battery(); return int((100.*seconds_left_battery())/battery.total()+.5); } inline int ibam::seconds_left_charge(void) { load_charge(); return int(charge.inverted_remain(currentpercent)+.5); } inline int ibam::seconds_left_charge_adaptive(void) { load_charge(); return int(charge.inverted_remain(currentpercent)/lastratio+.5); } inline int ibam::percent_charge(void) { load_charge(); return 100-int((100.*seconds_left_charge())/charge.total()+.5); } inline int ibam::seconds_battery_total(void) { load_battery(); return int(battery.total()+.5); } inline int ibam::seconds_battery_total_adaptive(void){ load_battery(); return int(battery.total()*lastratio+.5); } inline int ibam::seconds_charge_total(void) { load_charge(); return int(charge.total()+.5); } inline int ibam::seconds_charge_total_adaptive(void) { load_charge(); return int(charge.total()/lastratio+.5); } inline int ibam::seconds_battery_correction(void) { if(currentstatus!=laststatus || currentstatus==0 || lastpercent!=currentpercent) return 0; if(currentstatus==1) return lasttime-currenttime; load_battery(); load_charge(); return int((currenttime-lasttime)*(battery.average(currentpercent-1,currentpercent+1)/charge.average(currentpercent-1,currentpercent+1))+.5); } inline int ibam::seconds_charge_correction(void) { if(currentstatus!=laststatus || currentstatus==0 || lastpercent!=currentpercent) return 0; if(currentstatus==2) return lasttime-currenttime; load_battery(); load_charge(); return int((currenttime-lasttime)/(battery.average(currentpercent-1,currentpercent+1)/charge.average(currentpercent-1,currentpercent+1))+.5); } inline int ibam::onBattery(void) { return apm->onBattery(); } inline int ibam::charging(void) { return apm->charging(); } inline double percent_data::average_derivation(int a,int b) // average standard derivation from a to b { if(a>b) { int c=a;a=b;b=c; } if(a<0) { a=0; if(b<0) b=0; } if(b>=maxpercents) { b=maxpercents-1; if(a>=maxpercents) a=b; } int i; double su(0); int co(0); for(i=a;i<=b;i++) { if(time_samples[i]) { if(time_deriv_for_percent[i]>0) su+=sqrt(time_deriv_for_percent[i])*time_samples[i]; co+=time_samples[i]; } } if(co) return (su/co); int gotdata=0; for(a--,b++;(a>0 || b=maxpercents) b=maxpercents-1; if(time_deriv_for_percent[a]>0 && time_samples[a]) su+=sqrt(time_deriv_for_percent[a])*time_samples[a]; if(time_deriv_for_percent[b]>0 && time_samples[b]) su+=sqrt(time_deriv_for_percent[b])*time_samples[b]; co+=time_samples[a]+time_samples[b]; if(time_samples[a] || time_samples[b]) gotdata++; } if(co) return (su/co); return 20; } pbbuttonsd-0.7.9/src/module_peep.c0000644000175000017500000002745210507215331014074 00000000000000/* -------------------------------------------------------------------------- * module_test.c * code for test module * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * -------------------------------------------------------------------------*/ #ifdef DEBUG #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include "gettext_macros.h" #include "input_manager.h" #include "module_peep.h" #include "module_pmac.h" #include "support.h" #include "debug.h" static struct tagtable tagtab[] = { { "TAG_SKIP", TAG_SKIP}, { "TAG_SAVECONFIG", TAG_SAVECONFIG}, { "TAG_USERALLOWED", TAG_USERALLOWED}, { "TAG_AUTORESCAN", TAG_AUTORESCAN}, { "TAG_TIMEFORCMD", TAG_TIMEFORCMD}, { "TAG_CFGNAME", TAG_CFGNAME}, { "TAG_VERSION", TAG_VERSION}, { "TAG_REINIT", TAG_REINIT}, { "TAG_KEYCODE", TAG_KEYCODE}, { "TAG_KEYREPEAT", TAG_KEYREPEAT}, { "TAG_MODIFIER", TAG_MODIFIER}, { "TAG_MOUSERELX", TAG_MOUSERELX}, { "TAG_MOUSERELY", TAG_MOUSERELY}, { "TAG_SYSINFO", TAG_SYSINFO}, { "TAG_SYSINFOSLAVE", TAG_SYSINFOSLAVE}, { "TAG_BACKLIGHTMAX", TAG_BACKLIGHTMAX}, { "TAG_BACKLIGHTLEVEL", TAG_BACKLIGHTLEVEL}, { "TAG_HW_BACKLIGHT", TAG_HW_BACKLIGHT}, { "TAG_COVERSTATUS", TAG_COVERSTATUS}, { "TAG_BATLOG", TAG_BATLOG}, { "TAG_BATCYCLE", TAG_BATCYCLE}, #if PEEP_NOCYCLIC { "TAG_TIMEREMAINING", TAG_TIMEREMAINING | FLG_NOPEEP}, { "TAG_TIMECHANGED", TAG_TIMECHANGED | FLG_NOPEEP}, { "TAG_POWERSOURCE", TAG_POWERSOURCE | FLG_NOPEEP}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT | FLG_NOPEEP}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT | FLG_NOPEEP}, #else { "TAG_TIMEREMAINING", TAG_TIMEREMAINING}, { "TAG_TIMECHANGED", TAG_TIMECHANGED}, { "TAG_POWERSOURCE", TAG_POWERSOURCE}, { "TAG_AMBIENTLIGHT", TAG_AMBIENTLIGHT}, { "TAG_BATTERYPRESENT", TAG_BATTERYPRESENT}, #endif { "TAG_POWERCHANGED", TAG_POWERCHANGED}, { "TAG_REQUESTSLEEP", TAG_REQUESTSLEEP}, { "TAG_SLEEPSUPPORTED", TAG_SLEEPSUPPORTED}, { "TAG_PREPAREFORSLEEP", TAG_PREPAREFORSLEEP}, { "TAG_WAKEUPFROMSLEEP", TAG_WAKEUPFROMSLEEP}, { "TAG_PMUDEVICE", TAG_PMUDEVICE}, { "TAG_ADBDEVICE", TAG_ADBDEVICE}, { "TAG_TPMODEUPKEY", TAG_TPMODEUPKEY}, { "TAG_TPMODEUPMOD", TAG_TPMODEUPMOD}, { "TAG_TPMODEDOWNKEY", TAG_TPMODEDOWNKEY}, { "TAG_TPMODEDOWNMOD", TAG_TPMODEDOWNMOD}, { "TAG_TPMODE", TAG_TPMODE}, { "TAG_NOTAPTYPING", TAG_NOTAPTYPING}, { "TAG_KBDMODE", TAG_KBDMODE}, { "TAG_KEYBLIGHTLEVEL", TAG_KEYBLIGHTLEVEL }, { "TAG_KEYBLIGHTMAX", TAG_KEYBLIGHTMAX }, { "TAG_LCDILLUMUPKEY", TAG_LCDILLUMUPKEY}, { "TAG_LCDILLUMUPMOD", TAG_LCDILLUMUPMOD}, { "TAG_LCDILLUMDOWNKEY", TAG_LCDILLUMDOWNKEY}, { "TAG_LCDILLUMDOWNMOD", TAG_LCDILLUMDOWNMOD}, { "TAG_KBDILLUMUPKEY", TAG_KBDILLUMUPKEY}, { "TAG_KBDILLUMUPMOD", TAG_KBDILLUMUPMOD}, { "TAG_KBDILLUMDOWNKEY", TAG_KBDILLUMDOWNKEY}, { "TAG_KBDILLUMDOWNMOD", TAG_KBDILLUMDOWNMOD}, { "TAG_KBDILLUMONKEY", TAG_KBDILLUMONKEY}, { "TAG_KBDILLUMONMOD", TAG_KBDILLUMONMOD}, { "TAG_LCDAUTOADJUST", TAG_LCDAUTOADJUST }, { "TAG_LCDBRIGHTNESS", TAG_LCDBRIGHTNESS}, { "TAG_LCDFADINGSPEED", TAG_LCDFADINGSPEED}, { "TAG_LCDTHRESHOLD", TAG_LCDTHRESHOLD }, { "TAG_LCDAUTOADJMINBAT", TAG_LCDAUTOADJMINBAT }, { "TAG_LCDAUTOADJMAXBAT", TAG_LCDAUTOADJMAXBAT }, { "TAG_LCDAUTOADJMINAC", TAG_LCDAUTOADJMINAC }, { "TAG_LCDAUTOADJMAXAC", TAG_LCDAUTOADJMAXAC }, { "TAG_KBDAUTOADJUST", TAG_KBDAUTOADJUST }, { "TAG_KBDBRIGHTNESS", TAG_KBDBRIGHTNESS}, { "TAG_KBDONBRIGHTNESS", TAG_KBDONBRIGHTNESS}, { "TAG_KBDFADINGSPEED", TAG_KBDFADINGSPEED}, { "TAG_KBDTHRESHOLD", TAG_KBDTHRESHOLD }, { "TAG_BRIGHTNESSOP", TAG_BRIGHTNESSOP}, { "TAG_FRAMEBUFFERDEVICE", TAG_FRAMEBUFFERDEVICE}, { "TAG_BLANKFRAMEBUFFER", TAG_BLANKFRAMEBUFFER}, { "TAG_CRTMIRROR", TAG_CRTMIRROR}, { "TAG_CRTMIRRORKEY", TAG_CRTMIRRORKEY}, { "TAG_CRTMIRRORMOD", TAG_CRTMIRRORMOD}, { "TAG_DIMFULLYDARK", TAG_DIMFULLYDARK}, { "TAG_SOUNDSYSTEM", TAG_SOUNDSYSTEM}, { "TAG_SOUNDSYSTEMCFG", TAG_SOUNDSYSTEMCFG}, { "TAG_MIXERDEVICE", TAG_MIXERDEVICE}, { "TAG_MIXERCARD", TAG_MIXERCARD}, { "TAG_VOLUMEUPKEY", TAG_VOLUMEUPKEY}, { "TAG_VOLUMEUPMOD", TAG_VOLUMEUPMOD}, { "TAG_VOLUMEDOWNKEY", TAG_VOLUMEDOWNKEY}, { "TAG_VOLUMEDOWNMOD", TAG_VOLUMEDOWNMOD}, { "TAG_MUTEKEY", TAG_MUTEKEY}, { "TAG_MUTEMOD", TAG_MUTEMOD}, { "TAG_MIXERINITDELAY", TAG_MIXERINITDELAY}, { "TAG_VOLUME", TAG_VOLUME }, { "TAG_MUTE", TAG_MUTE }, { "TAG_MIXERCHANNELS", TAG_MIXERCHANNELS }, { "TAG_MIXERELEMENTS", TAG_MIXERELEMENTS }, { "TAG_CDROMDEVICE", TAG_CDROMDEVICE }, { "TAG_EJECTCDKEY", TAG_EJECTCDKEY }, { "TAG_EJECTCDMOD", TAG_EJECTCDMOD }, { "TAG_EJECTCDKEYDELAY", TAG_EJECTCDKEYDELAY }, { "TAG_EJECTCD", TAG_EJECTCD }, { "TAG_SCRIPTPMCS", TAG_SCRIPTPMCS }, { "TAG_HEARTBEATBEEP", TAG_HEARTBEATBEEP }, { "TAG_SLEEPKEY", TAG_SLEEPKEY }, { "TAG_SLEEPMOD", TAG_SLEEPMOD }, { "TAG_SLEEPKEYDELAY", TAG_SLEEPKEYDELAY }, { "TAG_GOTOSLEEP", TAG_GOTOSLEEP }, { "TAG_GOTOHIBERNATE", TAG_GOTOHIBERNATE }, { "TAG_BWLFIRST", TAG_BWLFIRST }, { "TAG_BWLSECOND", TAG_BWLSECOND }, { "TAG_BWLLAST", TAG_BWLLAST }, { "TAG_CURRENTBWL", TAG_CURRENTBWL }, { "TAG_SLEEPINSECONDS", TAG_SLEEPINSECONDS }, { "TAG_CPULOADSLEEPLOCK", TAG_CPULOADSLEEPLOCK }, { "TAG_CPULOADMIN", TAG_CPULOADMIN }, { "TAG_CPULOADPERIOD", TAG_CPULOADPERIOD }, { "TAG_NETLOADSLEEPLOCK", TAG_NETLOADSLEEPLOCK }, { "TAG_NETLOADMIN", TAG_NETLOADMIN }, { "TAG_NETLOADPERIOD", TAG_NETLOADPERIOD }, { "TAG_NETLOADDEV", TAG_NETLOADDEV }, { "TAG_IBAMDATADIR", TAG_IBAMDATADIR }, { "TAG_CHARGETIME", TAG_CHARGETIME }, { "TAG_POLICY", TAG_POLICY }, { "TAG_ONAC_POLICY", TAG_ONAC_POLICY }, { "TAG_ONAC_TIMERACTION", TAG_ONAC_TIMERACTION }, { "TAG_ONAC_COVERACTION", TAG_ONAC_COVERACTION }, { "TAG_ONAC_KEYACTION", TAG_ONAC_KEYACTION }, { "TAG_ONAC_TIMESUSPEND", TAG_ONAC_TIMESUSPEND }, { "TAG_ONAC_TIMEDIM", TAG_ONAC_TIMEDIM }, { "TAG_ONBATT_POLICY", TAG_ONBATT_POLICY }, { "TAG_ONBATT_TIMERACTION",TAG_ONBATT_TIMERACTION }, { "TAG_ONBATT_COVERACTION",TAG_ONBATT_COVERACTION }, { "TAG_ONBATT_KEYACTION", TAG_ONBATT_KEYACTION }, { "TAG_ONBATT_TIMESUSPEND",TAG_ONBATT_TIMESUSPEND }, { "TAG_ONBATT_TIMEDIM", TAG_ONBATT_TIMEDIM }, { "TAG_EMERGENCYACTION", TAG_EMERGENCYACTION }, { "TAG_IDENTITY", TAG_IDENTITY }, { NULL, 0 }}; static struct tagtable errortab[] = { { N_("Permission denied"), E_PERM}, { N_("Private Tag"), E_PRIVATE}, { N_("File doesn't exist"), E_NOEXIST}, { N_("File not a charakter device"), E_NOCHAR}, { N_("File not a block device"), E_NOBLK}, { N_("File not a file"), E_NOFILE}, { N_("Buffer overflow"), E_BUFOVL}, { N_("open error"), E_OPEN}, { N_("format error"), E_FORMAT}, { N_("Messageport not available"), E_MSGPORT}, { N_("Server already running"), E_TWICE}, { N_("Help or version info"), E_INFO}, { N_("Unsecure script owner"), E_USER}, { N_("Script must be write-only by owner"), E_RIGHTS}, { N_("read-only value"), E_NOWRITE}, { N_("write-only value"), E_NOREAD}, { N_("argument invalid"), E_INVALID}, { N_("function not supported"), E_NOSUPPORT}, { NULL, 0 }}; struct moddata_peep { int timer10; int timer100; int timer1000; int secure; } modbase_peep; int peep_init () { return peep_open (NULL); } int peep_open (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer10 = 0; base->timer100 = 0; base->timer1000 = 0; base->secure = 0; #if PEEP_KEYBOARD register_function (KBDQUEUE, peep_keyboard); #endif #if PEEP_MOUSE register_function (MOUSEQUEUE, peep_mouse); #endif #if PEEP_TIMER register_function (T10QUEUE, peep_t10); register_function (T100QUEUE, peep_t100); register_function (T1000QUEUE, peep_t1000); #endif register_function (CONFIGQUEUE, peep_config); register_function (QUERYQUEUE, peep_query); register_function (SECUREQUEUE, peep_secure); return 0; } int peep_exit () { return 0; } #if PEEP_KEYBOARD void peep_keyboard (struct tagitem *taglist) { int code = (int) tagfind (taglist, TAG_KEYCODE, 0); int value = (int) tagfind (taglist, TAG_KEYREPEAT, 0); int mod = (int) tagfind (taglist, TAG_MODIFIER, 0); printf("\tKeyboard: code %3d, value %d, modifier %d\r", code, value, mod); fflush(stdout); } #endif #if PEEP_MOUSE void peep_mouse (struct tagitem *taglist) { int rel_x = (int) tagfind (taglist, TAG_MOUSERELX, 0); int rel_y = (int) tagfind (taglist, TAG_MOUSERELY, 0); printf("Mouse: Rel-X %3d, Rel-Y %3d\n", rel_x, rel_y); } #endif #if PEEP_TIMER void peep_t10 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer10++; } void peep_t100 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer100++; } void peep_t1000 (struct tagitem *taglist) { struct moddata_peep *base = &modbase_peep; base->timer1000++; printf ("timer10: %d timer100: %d timer1000: %d secure: %d\n", base->timer10, base->timer100, base->timer1000, base->secure); } #endif void peep_ipc (struct tagitem *taglist) { #if PEEP_IPC peep_taglist ("IPC", taglist); #endif } void peep_config (struct tagitem *taglist) { #if PEEP_CONFIG peep_taglist ("Config", taglist); #endif } void peep_query (struct tagitem *taglist) { #if PEEP_QUERY peep_taglist ("Query", taglist); #endif } void peep_secure (struct tagitem *taglist) { #if PEEP_SECURE peep_taglist ("Secure", taglist); #endif } void peep_taglist (char *source, struct tagitem *taglist) { struct tagtable *tt, *tt2; char mark; if (taglist != NULL) while (taglist->tag != TAG_END) { if ((tt = findttentry (tagtab, taglist->tag & TAGMASK))) { if (tt->tag & FLG_NOPEEP) { taglist++; continue; /* skip tag */ } if (taglist->tag & FLG_ERROR) mark = 'E'; else if (tt->tag & FLG_DEPRECIATED) mark = 'D'; else if (tt->tag & FLG_PRIVATE) mark = 'P'; else mark = ' '; printf ("%-10s: %c %-25s: ", source, mark, tt->tagname); if (taglist->data == 0xffffffff) { printf ("tag not filled"); } else if (tt->tag == TAG_SKIP) { tt2 = findttentry (tagtab, taglist->data); if (tt2 != NULL) printf ("%s", tt2->tagname); else printf ("???"); } else if (taglist->tag & FLG_ERROR) { tt2 = findttentry (errortab, taglist->data); if (tt2 != NULL) printf ("%s", tt2->tagname); else printf ("???"); } else if (tt->tag & FLG_STRING) { printf ("\"%s\"", (char *) taglist->data); } else { printf ("%ld", taglist->data); } printf (" \n"); } else printf ("%-10s: %-25s: %lx\n", source, _("unknown tag"), taglist->tag & TAGMASK); taglist++; } } struct tagtable * findttentry (struct tagtable *ttab, long tag) { while (ttab->tag != 0) { if ((ttab->tag & TAGMASK) == tag) return ttab; ttab++; } return NULL; } #endif /* Debug */ pbbuttonsd-0.7.9/src/module_peep.h0000644000175000017500000000247110217517075014103 00000000000000#ifndef INCLUDE_MODULE_PEEP_H #define INCLUDE_MODULE_PEEP_H /* ---------------------------------------------------------------------------- * module_peep.h * prototypes and definitions for the module peep. * * Copyright 2002-2005 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ #include struct tagtable { char *tagname; long tag; }; /* public prototypes */ int peep_init (); int peep_open (struct tagitem *taglist); int peep_exit (); /* private prototypes */ void peep_keyboard (struct tagitem *taglist); void peep_mouse (struct tagitem *taglist); void peep_t10 (struct tagitem *taglist); void peep_t100 (struct tagitem *taglist); void peep_t1000 (struct tagitem *taglist); void peep_ipc (struct tagitem *taglist); void peep_config (struct tagitem *taglist); void peep_query (struct tagitem *taglist); void peep_secure (struct tagitem *taglist); void peep_taglist (char *source, struct tagitem *taglist); struct tagtable *findttentry (struct tagtable *ttab, long tag); #endif /* INCLUDE_MODULE_PEEP_H */ pbbuttonsd-0.7.9/src/debug.h0000644000175000017500000000424610507723067012677 00000000000000#ifndef INCLUDE_DEBUG_H #define INCLUDE_DEBUG_H /* ---------------------------------------------------------------------------- * debug.h * definitions for debugging. This file describes in detail which debug * information should be printed to console. The symbol DEBUG must also * be defined. It is the master key for all of this options. * * Copyright 2002 Matthias Grimm * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ----------------------------------------------------------------------------*/ /* module_powersave.c */ #define SLEEPLOCKS 0 /* =1 for printing sleeplock status to console */ #define IBAM 0 /* =1 for printing adaptive battery time */ /* module_pmac.c */ #define PMUINTR 0 /* =1 for printing PMU interrupts to console */ #define PMUTALK 0 /* =1 for logging PMU communication into /var/log/pbbuttonsd */ #define SIMUAMBIENT 0 /* =1 for simulating ambient light sensor */ #define TESTAMBIENT 0 /* =1 for printing some ambient values to console */ #define TRACKPAD 0 /* =1 for debugging dynamic trackpad reconfiguration */ /* module_cdrom.c */ #define CDROM 0 /* =1 mount and status information */ #define CDROMPERF 0 /* =1 for printing CDROM performance data to console */ /* module_display.c */ #define BRIGHTNESS 0 /* =1 show current brightness values of KBD and LCD */ #define DISPLAYTIMER 0 /* =1 show when the display timer is active */ /* module_peep.c */ #define PEEP_IPC 1 /* =1, all tags sent to clients will be printed */ #define PEEP_CONFIG 1 /* =1, all configure tags will be printed */ #define PEEP_QUERY 1 /* =1, all query tags will be printed */ #define PEEP_SECURE 0 /* =1, all security tags will be printed */ #define PEEP_KEYBOARD 0 /* =1, keyboard events are printed */ #define PEEP_MOUSE 0 /* =1, mouse events are printed */ #define PEEP_TIMER 0 /* =1, timer events are printed */ #define PEEP_NOCYCLIC 1 /* =1, some cyclic tags will be filtered out */ #endif /* INCLUDE_DEBUG_H */ pbbuttonsd-0.7.9/src/tcp.c0000644000175000017500000001420207754475401012371 00000000000000/* * --------------------------------------------------------------------------- * $Id: tcp.c,v 1.3 2003/11/12 18:25:05 matthiasgrimm Exp $ * --------------------------------------------------------------------------- * Revision 1.1.1.1 2001/12/07 11:31:48 sleemburg * Initial CVS import of the unreleased pmud-0.8 to apmud (new project name * because of a name clash at sourceforge.net). * * Revision 1.3 1999/01/12 08:29:17 stephan * in tcp_open, close the socket if the connection fails. * * Revision 1.2 1998/09/15 07:13:31 stephan * win32 modifications by Job de Haas (job@dsl.nl) * * Revision 1.1 1998/04/02 12:54:49 stephan * Initial revision * * --------------------------------------------------------------------------- */ #ifdef HAVE_CONFIG_H # include #endif #ifdef WITH_PMUD #include #ifndef WIN32 #include #endif #include #include #include #ifdef WIN32 #include #include #define open _open #define close _close #else #include #include #include #include #include #endif #if defined( __STDC__ ) || defined( WIN32 ) #include #else #include #endif #define FATAL(error) { errno = error; return (-1); } /* * --------------------------------------------------------------------------- * public interface * --------------------------------------------------------------------------- */ int tcp_open(char *, char *, unsigned short); int tcp_bind(unsigned short); void tcp_listen(int); int tcp_read(int, const char *, size_t); int tcp_write(int, const char *, size_t); #ifdef __STDC__ int tcp_printf(int, char *, ...); #else int tcp_printf(); #endif #ifdef SOCKS #define connect Rconnect #define getsockname Rgetsockname #define bind Rbind #define accept Raccept #define listen Rlisten #define select Rselect #endif #ifdef WIN32 int first = 1; #endif int tcp_open(char *host, char *service, unsigned short port) { struct sockaddr_in server; struct hostent *hostinfo; struct servent *servinfo; #ifdef WIN32 SOCKET sock_fd; int iResult; if(first) { /* Start the WSA */ WSADATA wsadata; iResult= WSAStartup( MAKEWORD( 1, 1 ), &wsadata ); if( iResult != 0 ) FATAL( iResult ); first = 0; } #else int sock_fd; #endif /* use localhost if none specified */ if(! host || ! *host) host = "localhost"; /* check arguments */ if( (!service || !*service ) && port <= 0) #ifdef WIN32 FATAL(WSAEDESTADDRREQ) #else FATAL(EDESTADDRREQ) #endif /* initialise the server information */ memset((char *) &server, 0, sizeof(server)); server.sin_family = AF_INET; server.sin_port = htons(port); /* try to get the server specification, if fail then use port */ if( service && *service ) { servinfo = getservbyname(service, "tcp"); if(servinfo) server.sin_port = servinfo->s_port; } /* try to get the address of the host */ server.sin_addr.s_addr = inet_addr(host); if( server.sin_addr.s_addr == INADDR_NONE ) { hostinfo = gethostbyname(host); if(!hostinfo) #ifdef WIN32 FATAL(WSAEADDRNOTAVAIL) #else FATAL(EADDRNOTAVAIL) #endif memcpy( (char *) &server.sin_addr, hostinfo->h_addr, hostinfo->h_length ); } /* create socket */ sock_fd = socket(AF_INET, SOCK_STREAM, 0); if( sock_fd < 0 ) FATAL(errno) /* connect to the server */ if(connect(sock_fd, (struct sockaddr *) &server, sizeof(server)) < 0) { close(sock_fd); FATAL(errno) } return(sock_fd); } int tcp_bind(unsigned short port) { int fd; struct sockaddr_in server; fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(fd < 0) return fd; memset((char*)&server, 0, sizeof(server)); server.sin_family = AF_INET; server.sin_addr.s_addr = htonl(INADDR_ANY); server.sin_port = htons(port); if(bind(fd, (struct sockaddr*) &server, sizeof(server)) < 0) { close(fd); return -1; } return fd; } void tcp_listen(int fd) { if(fd>=0) listen(fd, 5); } int tcp_accept(int fd) { return accept(fd, (struct sockaddr*)0, (int*)0); } int tcp_close(int fd) { #ifdef WIN32 if (!first) { int iResult = WSACleanup(); if(iResult != 0) FATAL(iResult) } #endif return close(fd); } char *tcp_identify(int fd) { struct sockaddr_in client; int len = sizeof(client); char *inetaddr; struct hostent *remote; struct in_addr *remaddr; register int i; int match; if(getpeername(fd, (struct sockaddr*) &client, &len)) return (char*)0; if(client.sin_family != AF_INET) return 0; inetaddr = inet_ntoa(client.sin_addr); if(inetaddr <= (char*)0) return (char*)0; remote=gethostbyaddr((char *)&client.sin_addr, sizeof(client.sin_addr), (int)client.sin_family); if(!remote) return (char*)0; for(match=i=0; remote->h_addr_list[i]; i++) { remaddr = (struct in_addr*) remote->h_addr_list[i]; if(remaddr->s_addr == client.sin_addr.s_addr) match++; } return match ? remote->h_name : (char*)0; } int tcp_write(int fildes, const char *buffer, size_t nbytes) { register char *data; register size_t right; register size_t left; for(data=(char *)buffer, left=nbytes;;) if((right=send(fildes, data, left, 0)) < 0) { return right; } else { left -= right; data += right; /* if right == 0 then EOF, return #bytes written */ if(right == 0 || left == 0) return nbytes - left; } /*NOTREACHED*/ } int tcp_read(int fildes, const char *buffer, size_t nbytes) { register char *data; register size_t right; register size_t left; for(data=(char *)buffer, left=nbytes;;) if((right=recv(fildes, data, left, 0)) < 0) { return right; } else { left -= right; data += right; /* if right == 0 then EOF, return #bytes already read */ if(right == 0 || left == 0) return nbytes - left; } /*NOTREACHED*/ } /*VARARGS*/ int #if defined( __STDC__ ) || defined( WIN32 ) tcp_printf(int sock, char *fmt, ...) #else tcp_printf(sock, fmt, va_alist) int sock; char *fmt; va_dcl #endif { va_list ap; static char buf[2*BUFSIZ]; #if defined( __STDC__ ) || defined( WIN32 ) va_start(ap, fmt); #else va_start(ap); #endif vsprintf(buf, fmt, ap); va_end(ap); return tcp_write(sock, buf, strlen(buf)); } #endif /* WITH_PMUD */ pbbuttonsd-0.7.9/src/tcp.h0000644000175000017500000000247007530751774012404 00000000000000/* * --------------------------------------------------------------------------- * $Id: tcp.h,v 1.2 2002/08/21 17:55:08 matthiasgrimm Exp $ * --------------------------------------------------------------------------- * $Log: tcp.h,v $ * Revision 1.2 2002/08/21 17:55:08 matthiasgrimm * new version 0.5 * * Revision 1.1 2002/08/13 16:14:47 matthiasgrimm * initial upload * * Revision 1.1 2002/03/17 14:19:39 matthiasgrimm * *** empty log message *** * * Revision 1.1.1.1 2001/12/07 11:31:48 sleemburg * Initial CVS import of the unreleased pmud-0.8 to apmud (new project name * because of a name clash at sourceforge.net). * * Revision 1.1 2000/02/09 20:44:20 stephan * Initial revision * * --------------------------------------------------------------------------- */ #ifndef HDR_MYTCP_H #define HDR_MYTCP_H /* * --------------------------------------------------------------------------- * public interface * --------------------------------------------------------------------------- */ int tcp_open(char *, char *, unsigned short); int tcp_bind(unsigned short); void tcp_listen(int); int tcp_read(int, const char *, size_t); int tcp_write(int, const char *, size_t); #ifdef __STDC__ int tcp_printf(int, char *, ...); #else int tcp_printf(); #endif int tcp_close(int); #endif /* HDR_MYTCP_H */ pbbuttonsd-0.7.9/scripts/0000755000175000017500000000000010507757764012425 500000000000000pbbuttonsd-0.7.9/scripts/pmcs-apmd0000755000175000017500000000425410507757763014160 00000000000000#!/bin/sh # # This shell script is called by the APM daemon (apmd) when the state # of any power management function has changed. The exact events that # trigger the calling of apmd_proxy depend on how apmd was configured # at compile time. # # Here are the calling sequences for apmd_proxy: # # apmd_proxy start - APM daemon has started # apmd_proxy stop - APM daemon is shutting down # apmd_proxy suspend system - APM system has requested suspend mode # apmd_proxy suspend critical - APM system indicates critical suspend # apmd_proxy standby system - APM system has requested standby mode # apmd_proxy suspend user - User has requested suspend mode # apmd_proxy standby user - User has requested standby mode # apmd_proxy resume suspend - System has resumed from suspend mode # apmd_proxy resume standby - System has resumed from standby mode # apmd_proxy resume critical - System has resumed from critical suspend # apmd_proxy change battery - APM system reported low battery # apmd_proxy change power - APM system reported AC/battery change # apmd_proxy change time - APM system reported need for time update # apmd_proxy change capability - APM system reported config. change # PATH=/bin:/sbin:/usr/bin:/usr/sbin on_ac_power >/dev/null && PWR=ac || PWR=battery cd `dirname $0` case "$1" in start) if [ "$PWR" == "battery" ]; then run-parts --arg="powersave" --arg="$PWR" event.d else run-parts --arg="performance" --arg="$PWR" event.d fi ;; change) case "$2" in battery) wall "Low battery - system will go down now!" ;; power) if [ "$PWR" == "battery" ]; then run-parts --arg="powersave" --arg="$PWR" event.d else run-parts --arg="performance" --arg="$PWR" event.d fi ;; esac ;; suspend|standby) [ -d suspend.d ] && run-parts --arg="suspend" --arg="$PWR" --arg="ram" suspend.d run-parts --arg="suspend" --arg="$PWR" --arg="ram" event.d ;; resume) [ -d resume.d ] && run-parts --arg="resume" --arg="$PWR" --arg="ram" resume.d run-parts --arg="resume" --arg="$PWR" --arg="ram" event.d ;; esac pbbuttonsd-0.7.9/scripts/pmcs-config0000644000175000017500000000156310507757763014501 00000000000000# Configuration file for the PowerManagement Control Scripts # Section for general options general_HDDevice="/dev/hda" # hdsetup general_PCMCIAShutdown="suspend" # pcmcia # Path of laptop_mode.sh delivered with the kernel source tree # The script is not externally configurable yet. You have to # modify the script according your needs. general_LMScript=scripts.d/laptopmode.sh # Section for power policy 'performance' performance_HDTimeOff=0 # hdsetup - timeout in seconds performance_HDOptions="-p" # hdsetup performance_LaptopMode="stop" # bdflush # Section for power policy 'custom' custom_HDTimeOff=60 # hdsetup - timeout in seconds custom_HDOptions="-p" # hdsetup custom_LaptopMode="start" # bdflush # Section for power policy 'powersave' powersave_HDTimeOff=60 # hdsetup - timeout in seconds powersave_HDOptions="-p" # hdsetup powersave_LaptopMode="start" # bdflush pbbuttonsd-0.7.9/scripts/pmcs-pbbuttonsd0000755000175000017500000000367310507757763015427 00000000000000#!/bin/sh # # This script is invoked by pbbuttonsd to configure the system for a # given power level. The script gets three arguments: # The first and the the third argument belong together. The first # argument is a command and the third a corresponding argument. Not # each of the commands have a corresponding argument. The following # table shows possible combinations: # # $1 $3 # 'powersave' | power policies transfered to slave # 'custom' | scripts # 'performance' | # 'suspend' 'ram' prepare for suspend to RAM (sleep) # 'disk' prepare for suspend to disk # 'shutdown' prepare for system shutdown # 'resume' 'ram' after wakeup from suspend to RAM # 'disk' theoretically, not used yet # 'emergency' battery is critically low -> shutdown. # 'shutdown' user initiated a system shutdown. # 'cover-open' 'open' cover has been opened # 'cover-close' 'close' cover has been closed # # 'cover-open' and 'cover-closed' will only be called if no other # suspend script is going to be called or sleep is not supported # on this machine. The argument for this command is a future # investment. # # The second argument contains the current powersource of the laptop # 'ac' # 'battery' # # The commands 'emergency' and 'shutdown' are handled directly. All # other commands will be transfered to the slave scripts which hopefully # will do the work. PATH=/bin:/sbin:/usr/bin:/usr/sbin # Logging is done by the pbbuttonsd daemon. case "$1" in emergency) shutdown -h now "Low battery - system will go down now!" ;; shutdown) shutdown -h now "User requested shutdown - system will go down now!" ;; *) cd `dirname $0` PATH=$PATH:$PWD [ -d ${1}.d ] && run-parts --arg="$1" --arg="$2" --arg="$3" ${1}.d run-parts --arg="$1" --arg="$2" --arg="$3" event.d ;; esac pbbuttonsd-0.7.9/scripts/pmcs-pmud0000755000175000017500000000276110507757763014205 00000000000000#!/bin/sh # # This script is invoked by pmud to configure the system for a # given power level. The desired level is indicated by the first # argument and can take the following values: # # minimum = minimum power # medium = medium power # maximum = full power # lid-opened = cover has been opened # lid closed = cover has been closed # sleep = prepare for sleep # wakeup = system woke up after a sleep # warning = low battery condition detected, issue a warning to users # # the second argument gives the current power source, and can take the # following values: # # ac # battery # PATH=/bin:/sbin:/usr/bin:/usr/sbin [ -x logger ] && \ logger -p daemon.info -t pmcs-pmud "called with $1 $2" cd `dirname $0` case "$1" in warning) wall "Low battery - system will go down now!" ;; minimum) run-parts --arg="powersave" --arg="$2" event.d ;; medium) run-parts --arg="custom" --arg="$2" event.d ;; maximum) run-parts --arg="performance" --arg="$2" event.d ;; lid-opened) run-parts --arg="cover-open" --arg="$2" --arg="open" event.d ;; lid-closed) run-parts --arg="cover-close" --arg="$2" --arg="close" event.d ;; sleep) [ -d suspend.d ] && run-parts --arg="suspend" --arg="$2" --arg="ram" suspend.d run-parts --arg="suspend" --arg="$2" --arg="ram" event.d ;; wakeup) [ -d resume.d ] && run-parts --arg="resume" --arg="$2" --arg="ram" resume.d run-parts --arg="resume" --arg="$2" --arg="ram" event.d ;; esac pbbuttonsd-0.7.9/scripts/README0000644000175000017500000001317410507757763013232 00000000000000 PowerManagement Control Scripts ---------------------------------------------------------- Matthias Grimm , 2004 Introduction ------------ A powermanagement daemon can't be prepared for all aspects of power management for a whole bunch of different systems. The hardware is not always the same, used software needs some special care or the user wants a special job done at a certain event. All this aspects can't be handled in one single program without help. This help is usually a highly adaptable shell script. Most tasks that have to be done after a power management event are common tasks needed from most people. For example someone with an IDE hard disk may want to spin down the disk after some idle time. Those scripts for common tasks useful for many people without change are collected in the PowerManagement Control Scripts. As mentioned this package contains a lot of common scripts to assist the power management handling of the daemon. But on a certain computer not all are needed. To control which scripts should be executed and which not, the scripts are stored in different locations: ./scripts.d place for all scripts in package. Scripts in this directory are referenced to as 'slave scripts' later in this document ./event.d place for scripts to be executed If following directories exist the containing scripts will be executed just before suspend and after wakeup additionally to those in ./event.d: ./suspend.d contains scripts to be launched before suspend ./resume.d contains scripts to be launched after wakeup In avoidance of storing each script twice the directories ./event.d, ./suspend.d and ./resume.d should only contain symbolic links to the real scripts in ./scripts.d. The master script will not differentiate between suspend-to-ram and suspend-to-disk. In both cases the scripts in suspend.d will be executed. A third argument will help to distinguish the two cases. Each script now may decide to handle the two cases seperately or not. If the calling sequence matters, use link name with leading numbers. For example: suspend.d/20nfs -> ../scripts.d/nfs umount filesystems first suspend.d/21eth0 -> ../scripts.d/eth0 then shut down eth0 resume.d/20eth0 -> ../scripts.d/eth0 first bring up eth0 before resume.d/21nfs -> ../scripts.d/nfs mounting filesystems again The Master Script ----------------- The master script will be called by the powermanagement daemon and will then launch all slave scripts in ./event.d. The main task of this script is to translate the given arguments from the daemon into those the slave scripts understand. In some cases it might be useful that the master script itself complete a task directly without calling any slave script. To adapt the PMCS (PowerManagement Control Scripts) to a new powermanagement daemon, a new master script for this deamon have to be provided. Nothing else have to be changed. The slave scripts can be used without any change. Master scripts for some common powermanagement daemons are already included: pmcs-pbbuttonsd, pmcs-pmud and pmcs-apmd. The Slave Scripts ----------------- As already mentioned the slave scripts actual do the work. They are stored in .scripts.d and the active ones are linked to ./event.d. Each scripts except at least two arguments; some accept three: arg $1: contains the action code or the power policy that should be set. Possible keywords are: 'powersave' power policy, minimum power consumption 'custom' power policy, user defined, something in between 'performance' power policy, maximum performance 'suspend' action, prepare for sleep 'resume' action, wakeup from sleep 'cover-open' action, cover has been opened 'cover-close' action, cover has been closed arg $2: power source. following keywords are possible: 'ac' the computer runs on AC power 'battery' the computer runs on battery power arg $3: argument for arg $1 depending on arg $1. Following arguments have been defined yet: 'ram'|'disk' for 'suspend' and 'resume' 'open' for 'cover-open' 'close' for 'cover-close' The arguments 'cover-open' / 'cover-closed' and 'suspend' / 'resume' are mutually exclusive. The 'cover-*' scripts will only be called if no suspend mode is chosen at all or the chosen suspend mode is not supported on this machine. The third argument of the 'cover-*' events will allow to combine those two commands in the slave scripts. It might happen in future that the two commands 'cover-open' and 'cover-close' will be replaced by one single command called 'cover'. New scripts should take this into account. The Configuration ----------------- Most slave scripts allow some options to configure. In avoidance of setting those options in each slave script all configuration options are collected in the file 'pmcs-config' that will be sourced by all slave scripts. This 'pmcs-config' contains shell variables containing the option. This variables will then be used in the slave scripts. To get the full option list of a slave script please refer the scripts documentation or look into the script itself. Each pmcs-config variable should be unique and carry a certain prefix: general_ if the variable defines a policy independent option powersave_ if the option belongs to 'powersave' policy custom_ if the option belongs to 'custom' policy performance_ if the option belongs to 'performance' policy Licence ------- All scripts and attached material are published under the terms of the GNU Public Licence (GPL). pbbuttonsd-0.7.9/scripts/scripts.d/0000755000175000017500000000000010507757764014336 500000000000000pbbuttonsd-0.7.9/scripts/scripts.d/apmd-compat0000755000175000017500000000244010507757763016405 00000000000000#!/bin/sh # # name : apmd-compat # author : Guido Guenther # description : Execute scripts in /etc/apm for compatibility # # --- end of public part -- don't change below this line --- . pmcs-config [ -d "/etc/apm" ] || exit 0 case "$2" in battery) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; ac) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; esac case "$1" in suspend) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 user else run-parts --arg=$1 --arg=user /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=user /etc/apm/$1.d fi fi ;; resume) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 suspend else run-parts --arg=$1 --arg=suspend /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=suspend /etc/apm/$1.d fi fi ;; esac pbbuttonsd-0.7.9/scripts/scripts.d/bdflush0000755000175000017500000000241010507757763015627 00000000000000#!/bin/sh # name : bdflush # author : Matthias Grimm # description : toggle laptop mode in kernel and adjust # memory management buffer flush timeouts # This script will first look for an global laptop-mode # script before running a private version. # requirements: laptop-mode patch in kernel # laptopmode.sh somewhere on your system # limitations : none # # --- end of public part -- don't change below this line --- if [ -x event.d/apmd-compat ]; then if [ -x /etc/apm/event.d/laptop-mode ]; then logger -p daemon.error -t pmcs-bdflush "External laptop-mode script found - exiting." exit 0 fi fi # source configuration . pmcs-config if [ -w /proc/sys/vm/laptop_mode ]; then if [ -x $general_LMScript ]; then case "$1" in powersave) $general_LMScript $powersave_LaptopMode ;; custom) $general_LMScript $custom_LaptopMode ;; performance) $general_LMScript $performance_LaptopMode ;; esac elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Can't find $general_LMScript." fi elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Laptop-mode patch missing in kernel." fi pbbuttonsd-0.7.9/scripts/scripts.d/cpufreq0000755000175000017500000000460310507757763015653 00000000000000#!/bin/sh # name : cpufreq # author : Dominik Brodowski # Davin Kimdon # modified : Matthias Grimm # description : Set processor frequency # requirements: # limitations : only first CPU supported # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config KVER=`uname -r` case "$1" in powersave|custom) case "$KVER" in 2.6.*) if [ -d /sys ]; then echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed elif [ -f /proc/cpufreq ]; then echo -n "0:0:0:powersave" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed fi ;; 2.4.*) if [ -f /proc/cpufreq ]; then echo -n "0:0:0:powersave" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed fi ;; esac ;; performance) case "$KVER" in 2.6.*) if [ -d /sys ]; then echo -n "userspace" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed elif [ -f /proc/cpufreq ]; then echo -n "0%76%100%performance" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed fi ;; 2.4.*) if [ -f /proc/cpufreq ]; then echo -n "0%76%0100%performance" > /proc/cpufreq elif [ -d /proc/sys/cpu ]; then cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed fi ;; esac ;; suspend) ;; resume) ;; esac pbbuttonsd-0.7.9/scripts/scripts.d/hdsetup0000755000175000017500000000152410507757764015662 00000000000000#!/bin/sh # name : hdsetup # author : Matthias Grimm # description : Set harddisk spin-down timeouts # requirements: hdparm and sync in path # limitations : work only with IDE harddisks # controls only a single harddisk # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) for HD in $general_HDDevice; do hdparm $powersave_HDOptions -S $(($powersave_HDTimeOff/5)) $HD done ;; custom) for HD in $general_HDDevice; do hdparm $custom_HDOptions -S $(($custom_HDTimeOff/5)) $HD done ;; performance) for HD in $general_HDDevice; do hdparm $performance_HDOptions -S $(($performance_HDTimeOff/5)) $HD done ;; suspend) sync ;; resume) ;; esac pbbuttonsd-0.7.9/scripts/scripts.d/laptopmode.sh0000755000175000017500000002176710507757764016776 00000000000000#! /bin/sh # start or stop laptop_mode, best run by a power management daemon when # ac gets connected/disconnected from a laptop # # install as /sbin/laptop_mode # # Contributors to this script: Kiko Piris # Bart Samwel # Micha Feigin # Andrew Morton # Dax Kelson # # Original Linux 2.4 version by: Jens Axboe # Remove an option (the first parameter) of the form option= from # a mount options string (the rest of the parameters). parse_mount_opts () { OPT="$1" shift echo "$*" | \ sed 's/.*/,&,/' | \ sed 's/,'"$OPT"'=[0-9]*,/,/g' | \ sed 's/,,*/,/g' | \ sed 's/^,//' | \ sed 's/,$//' | \ cat - } # Remove an option (the first parameter) without any arguments from # a mount option string (the rest of the parameters). parse_nonumber_mount_opts () { OPT="$1" shift echo "$*" | \ sed 's/.*/,&,/' | \ sed 's/,'"$OPT"',/,/g' | \ sed 's/,,*/,/g' | \ sed 's/^,//' | \ sed 's/,$//' | \ cat - } # Find out the state of a yes/no option (e.g. "atime"/"noatime") in # fstab for a given filesystem, and use this state to replace the # value of the option in another mount options string. The device # is the first argument, the option name the second, and the default # value the third. The remainder is the mount options string. # # Example: # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime # # If fstab contains, say, "rw" for this filesystem, then the result # will be "defaults,atime". parse_yesno_opts_wfstab () { L_DEV=$1 shift OPT=$1 shift DEF_OPT=$1 shift L_OPTS="$*" PARSEDOPTS1="$(parse_nonumber_mount_opts $OPT $L_OPTS)" PARSEDOPTS1="$(parse_nonumber_mount_opts no$OPT $PARSEDOPTS1)" # Watch for a default atime in fstab FSTAB_OPTS="$(cat /etc/fstab | tr -s "[:blank:]" " " | grep ^\ *"$L_DEV " | awk '{ print $4 }')" if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT")" ] ; then # option not specified in fstab -- choose the default. echo "$PARSEDOPTS1,$DEF_OPT" else # option specified in fstab: extract the value and use it if [ -z "$(echo "$FSTAB_OPTS" | grep "no$OPT")" ] ; then # no$OPT not found -- so we must have $OPT. echo "$PARSEDOPTS1,$OPT" else echo "$PARSEDOPTS1,no$OPT" fi fi } # Find out the state of a numbered option (e.g. "commit=NNN") in # fstab for a given filesystem, and use this state to replace the # value of the option in another mount options string. The device # is the first argument, and the option name the second. The # remainder is the mount options string in which the replacement # must be done. # # Example: # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 # # If fstab contains, say, "commit=3,rw" for this filesystem, then the # result will be "rw,commit=3". parse_mount_opts_wfstab () { L_DEV=$1 shift OPT=$1 shift L_OPTS="$*" PARSEDOPTS1="$(parse_mount_opts $OPT $L_OPTS)" # Watch for a default commit in fstab FSTAB_OPTS="$(cat /etc/fstab | sed 's/ / /g' | grep ^\ *"$L_DEV " | awk '{ print $4 }')" if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT=")" ] ; then # option not specified in fstab: set it to 0 echo "$PARSEDOPTS1,$OPT=0" else # option specified in fstab: extract the value, and use it echo -n "$PARSEDOPTS1,$OPT=" echo "$FSTAB_OPTS" | \ sed 's/.*/,&,/' | \ sed 's/.*,'"$OPT"'=//' | \ sed 's/,.*//' | \ cat - fi } KLEVEL=$( uname -r | ( IFS="." read a b c echo $a.$b ) ) case "$KLEVEL" in "2.4"|"2.6") true ;; *) echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" exit 1 ;; esac # Shall we remount journaled fs. with appropiate commit interval? (1=yes) DO_REMOUNTS=1 # And shall we add the "noatime" option to that as well? (1=yes) DO_REMOUNT_NOATIME=1 # age time, in seconds. should be put into a sysconfig file MAX_AGE=600 # Dirty synchronous ratio. At this percentage of dirty pages the process which # calls write() does its own writeback DIRTY_RATIO=40 # # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been # exceeded, the kernel will wake pdflush which will then reduce the amount # of dirty memory to dirty_background_ratio. Set this nice and low, so once # some writeout has commenced, we do a lot of it. # DIRTY_BACKGROUND_RATIO=5 READAHEAD=4096 # kilobytes # kernel default dirty buffer age DEF_AGE=30 DEF_UPDATE=5 DEF_DIRTY_BACKGROUND_RATIO=10 DEF_DIRTY_RATIO=40 DEF_XFS_AGE_BUFFER=15 DEF_XFS_SYNC_INTERVAL=30 DEF_XFS_BUFD_INTERVAL=1 # This must be adjusted manually to the value of HZ in the running kernel # on 2.4, until the XFS people change their 2.4 external interfaces to work in # centisecs. This can be automated, but it's a work in progress that still needs # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external # interfaces, and that is currently always set to 100. So you don't need to # change this on 2.6. XFS_HZ=100 if [ ! -e /proc/sys/vm/laptop_mode ]; then echo "Kernel is not patched with laptop_mode patch." exit 1 fi if [ ! -w /proc/sys/vm/laptop_mode ]; then echo "You do not have enough privileges to enable laptop_mode." exit 1 fi if [ $DO_REMOUNT_NOATIME -eq 1 ]; then NOATIME_OPT=",noatime" fi case "$1" in start) AGE=$((100*$MAX_AGE)) XFS_AGE=$(($XFS_HZ*$MAX_AGE)) echo -n "Starting laptop_mode" if [ -d /proc/sys/vm/pagebuf ] ; then # (For 2.4 and early 2.6.) # This only needs to be set, not reset -- it is only used when # laptop mode is enabled. echo $XFS_AGE > /proc/sys/vm/pagebuf/lm_flush_age echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval elif [ -f /proc/sys/fs/xfs/lm_age_buffer ] ; then # (A couple of early 2.6 laptop mode patches had these.) # The same goes for these. echo $XFS_AGE > /proc/sys/fs/xfs/lm_age_buffer echo $XFS_AGE > /proc/sys/fs/xfs/lm_sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer ] ; then # (2.6.6) # But not for these -- they are also used in normal # operation. echo $XFS_AGE > /proc/sys/fs/xfs/age_buffer echo $XFS_AGE > /proc/sys/fs/xfs/sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then # (2.6.7 upwards) # And not for these either. These are in centisecs, # not USER_HZ, so we have to use $AGE, not $XFS_AGE. echo $AGE > /proc/sys/fs/xfs/age_buffer_centisecs echo $AGE > /proc/sys/fs/xfs/xfssyncd_centisecs echo 3000 > /proc/sys/fs/xfs/xfsbufd_centisecs fi case "$KLEVEL" in "2.4") echo "1" > /proc/sys/vm/laptop_mode echo "30 500 0 0 $AGE $AGE 60 20 0" > /proc/sys/vm/bdflush ;; "2.6") echo "5" > /proc/sys/vm/laptop_mode echo "$AGE" > /proc/sys/vm/dirty_writeback_centisecs echo "$AGE" > /proc/sys/vm/dirty_expire_centisecs echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_ratio echo "$DIRTY_BACKGROUND_RATIO" > /proc/sys/vm/dirty_background_ratio ;; esac if [ $DO_REMOUNTS -eq 1 ]; then cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do PARSEDOPTS="$(parse_mount_opts "$OPTS")" case "$FST" in "ext3"|"reiserfs") PARSEDOPTS="$(parse_mount_opts commit "$OPTS")" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS,commit=$MAX_AGE$NOATIME_OPT ;; "xfs") mount $DEV -t $FST $MP -o remount,$OPTS$NOATIME_OPT ;; esac if [ -b $DEV ] ; then blockdev --setra $(($READAHEAD * 2)) $DEV fi done fi echo "." ;; stop) U_AGE=$((100*$DEF_UPDATE)) B_AGE=$((100*$DEF_AGE)) echo -n "Stopping laptop_mode" echo "0" > /proc/sys/vm/laptop_mode if [ -f /proc/sys/fs/xfs/age_buffer ] && [ ! -f /proc/sys/fs/xfs/lm_age_buffer ] ; then # These need to be restored, if there are no lm_*. echo "$(($XFS_HZ*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer echo "$(($XFS_HZ*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/sync_interval elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then # These need to be restored as well. echo "$((100*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer_centisecs echo "$((100*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/xfssyncd_centisecs echo "$((100*$DEF_XFS_BUFD_INTERVAL))" > /proc/sys/fs/xfs/xfsbufd_centisecs fi case "$KLEVEL" in "2.4") echo "30 500 0 0 $U_AGE $B_AGE 60 20 0" > /proc/sys/vm/bdflush ;; "2.6") echo "$U_AGE" > /proc/sys/vm/dirty_writeback_centisecs echo "$B_AGE" > /proc/sys/vm/dirty_expire_centisecs echo "$DEF_DIRTY_RATIO" > /proc/sys/vm/dirty_ratio echo "$DEF_DIRTY_BACKGROUND_RATIO" > /proc/sys/vm/dirty_background_ratio ;; esac if [ $DO_REMOUNTS -eq 1 ]; then cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do # Reset commit and atime options to defaults. case "$FST" in "ext3"|"reiserfs") PARSEDOPTS="$(parse_mount_opts_wfstab $DEV commit $OPTS)" PARSEDOPTS="$(parse_yesno_opts_wfstab $DEV atime atime $PARSEDOPTS)" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; "xfs") PARSEDOPTS="$(parse_yesno_opts_wfstab $DEV atime atime $OPTS)" mount $DEV -t $FST $MP -o remount,$PARSEDOPTS ;; esac if [ -b $DEV ] ; then blockdev --setra 256 $DEV fi done fi echo "." ;; *) echo "Usage: $0 {start|stop}" ;; esac exit 0 pbbuttonsd-0.7.9/scripts/scripts.d/pcmcia0000755000175000017500000000424110507757764015441 00000000000000#!/bin/sh # This script was provided for those systems with broken APM and those # systems with problem cards that cannot handle a suspend/resume cycle. # The average user will not need to activate it. Systems with broken # APM will not correctly issue a "cardctl suspend" and "cardctl resume" # during a suspend/resume cycle. However, the apm daemon can be used # to run this script which will properly power down and power up your # cards. Some drivers, notably the PCMCIA SCSI drivers, cannot recover # from a suspend/resume cycle. When using a PCMCIA SCSI card, always # use "cardctl eject" prior to suspending the system. This script can # be used to issue the eject command and other necessary commands, such # as unmounting filesystems, etc. # # To activate this script, create a file /etc/pcmcia/apm.opts. This # file should contain one line. Either # # APM=suspend # # if the PCMCIA cards are supposed to be suspended before the system is # suspended or # # APM=eject # # if the PCMCIA cards are supposed to be ejected before the system is # suspended. # name : pcmcia # author : Craig Markwardt # David Brownell # modified : Matthias Grimm # description : handle PCMCIA cards with broken APM # requirements: cardctl in path # limitations : # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config if [ -r /etc/pcmcia/apm.opts ]; then . /etc/pcmcia/apm.opts general_PCMCIAShutdown=$APM fi case "$1" in powersave) ;; custom) ;; performance) ;; suspend) case "$general_PCMCIAShutdown" in suspend) # May be necessary to prevent system freeze if pcmcia # network card is in. #/sbin/ifconfig eth0 down # prevent "card busy" cardctl suspend ;; eject) # May be necessary to prevent system freeze if pcmcia # network card is in. #/sbin/ifconfig eth0 down # prevent "card busy" cardctl eject ;; esac ;; resume) case "$general_PCMCIAShutdown" in suspend) cardctl resume;; eject) cardctl insert;; esac ;; esac pbbuttonsd-0.7.9/scripts/scripts.d/PMac_34000000755000175000017500000000115610507757764015475 00000000000000#!/bin/sh # name : pmac_3400 # author : Stephan Leemburg <@> # modified : Matthias Grimm # description : hardware related stuff for PowerBook 3400 # requirements: # limitations : # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) echo 1 >/proc/sys/kernel/powersave-nap ;; custom) echo 1 >/proc/sys/kernel/powersave-nap ;; performance) echo 0 >/proc/sys/kernel/powersave-nap ;; suspend) ifconfig eth0 down ;; resume) ifconfig eth0 up ;; esac pbbuttonsd-0.7.9/scripts/scripts.d/skeleton0000755000175000017500000000121410507757764016026 00000000000000#!/bin/sh # example power management control script - skeleton # name : # author : # modified : # description : # requirements: # limitations : # # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) ;; custom) ;; performance) ;; suspend) case "$3" in ram) ;; disk) ;; esac ;; resume) case "$3" in ram) ;; disk) ;; esac ;; cover-open|cover-close|cover) case "$3" in open) ;; close) ;; esac ;; esac pbbuttonsd-0.7.9/scripts/event.d/0000755000175000017500000000000010507757764013770 500000000000000pbbuttonsd-0.7.9/scripts/event.d/apmd-compat0000755000175000017500000000244010507757764016040 00000000000000#!/bin/sh # # name : apmd-compat # author : Guido Guenther # description : Execute scripts in /etc/apm for compatibility # # --- end of public part -- don't change below this line --- . pmcs-config [ -d "/etc/apm" ] || exit 0 case "$2" in battery) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; ac) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy change power else run-parts --arg=change --arg=power /etc/apm/event.d if [ -d /etc/apm/other.d ]; then run-parts --arg=change --arg=power /etc/apm/other.d fi fi ;; esac case "$1" in suspend) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 user else run-parts --arg=$1 --arg=user /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=user /etc/apm/$1.d fi fi ;; resume) if [ -x /etc/apm/apmd_proxy ]; then /etc/apm/apmd_proxy $1 suspend else run-parts --arg=$1 --arg=suspend /etc/apm/event.d if [ -d /etc/apm/$1.d ]; then run-parts --arg=$1 --arg=suspend /etc/apm/$1.d fi fi ;; esac pbbuttonsd-0.7.9/scripts/event.d/bdflush0000755000175000017500000000241010507757764015262 00000000000000#!/bin/sh # name : bdflush # author : Matthias Grimm # description : toggle laptop mode in kernel and adjust # memory management buffer flush timeouts # This script will first look for an global laptop-mode # script before running a private version. # requirements: laptop-mode patch in kernel # laptopmode.sh somewhere on your system # limitations : none # # --- end of public part -- don't change below this line --- if [ -x event.d/apmd-compat ]; then if [ -x /etc/apm/event.d/laptop-mode ]; then logger -p daemon.error -t pmcs-bdflush "External laptop-mode script found - exiting." exit 0 fi fi # source configuration . pmcs-config if [ -w /proc/sys/vm/laptop_mode ]; then if [ -x $general_LMScript ]; then case "$1" in powersave) $general_LMScript $powersave_LaptopMode ;; custom) $general_LMScript $custom_LaptopMode ;; performance) $general_LMScript $performance_LaptopMode ;; esac elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Can't find $general_LMScript." fi elif [ -x logger ]; then logger -p daemon.error -t pmcs-bdflush "Laptop-mode patch missing in kernel." fi pbbuttonsd-0.7.9/scripts/event.d/hdsetup0000755000175000017500000000152410507757764015314 00000000000000#!/bin/sh # name : hdsetup # author : Matthias Grimm # description : Set harddisk spin-down timeouts # requirements: hdparm and sync in path # limitations : work only with IDE harddisks # controls only a single harddisk # # --- end of public part -- don't change below this line --- # source configuration . pmcs-config case "$1" in powersave) for HD in $general_HDDevice; do hdparm $powersave_HDOptions -S $(($powersave_HDTimeOff/5)) $HD done ;; custom) for HD in $general_HDDevice; do hdparm $custom_HDOptions -S $(($custom_HDTimeOff/5)) $HD done ;; performance) for HD in $general_HDDevice; do hdparm $performance_HDOptions -S $(($performance_HDTimeOff/5)) $HD done ;; suspend) sync ;; resume) ;; esac